mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
THRIFT-434. ruby compiler should warn when a reserved word is used
This patch adds a bunch of new reserved words to the lexer. Patch: Michael Stockton git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982827 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8fc413fbfd
commit
7f3285eddb
@ -134,14 +134,27 @@ literal_begin (['\"])
|
||||
}
|
||||
|
||||
|
||||
"BEGIN" { thrift_reserved_keyword(yytext); }
|
||||
"END" { thrift_reserved_keyword(yytext); }
|
||||
"__CLASS__" { thrift_reserved_keyword(yytext); }
|
||||
"__DIR__" { thrift_reserved_keyword(yytext); }
|
||||
"__FILE__" { thrift_reserved_keyword(yytext); }
|
||||
"__FUNCTION__" { thrift_reserved_keyword(yytext); }
|
||||
"__LINE__" { thrift_reserved_keyword(yytext); }
|
||||
"__METHOD__" { thrift_reserved_keyword(yytext); }
|
||||
"__NAMESPACE__" { thrift_reserved_keyword(yytext); }
|
||||
"abstract" { thrift_reserved_keyword(yytext); }
|
||||
"alias" { thrift_reserved_keyword(yytext); }
|
||||
"and" { thrift_reserved_keyword(yytext); }
|
||||
"args" { thrift_reserved_keyword(yytext); }
|
||||
"as" { thrift_reserved_keyword(yytext); }
|
||||
"assert" { thrift_reserved_keyword(yytext); }
|
||||
"begin" { thrift_reserved_keyword(yytext); }
|
||||
"break" { thrift_reserved_keyword(yytext); }
|
||||
"case" { thrift_reserved_keyword(yytext); }
|
||||
"catch" { thrift_reserved_keyword(yytext); }
|
||||
"class" { thrift_reserved_keyword(yytext); }
|
||||
"clone" { thrift_reserved_keyword(yytext); }
|
||||
"continue" { thrift_reserved_keyword(yytext); }
|
||||
"declare" { thrift_reserved_keyword(yytext); }
|
||||
"def" { thrift_reserved_keyword(yytext); }
|
||||
@ -149,9 +162,19 @@ literal_begin (['\"])
|
||||
"del" { thrift_reserved_keyword(yytext); }
|
||||
"delete" { thrift_reserved_keyword(yytext); }
|
||||
"do" { thrift_reserved_keyword(yytext); }
|
||||
"dynamic" { thrift_reserved_keyword(yytext); }
|
||||
"elif" { thrift_reserved_keyword(yytext); }
|
||||
"else" { thrift_reserved_keyword(yytext); }
|
||||
"elseif" { thrift_reserved_keyword(yytext); }
|
||||
"elsif" { thrift_reserved_keyword(yytext); }
|
||||
"end" { thrift_reserved_keyword(yytext); }
|
||||
"enddeclare" { thrift_reserved_keyword(yytext); }
|
||||
"endfor" { thrift_reserved_keyword(yytext); }
|
||||
"endforeach" { thrift_reserved_keyword(yytext); }
|
||||
"endif" { thrift_reserved_keyword(yytext); }
|
||||
"endswitch" { thrift_reserved_keyword(yytext); }
|
||||
"endwhile" { thrift_reserved_keyword(yytext); }
|
||||
"ensure" { thrift_reserved_keyword(yytext); }
|
||||
"except" { thrift_reserved_keyword(yytext); }
|
||||
"exec" { thrift_reserved_keyword(yytext); }
|
||||
"false" { thrift_reserved_keyword(yytext); }
|
||||
@ -171,8 +194,11 @@ literal_begin (['\"])
|
||||
"interface" { thrift_reserved_keyword(yytext); }
|
||||
"is" { thrift_reserved_keyword(yytext); }
|
||||
"lambda" { thrift_reserved_keyword(yytext); }
|
||||
"module" { thrift_reserved_keyword(yytext); }
|
||||
"native" { thrift_reserved_keyword(yytext); }
|
||||
"new" { thrift_reserved_keyword(yytext); }
|
||||
"next" { thrift_reserved_keyword(yytext); }
|
||||
"nil" { thrift_reserved_keyword(yytext); }
|
||||
"not" { thrift_reserved_keyword(yytext); }
|
||||
"or" { thrift_reserved_keyword(yytext); }
|
||||
"pass" { thrift_reserved_keyword(yytext); }
|
||||
@ -180,24 +206,38 @@ literal_begin (['\"])
|
||||
"print" { thrift_reserved_keyword(yytext); }
|
||||
"private" { thrift_reserved_keyword(yytext); }
|
||||
"protected" { thrift_reserved_keyword(yytext); }
|
||||
"public" { thrift_reserved_keyword(yytext); }
|
||||
"raise" { thrift_reserved_keyword(yytext); }
|
||||
"redo" { thrift_reserved_keyword(yytext); }
|
||||
"rescue" { thrift_reserved_keyword(yytext); }
|
||||
"retry" { thrift_reserved_keyword(yytext); }
|
||||
"register" { thrift_reserved_keyword(yytext); }
|
||||
"return" { thrift_reserved_keyword(yytext); }
|
||||
"self" { thrift_reserved_keyword(yytext); }
|
||||
"sizeof" { thrift_reserved_keyword(yytext); }
|
||||
"static" { thrift_reserved_keyword(yytext); }
|
||||
"super" { thrift_reserved_keyword(yytext); }
|
||||
"switch" { thrift_reserved_keyword(yytext); }
|
||||
"synchronized" { thrift_reserved_keyword(yytext); }
|
||||
"then" { thrift_reserved_keyword(yytext); }
|
||||
"this" { thrift_reserved_keyword(yytext); }
|
||||
"throw" { thrift_reserved_keyword(yytext); }
|
||||
"transient" { thrift_reserved_keyword(yytext); }
|
||||
"true" { thrift_reserved_keyword(yytext); }
|
||||
"try" { thrift_reserved_keyword(yytext); }
|
||||
"undef" { thrift_reserved_keyword(yytext); }
|
||||
"union" { thrift_reserved_keyword(yytext); }
|
||||
"unless" { thrift_reserved_keyword(yytext); }
|
||||
"unsigned" { thrift_reserved_keyword(yytext); }
|
||||
"until" { thrift_reserved_keyword(yytext); }
|
||||
"use" { thrift_reserved_keyword(yytext); }
|
||||
"var" { thrift_reserved_keyword(yytext); }
|
||||
"virtual" { thrift_reserved_keyword(yytext); }
|
||||
"volatile" { thrift_reserved_keyword(yytext); }
|
||||
"when" { thrift_reserved_keyword(yytext); }
|
||||
"while" { thrift_reserved_keyword(yytext); }
|
||||
"with" { thrift_reserved_keyword(yytext); }
|
||||
"xor" { thrift_reserved_keyword(yytext); }
|
||||
"yield" { thrift_reserved_keyword(yytext); }
|
||||
|
||||
{intconstant} {
|
||||
|
Loading…
Reference in New Issue
Block a user