summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Scanner.l
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2010-05-24 09:51:55 -0700
committerMark Spruiell <mes@zeroc.com>2010-05-24 09:51:55 -0700
commit487dd39e3483217cccb80f46e7a65674c7f6c05a (patch)
tree75fd3df459df63c2646a4e20c7a32f1ff05a09dd /cpp/src/Slice/Scanner.l
parentbug 4623 - missing doc comments (diff)
downloadice-487dd39e3483217cccb80f46e7a65674c7f6c05a.tar.bz2
ice-487dd39e3483217cccb80f46e7a65674c7f6c05a.tar.xz
ice-487dd39e3483217cccb80f46e7a65674c7f6c05a.zip
bug 4752 - allow underscores in Slice identifiers
Diffstat (limited to 'cpp/src/Slice/Scanner.l')
-rw-r--r--cpp/src/Slice/Scanner.l28
1 files changed, 0 insertions, 28 deletions
diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l
index a615b2fd149..268a9f32d9e 100644
--- a/cpp/src/Slice/Scanner.l
+++ b/cpp/src/Slice/Scanner.l
@@ -42,7 +42,6 @@ typedef std::map<std::string, int, Slice::CICompare> StringTokenMap;
static StringTokenMap keywordMap;
void initScanner();
-void checkIdentifier(const string&);
int checkKeyword(string&);
}
@@ -182,7 +181,6 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e
ident->v = *yytext == '\\' ? yytext + 1 : yytext;
ident->v.erase(ident->v.find_first_of(" \t\v\n\r\f("));
*yylvalp = ident;
- checkIdentifier(ident->v);
if(*yytext == '\\')
{
return ICE_IDENT_OP;
@@ -195,7 +193,6 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e
StringTokPtr ident = new StringTok;
ident->v = *yytext == '\\' ? yytext + 1 : yytext;
*yylvalp = ident;
- checkIdentifier(ident->v);
return *yytext == '\\' ? ICE_IDENTIFIER : checkKeyword(ident->v);
}
@@ -483,31 +480,6 @@ initScanner()
}
//
-// Check if an identifier is well-formed.
-//
-
-void
-checkIdentifier(const string& id)
-{
- if(id.find('_') != string::npos)
- {
- unit->error("illegal underscore in identifier `" + id + "'");
- }
-
- //
- // Weed out identifiers with reserved suffixes.
- //
- static const string suffixBlacklist[] = { "Helper", "Holder", "Prx", "Ptr" };
- for(size_t i = 0; i < sizeof(suffixBlacklist) / sizeof(*suffixBlacklist); ++i)
- {
- if(id.find(suffixBlacklist[i], id.size() - suffixBlacklist[i].size()) != string::npos)
- {
- unit->error("illegal identifier `" + id + "': `" + suffixBlacklist[i] + "' suffix is reserved");
- }
- }
-}
-
-//
// Check if an identifier looks like a keyword.
// If the identifier is a keyword, return the
// corresponding keyword token; otherwise, return