Proposal for SentinelInputRange

Walter Bright newshound2 at digitalmars.com
Thu Feb 28 02:44:08 PST 2013


On 2/28/2013 12:25 AM, Jacob Carlborg wrote:
> On 2013-02-28 08:23, Walter Bright wrote:
>
>> There is always a terminating 0, even if the file ends in 0x1a.
>>
>> (The 0x1A comes from some old editors that end a file with a control Z.)
>
> http://dlang.org/lex.html, "End of File" shows this:
>
> EndOfFile:
>      physical end of the file
>      \u0000
>      \u001A
>
> Doesn't that mean that the input is empty if the file is empty, \u0000 or \u001A
> is encountered?
>

Please follow the source code from file to input to the lexer.

https://github.com/D-Programming-Language/dmd/blob/master/src/root/root.c

line 1012 and 1038


More information about the Digitalmars-d mailing list