Additional syntax - B.1.2 String Literals
barraclough at apple.com
Tue Dec 28 17:56:50 PST 2010
In the definition of OctalEscapeSequence, and in the accompanying semantics, it is required at numerous points that the subsequent character is not a DecimalDigit:
> OctalEscapeSequence ::
> OctalDigit [lookahead ∉ DecimalDigit]
> ZeroToThree OctalDigit [lookahead ∉ DecimalDigit]
> FourToSeven OctalDigit
> ZeroToThree OctalDigit OctalDigit
In these cases it would seem to make more sense to require that the subsequent character is not an OctalDigit. For example, implementations supporting this additional syntax the string literal "\019" is permitted (with '\01' matching the rule 'ZeroToThree OctalDigit').
As such, I think throughout B.1.2. it would make more sense to replace DecimalDigit with OctalDigit.
Additionally, I believe it would also be helpful to redefine the following rule (in section B.1.2):
> EscapeCharacter ::
Again, replacing DecimalDigit with OctalDigit. This would add documentation reflecting the fact that in addition to permitting octal escapes implementations commonly permit '\8\ and '\9' to be handled as NonEscapeCharacter sequences in string literals.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss