small fixes

This commit is contained in:
Gabriel Fontes 2023-06-06 17:02:01 -03:00 committed by Derick Rethans
parent a48b977d3f
commit cd9dba81c7
2 changed files with 4 additions and 5 deletions

View File

@ -360,7 +360,6 @@ TABS_AND_SPACES [ \t]
WHITESPACE [ \t]+
CONSTANT [a-zA-Z_][a-zA-Z0-9_]*
LABEL_CHAR [^=\n\r\t;&|^$~(){}!"\[\]\x00]
/* FIXME: Is this missing a \0? */
LABEL ({LABEL_CHAR}+)
TOKENS [:,.\[\]"'()&|^+-/*=%$!~<>?@{}]
OPERATORS [&|^~()!]
@ -372,7 +371,7 @@ RAW_VALUE_CHARS [^\n\r;\000]
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
VALUE_CHARS ([^$= \t\n\r;&|^~()!"'\000]|{LITERAL_DOLLAR})
FALLBACK_CHARS ([^$\n\r;"'!}\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
FALLBACK_CHARS ([^$\n\r;"'}\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
<!*> := yyleng = YYCURSOR - SCNG(yy_text);
@ -600,7 +599,7 @@ end_raw_value_chars:
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
<ST_VAR_FALLBACK>{FALLBACK_CHARS}+ { /* Same as above, but excluding '}' */
<ST_VAR_FALLBACK>{FALLBACK_CHARS}+ { /* Same as below, but excluding '}' */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}

View File

@ -4,7 +4,7 @@ Ini parsing errors should not result in memory leaks
<?php
var_dump(parse_ini_string('a="b'));
var_dump(parse_ini_string('a=${b'));
var_dump(parse_ini_string('a=${b!a'));
var_dump(parse_ini_string('a=${b:-a'));
?>
--EXPECTF--
Warning: syntax error, unexpected end of file, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in Unknown on line 1
@ -15,6 +15,6 @@ Warning: syntax error, unexpected end of file, expecting TC_FALLBACK or '}' in U
in %s on line %d
bool(false)
Warning: syntax error, unexpected end of file, expecting TC_FALLBACK or '}' in Unknown on line 1
Warning: syntax error, unexpected TC_FALLBACK, expecting TC_VARNAME in Unknown on line 1
in %s on line %d
bool(false)