Allows the use of part of the language keywords?

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 28 01:35:06 PDT 2016


On Sunday, 28 August 2016 at 08:25:38 UTC, Basile B. wrote:
> On Sunday, 28 August 2016 at 08:07:27 UTC, Cauterite wrote:
>> On Sunday, 28 August 2016 at 04:32:46 UTC, Basile B. wrote:
>>> You must keep track of the previous token, which is not 
>>> usually done in a scanner.
>>
>> That sounds like a pretty trivial feature to me. There's no 
>> way that's a legitimate obstacle.
>
> Look at this, this is perfectly valid D code:
>
> void main()
> in {}
> body /**/ #line 8
> /**/
> //
> /+
> /+
> +/
> +/
> {}
>
> to think that it can be detected with a simple lookup backward 
> (or forward from the KW) is too simplistic.

i have a perfect solution to this: don't write such code!


More information about the Digitalmars-d mailing list