Contextualizing keywords

Robert Fraser fraserofthenight at gmail.com
Sun Aug 2 19:03:07 PDT 2009


Walter Bright wrote:
> Chad J wrote:
>> This makes things more difficult for syntax highlighters.  A number of
>> them will just not work correctly because they don't actually parse the
>> code.
> 
> That's true. Another thing keywords provide are "anchors" that enable 
> better error recovery.

Read Herb's article; he mentions error recovery. I agree that the ";" at 
the end of the line is a useful anchor, but in the position "in" "out" 
and "body" can appear, the ONLY valid words are in, out, body, const, 
immutable, shared, pure, nothrow, etc. So the error messages for these 
ones won't get much worse.

For category 3 (keywords that can appear where identifiers can), I agree 
it could get confusing. But at least category 1 (keywords that cannot 
appear in the same place as identifiers) would be little loss.



More information about the Digitalmars-d mailing list