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

kdevel kdevel at vogtner.de
Mon Oct 16 17:17:28 UTC 2023


On Monday, 16 October 2023 at 02:45:17 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> Based upon how the identifier tokenization occurs greedily, yes 
> it makes sense.

The error message is confusing, compare with this code, using 
returns:

```
$ cat ret.d
void main ()
{
    enum b = 8;
    mixin ("enum a1 =\rb; pragma (msg, a1);");
    mixin ("enum a2\r= b; pragma (msg, a2);");
    mixin ("enum\ra3 = b; pragma (msg, a3);");
}
$ dmd ret.d
8
8
8
```

Why are U+2028 and U+2029 handled unlike \r and \n?


More information about the Digitalmars-d mailing list