Character unescaping improvements #699
Labels
area:standard-support
Related to the C standard support
good-first-issue
An issue considered simple enough for new contributors
status:help-wanted
Open for contributors
Some issues with the current code in
Cesium.CodeGen.Ir.Expressions.Constants.CharConstant.UnescapeCharacter
andCesium.Parser.TokenExtensions.UnwrapStringLiteral
:UnescapeCharacter
doesn't support\u
and\U
akauniversal-character-name
from the standard.UnescapeCharacter
also has a bug in handling octal and hex sequences: both are considered to only have two digits, with special treatment of\0
. While the standard defines octal sequences to be either one, two or three characters long, while the hex escapes are of arbitrary length.\0
should not be a special case in either of the methods; it is just an octal number.UnwrapStringLiteral
also seems to treat octal sequences weirdly: I only see support for octal numbers starting from0
which is not correct (UnescapeCharacter
handles these better).\m
) and treat it as the character itself. We don't do this: we either silently accept or break on such sequences.See also #295.
The text was updated successfully, but these errors were encountered: