diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-07-11 08:17:14 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-07-11 08:17:14 +0300 |
commit | 9e419cfbc401e9b9fd45c8e854fdf5ae799261d5 (patch) | |
tree | d73a710963075881315d841dd41dc01ed43a20dd /awkgram.y | |
parent | c8b9f5d5ac4e23a394dc79eccbfb824ddee531ef (diff) | |
download | egawk-9e419cfbc401e9b9fd45c8e854fdf5ae799261d5.tar.gz egawk-9e419cfbc401e9b9fd45c8e854fdf5ae799261d5.tar.bz2 egawk-9e419cfbc401e9b9fd45c8e854fdf5ae799261d5.zip |
Some cleanup about checking letters and identifiers.
Diffstat (limited to 'awkgram.y')
-rw-r--r-- | awkgram.y | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -4086,7 +4086,7 @@ retry: } } - if (c != '_' && ! is_alpha(c)) { + if (! is_letter(c)) { yyerror(_("invalid char '%c' in expression"), c); return lasttok = LEX_EOF; } @@ -6308,6 +6308,18 @@ is_alnum(int c) } +/* + * is_letter --- function to check letters + * isalpha() isn't good enough since it can look at the locale. + * Underscore counts as a letter in awk identifiers + */ + +bool +is_letter(int c) +{ + return (is_alpha(c) || c == '_'); +} + /* is_identchar --- return true if c can be in an identifier */ bool |