]> ocean-lang.org Git - ocean/commitdiff
scanner: change the meaning of ignoring comment tokens.
authorNeilBrown <neil@brown.name>
Tue, 6 Oct 2020 04:44:46 +0000 (15:44 +1100)
committerNeilBrown <neil@brown.name>
Tue, 6 Oct 2020 04:53:50 +0000 (15:53 +1100)
Previously ignoring comment tokens meant they were still parsed, but not
returned.  The only way to stop them being parsed was to declare
known marks for the start symbols.

This made is not possible for parsergen to define a language that had
a known mark that would otherwise start a comment.

So change the ignoring of comment tokens to mean they aren't parsed.  If
you want to parse comments but not return them, leave the new
"return_comments" field as so.  In the unusual case that you want to
return comments set return_comments to 1.

Confirm that this has the desired effect by added in "//" as an
integer-division operator to the sample calculator.

Signed-off-by: NeilBrown <neil@brown.name>

No differences found