Handling of U+2028 and U+2029 in source code

kdevel kdevel at vogtner.de
Sun Oct 15 19:21:33 UTC 2023


According to [1] U+2028 and U+2029 are considered end-of-line 
characters. Does this make sense?

```d
$ cat lsps.d
void main ()
{
    enum b = 8;
    mixin ("enum a1 =\u2028b; pragma (msg, a1);");
    mixin ("enum a2\u2028= b; pragma (msg, a2);");
    mixin ("enum\u2028a3 = b; pragma (msg, a3);");
}
$ dmd lsps.d
8
lsps.d-mixin-5(5): Error: char 0x2028 not allowed in identifier
lsps.d-mixin-6(6): Error: char 0x2028 not allowed in identifier
```

[1] https://dlang.org/spec/lex.html#end_of_line


More information about the Digitalmars-d mailing list