Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Properly parse comments on last line of code
Browse files Browse the repository at this point in the history
Previously, comments on last line of code would throw error because
they wouldn't terminate in a newline character. Allow for matching
either newline or end of file ($) for comments.
  • Loading branch information
kkashin committed Mar 1, 2016
1 parent 84f2fcf commit 28603fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions compiler/planout.jison
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

%%

"#"(.)*\n /* skip comments */
"#"(.)*(\n|$) /* skip comments */
\s+ /* skip whitespace */

"true" return 'TRUE'
Expand All @@ -18,7 +18,7 @@

[a-zA-Z_][a-zA-Z0-9_]* return 'IDENTIFIER'

[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? { yytext = Number(yytext); return 'CONST'; }
[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? { yytext = Number(yytext); return 'CONST'; }
\"(\\.|[^\\"])*\" { yytext = yytext.substr(1, yyleng-2); return 'CONST'; }
\'[^\']*\' { yytext = yytext.substr(1, yyleng-2); return 'CONST'; }

Expand Down
2 changes: 1 addition & 1 deletion compiler/planout.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 28603fe

Please sign in to comment.