mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Ignore ordinal suffixes on numbers (bug #15210)
This commit is contained in:
parent
fd7ff95fde
commit
449b53e34a
1 changed files with 10 additions and 0 deletions
|
@ -862,6 +862,16 @@ yylex ()
|
|||
yyInput--;
|
||||
if (sign < 0)
|
||||
yylval.Number = -yylval.Number;
|
||||
/* Ignore ordinal suffixes on numbers */
|
||||
c = *yyInput;
|
||||
if (c == 's' || c == 'n' || c == 'r' || c == 't') {
|
||||
c = *++yyInput;
|
||||
if (c == 't' || c == 'd' || c == 'h') {
|
||||
yyInput++;
|
||||
} else {
|
||||
yyInput--;
|
||||
}
|
||||
}
|
||||
return sign ? tSNUMBER : tUNUMBER;
|
||||
}
|
||||
if (ISALPHA (c))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue