allow hexadecimal and octal escapes within character constants

This commit is contained in:
Josh Holtrop 2018-04-11 21:38:58 -04:00
parent 090521a805
commit 5615c5781d

View File

@ -117,6 +117,8 @@ L?'\\n' (void)'\n'; return TOK_CHAR_CONST;
L?'\\r' (void)'\r'; return TOK_CHAR_CONST;
L?'\\t' (void)'\t'; return TOK_CHAR_CONST;
L?'\\v' (void)'\v'; return TOK_CHAR_CONST;
L?'\\x[0-9A-Fa-f]{2}' return TOK_CHAR_CONST;
L?'\\[0-7]{1,3}' return TOK_CHAR_CONST;
[0-9]+([uU][lL]?[lL]?)? return TOK_INT_CONST;
0[xX][0-9a-fA-F]+([uU][lL]?[lL]?)? return TOK_INT_CONST;
([0-9]+\.[0-9]*|\.[0-9]+)([eE][-+]?[0-9]+)?[fFlL]? return TOK_FLOAT_CONST;