lib/parser/ext/lexer.lex in fancy-0.3.3 vs lib/parser/ext/lexer.lex in fancy-0.4.0

- old
+ new

@@ -14,11 +14,11 @@ capital [A-Z] lower [a-z] letter [A-Za-z] special [-+?!=*/^><%&~] special_under ({special}|"_") -operator ({special}+|"||"{special_under}*) +operator ({special}+|" | "|"||"{special_under}*) int_lit [-+]?{digit}({digit}|_{digit})* double_lit {int_lit}\.{digit}+ hex_lit 0[xX]{hexdigit}+ bin_lit 0[bB]{bindigit}+ oct_lit 0[oO]{octdigit}+ @@ -40,27 +40,26 @@ arrow "=>" thin_arrow "->" delimiter [ \n\r\t\(\)] return_local "return_local" return "return" -require "require:" try "try" catch "catch" finally "finally" retry "retry" super "super" -private "private" -protected "protected" self "self" match "match" case "case" identifier @?@?({lower}|[_&*])({letter}|{digit}|{special_under})* +label @{identifier}@ +goto_ "goto" selector ({letter}|[_&*])({letter}|{digit}|{special_under})*":" constant {capital}({letter}|{digit}|{special_under})* nested_constant ({constant}::)+{constant} -symbol_lit \'({identifier}|{operator}|{constant}|:|"[]")+ -ruby_send_open {identifier}{lparen} +symbol_lit \'({identifier}|{operator}|{constant}|:|"[]"|"|")+ +ruby_send_open ({constant}|{identifier}){lparen} ruby_oper_open {operator}{lparen} regexp_lit "/".*"/" comma , semi ; @@ -116,38 +115,43 @@ {at_lcurly} { return AT_LCURLY; } {lcurly} { return LCURLY; } {rcurly} { return RCURLY; } {lbracket} { return LBRACKET; } {rbracket} { return RBRACKET; } -{lhash} { return LHASH; } -{rhash} { return RHASH; } +{lhash} { return LEFTHASH; } +{rhash} { return RIGHTHASH; } {stab} { return STAB; } {arrow} { return ARROW; } {thin_arrow} { return THIN_ARROW; } {equals} { return EQUALS; } {operator} { yylval.object = rb_str_new2(yytext); return OPERATOR; } {return_local} { return RETURN_LOCAL; } {return} { return RETURN; } -{require} { return REQUIRE; } {try} { return TRY; } {catch} { return CATCH; } {finally} { return FINALLY; } {retry} { return RETRY; } {super} { return SUPER; } -{private} { return PRIVATE; } -{protected} { return PROTECTED; } {self} { yylval.object = rb_str_new2(yytext); return IDENTIFIER; } {match} { return MATCH; } {case} { return CASE; + } +{goto_} { + yylval.object = rb_str_new2(yytext); + return GOTO; + } +{label} { + yylval.object = rb_str_new2(yytext); + return LABEL; } {identifier} { yylval.object = rb_str_new2(yytext); return IDENTIFIER; }