[Grace-core] Quick Question re comments:

Lex Spoon lex at lexspoon.org
Tue Feb 3 07:30:31 PST 2015


Having an excuse to reject code like that is a nice little bragging point!

For the spec, maybe enumerate the precise list of things that can have a
comment on them?

A related example to James' is import directives with comments in the
middle. This came up at Semmle a few months ago, because the more general
syntax--which nobody even really wants--leads to a measurable slowdown on
scanning a file for its list of imports.

Grace is using its comment rule to outlaw some such abominations. Another
trick is to tweak the tokenizer to scan slightly larger tokens than is
traditionally done. Two examples that I have seen work well are to make
"foo.bar.baz" and "foo(" be single, indivisible tokens.

Neat stuff.

Lex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20150203/040faffb/attachment.html>


More information about the Grace-core mailing list