add octal escape in string
This commit is contained in:
parent
81614c41ab
commit
3170f0870c
@ -137,7 +137,14 @@ L?'\\v' (void)'\v'; return TOK_CHAR_CONST;
|
||||
\\x[0-9A-Fa-f]{2} {
|
||||
/* hexadecimal escape code */
|
||||
unsigned int val;
|
||||
(void) sscanf(yytext + 2, "%x", &val);
|
||||
(void)sscanf(yytext + 1, "%x", &val);
|
||||
char v[2] = {(char)val, '\0'};
|
||||
String_concat(build_string, v);
|
||||
}
|
||||
\\[0-7][0-7]?[0-7]? {
|
||||
/* octal escape code */
|
||||
unsigned int val;
|
||||
(void)sscanf(yytext + 1, "%o", &val);
|
||||
char v[2] = {(char)val, '\0'};
|
||||
String_concat(build_string, v);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user