std.d.lexer: pre-voting review / discussion

Walter Bright newshound2 at digitalmars.com
Wed Sep 11 16:42:34 PDT 2013


On 9/11/2013 3:02 PM, H. S. Teoh wrote:
> No, in typical D code, user-defined type names are capitalized, such as
> InputRange, Duration, Complex, ByLine, etc.. They do not have 'Type' in
> their names (we don't call them InputRangeType, for example). So this
> usage doesn't conflict at all.

It's not a type as is understood in D. It's an enumerated value.


> Constructors with many arguments are evil, because you can't just modify
> one setting and use defaults for the rest; you have to specify all of
> them up to the last default argument you have to change.

It's not that big a deal, and certainly not evil.


>>>> 6. No clue how lookahead works with this. Parsing D requires
>>>> arbitrary lookahead.
>>>
>>> What has this got to do with lexing?
>>
>> The lexer needs to support backing up and going forward again.
>> That's how the dmd lexer works.
>
> Then the parser should be fixed.

The parser works fine. It doesn't need fixing.


>> The point of having the input be an InputRange is you DO NOT CARE if
>> the input is coming from a string, file, etc.
>
> Yes, but the docs currently doesn't say what form this input range must
> take. Must it be a range of characters?

It does say that.



More information about the Digitalmars-d mailing list