Add support for C++17 hexadecimal floating literals
This commit is contained in:
parent
200984f051
commit
cf83adfcd1
7 changed files with 111 additions and 1 deletions
|
|
@ -1196,6 +1196,10 @@ static int look(Scanner *s) {
|
|||
return SWIG_TOKEN_INT;
|
||||
if (isxdigit(c))
|
||||
state = 85;
|
||||
else if (c == '.') /* hexadecimal float */
|
||||
state = 860;
|
||||
else if ((c == 'p') || (c == 'P')) /* hexadecimal float */
|
||||
state = 820;
|
||||
else if ((c == 'l') || (c == 'L')) {
|
||||
state = 87;
|
||||
} else if ((c == 'u') || (c == 'U')) {
|
||||
|
|
@ -1220,7 +1224,22 @@ static int look(Scanner *s) {
|
|||
return SWIG_TOKEN_INT;
|
||||
}
|
||||
break;
|
||||
|
||||
case 860:
|
||||
/* hexadecimal float */
|
||||
if ((c = nextchar(s)) == 0) {
|
||||
Swig_error(cparse_file, cparse_start_line, "Hexadecimal floating literals require an exponent\n");
|
||||
return SWIG_TOKEN_ERROR;
|
||||
}
|
||||
if (isxdigit(c))
|
||||
state = 860;
|
||||
else if ((c == 'p') || (c == 'P'))
|
||||
state = 820;
|
||||
else {
|
||||
retract(s, 2);
|
||||
Swig_error(cparse_file, cparse_start_line, "Hexadecimal floating literals require an exponent\n");
|
||||
return SWIG_TOKEN_ERROR;
|
||||
}
|
||||
break;
|
||||
case 86:
|
||||
/* Rest of floating point number */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue