Permalink
Browse files

Handle comments and empty string/symbol/regex literals

  • Loading branch information...
1 parent 6b86e4d commit ad48b49155cdc84f5f31d720f08ab95ce3019511 @singpolyma committed Mar 17, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 rpnr.l
View
4 rpnr.l
@@ -12,8 +12,10 @@ void do_message(const char *);
%}
%%
+^#.+$ ; /* ignore comments */
+\/[^\/]*\/|'[^']*'|\"[^\"]*\" { push(yytext); }
:[^ \t\r\n\(\)]+|[^0-9a-zA-Z \t\r\n\(\)]+ { do_message(yytext); }
-\/[^\/]+\/|'[^']+'|\"[^\"]+\"|[^ \t\r\n\(\)]+ { push(yytext); }
+[^ \t\r\n\(\)]+ { push(yytext); }
[ \t\r\n\(\)] ; /* ignore whitespace */
%%

0 comments on commit ad48b49

Please sign in to comment.