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

Paul Backus snarwin at gmail.com
Tue Dec 3 20:40:14 UTC 2019


On Tuesday, 3 December 2019 at 18:34:22 UTC, H. S. Teoh wrote:
> On Tue, Dec 03, 2019 at 07:38:29AM -0500, Andrei Alexandrescu 
> via Digitalmars-d wrote:
>> On 12/3/19 4:03 AM, Mike Parker wrote:
>> > This is the feedback thread for the first round of Community 
>> > Review for DIP 1026, "Deprecate Context-Sensitive String 
>> > Literals":
>> > 
>> > https://github.com/dlang/DIPs/blob/a7199bcec2ca39b74739b165fc7b97afff9e29d1/DIPs/DIP1026.md
>> 
>> This DIP is a non-starter. Here documents are easily and 
>> effectively handled during lexing and have no impact on the 
>> language grammar.
>
[...]
>
> As Andrei said, heredoc string are trivial to parse because 
> they are essentially a single big token.  This should not pose 
> any problem for the parser at all.

By definition, a context-free grammar is defined in terms of a 
finite set of non-terminal symbols (i.e., tokens). [1] The set of 
all string literals is infinite. Therefore, either string 
literals are not tokens, or D's grammar is not context-free.

[1] 
https://en.wikipedia.org/wiki/Context-free_grammar#Formal_definitions


More information about the Digitalmars-d mailing list