Remove comments from parser & grammar
This commit is contained in:
parent
a0dd6f9ca6
commit
26b0e6771d
2 changed files with 3 additions and 9 deletions
|
|
@ -21,7 +21,7 @@ using bp = ::pslang::parser::bison::parser;
|
|||
|
||||
[ \r\t]+ { ctx.location.step(); }
|
||||
|
||||
"//"[^\n]* { return bp::make_comment(ctx.location); }
|
||||
"//"[^\n]* { ctx.location.step(); }
|
||||
|
||||
const { return bp::make_const(ctx.location); }
|
||||
let { return bp::make_let(ctx.location); }
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ template <typename T>
|
|||
%define api.token.prefix {tok_}
|
||||
|
||||
%token newline "newline"
|
||||
%token comment "comment"
|
||||
%token assignment "="
|
||||
%token colon ":"
|
||||
%token comma ","
|
||||
|
|
@ -228,16 +227,11 @@ statement_block
|
|||
;
|
||||
|
||||
statement_line
|
||||
: statement optional_comment { $$ = $1; }
|
||||
: statement { $$ = $1; }
|
||||
;
|
||||
|
||||
empty_line
|
||||
: optional_comment
|
||||
;
|
||||
|
||||
optional_comment
|
||||
: comment
|
||||
| %empty
|
||||
: %empty
|
||||
;
|
||||
|
||||
statement
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue