feat: Allow line-comments in DataStream parser

Supports c#/c++ style line comments (i.e., that begin with '//')

TODO: block comments
This commit is contained in:
John Colvin committed 2023-10-26 12:59:44 -04:00
1 parent 633163518a
commit d0d3c9de4e
2 files changed
+14

No files matched your search

@@ -23,6 +23,7 @@
%token BOOLEAN_CONSTANT, INTEGER_CONSTANT, REAL_CONSTANT, DATE_TIME_CONSTANT, CS_STRING_CONSTANT, NULL_CONSTANT
%token PARENTHESIS_OPEN, PARENTHESIS_CLOSE, COMMA, IDENTIFIER, EQUALS, QUOTE_OPEN, QUOTE_CLOSE
%token LINE_COMMENT
%nonassoc EQUALS
@@ -49,6 +50,12 @@ Statement :
| IDENTIFIER EQUALS Statement {
$$ = new Assignment($1.Identifier, $3);
}
| LINE_COMMENT Statement {
$$ = $2;
}
| Statement LINE_COMMENT {
$$ = $1;
}
;
Arguments :
@@ -26,6 +26,9 @@ Comma ,
QuoteOpen \[
QuoteClose \]
/* Comments */
LineComment \/\/[^\n\r]*(\n|\r|\r\n)
%%
{Equals} {
@@ -92,4 +95,8 @@ QuoteClose \]
return (int)DataStreamExpressionToken.IDENTIFIER;
}
{LineComment} {
return (int)DataStreamExpressionToken.LINE_COMMENT;
}
%%