[Issue 1466] New: Spec claims maximal munch technique alwaysworks: not for "1..3"

BCS ao at pathlink.com
Sun Sep 2 16:28:17 PDT 2007


Reply to Chris Nicholson-Sauls,

> BCS wrote:
> 
>> Reply to d-bugmail at puremagic.com,
>> 
>>> "The source text is split into tokens using the maximal munch
>>> technique, i.e., the lexical analyzer tries to make the longest
>>> token it can."
>>> 
>> another case:
>> 
>> actual
>> !isGood -> ! isGood
>> MaxMunch
>> !isGood -> !is Good
> I might be wrong, but my guess is that 'is' is always treated as its
> own entity, so that '!is' is really ('!' 'is').  Its not a bad

That's how I spoted it in the first place

> practice when one has keyword-operators to do this, to avoid MM
> screwing up user's identifiers.  But, as I haven't taken any trips
> through the DMD frontend source, I might be completely off.
> 

For that to work the lexer has to keep track of whitespace. :-b




More information about the Digitalmars-d-bugs mailing list