diff options
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 |