Raw string literals and Unicode escapes
Remi Forax
forax at univ-mlv.fr
Sun Feb 25 12:19:05 UTC 2018
I'm late in the game but why not using the same system as Perl, PHP, Ruby to solve the Lts [1], i.e
you have a sequence that says this is the starts of a raw string (%Q, qq, m) then a character (in a predefined list), the raw string and at the end of the raw string the same character as at the beginning (or its mirror).
By example, this 'raw' as prefix for a raw string
raw`this is a raw string`
raw'this is another raw string'
raw[yet another raw string]
Rémi
[1] https://en.wikipedia.org/wiki/Leaning_toothpick_syndrome
> De: "John Rose" <john.r.rose at oracle.com>
> À: "Alex Buckley" <alex.buckley at oracle.com>
> Cc: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Mercredi 14 Février 2018 23:46:54
> Objet: Re: Raw string literals and Unicode escapes
> On Feb 14, 2018, at 2:42 PM, Alex Buckley < [ mailto:alex.buckley at oracle.com |
> alex.buckley at oracle.com ] > wrote:
>> Also, the inclusion of RawSP makes the lexing of RawStringLiteral ambiguous,
>> since RawStringBody allows opening and closing whitespace. No doubt this can be
>> fixed with rules involving "If the first character after RawSP is a backtick
>> ...", but now being like Markdown is getting expensive.
> These matters are already covered in the draft, under the blanket
> provision that the RSB cannot contain a close-quote sequence.
> So I don't think I swept anything under the covers there.
> A similar effect could be gotten by replacing RawSP with any
> other raw character (fixed by the JLS), such as period ``.asdf.``,
> double-quote ``"asdf"``, etc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20180225/b5416620/attachment.html>
More information about the amber-spec-experts
mailing list