bc: fix keyword matching to not think "ifz" is the "if" keyword

function                                             old     new   delta
zbc_lex_next                                        2224    2225      +1

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-12-20 16:48:50 +01:00
parent 503faf9d53
commit 5acd14ba5b
2 changed files with 7 additions and 0 deletions

View File

@@ -2950,6 +2950,8 @@ static BC_STATUS zbc_lex_identifier(BcLex *l)
continue;
match:
// buf starts with keyword bc_lex_kws[i]
if (isalnum(buf[j]) || buf[j]=='_')
continue; // "ifz" does not match "if" keyword, "if." does
l->t.t = BC_LEX_KEY_1st_keyword + i;
if (!bc_lex_kws_POSIX(i)) {
s = bc_posix_error_fmt("%sthe '%.8s' keyword", "POSIX does not allow ", bc_lex_kws[i].name8);