std.d.lexer requirements

Christophe Travert travert at phare.normalesup.org
Thu Aug 2 13:43:49 PDT 2012


"Jonathan M Davis" , dans le message (digitalmars.D:174059), a écrit :
> In either case, because the consumer must do something other than simply 
> operate on front, popFront, empty, etc., you're _not_ dealing with the range 
> API but rather working around it.

In some case a range of dchar is useful. In some case a range of char is 
sufficient, and much more efficient. And for the UTF-aware programer, it 
makes much sense.

The fact that you sometimes have to buffer some information because the 
meaning of one element is affected by the previous element is a normal 
issue in many algoritms, it's not working arround anything. Your lexer 
uses range API, would you say it is just working arroung range because 
you have to take into account several caracters (let they be dchars) at 
the same time to know what they are meaning?



More information about the Digitalmars-d mailing list