DIP 1026---Deprecate Context-Sensitive String Literals---Community Review Round 1

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Dec 3 21:21:30 UTC 2019


On Tuesday, 3 December 2019 at 21:04:52 UTC, H. S. Teoh wrote:
> Treating string (or any other) literals as non-tokens makes no 
> sense because they are not symmetric with non-string (or other) 
> tokens, e.g., D tokens allow arbitrary whitespace between them, 
> yet you cannot arbitrarily insert whitespace into a string 
> literal without changing its semantics.

Just change the syntax to q"delimiter .... retimiled" and I 
believe it will be context free... IIRC.

So yeah, I agree. CFG is not a the right argument. Never 
understood why people are so enarmoured by them, parsers are far 
more powerful today than they used to be. The human should be the 
important factor when designing syntax, not the parser...

Also, not sure if it is context free if you include comments... 
But I could be wrong, and again I don't think it should matter...



More information about the Digitalmars-d mailing list