diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-09-14 19:30:40 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-09-14 19:30:40 +0300 |
commit | 23681ec5b179a4e981781ce2daa08f61cb7317d4 (patch) | |
tree | 3b558e0a6e276ba5dae5565aa4fa71770f6ab19a /awkgram.c | |
parent | dc03ae8d25acc19f27f015ab568e07f7d24fe2f6 (diff) | |
parent | 8a1df492afae19d544fa5e5b636ed427b2d1c3f5 (diff) | |
download | egawk-23681ec5b179a4e981781ce2daa08f61cb7317d4.tar.gz egawk-23681ec5b179a4e981781ce2daa08f61cb7317d4.tar.bz2 egawk-23681ec5b179a4e981781ce2daa08f61cb7317d4.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -195,7 +195,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -#define is_identchar(c) (isalnum(c) || (c) == '_') +static bool is_identchar(int c); #line 201 "awkgram.c" /* yacc.c:339 */ @@ -8087,3 +8087,36 @@ install_builtins(void) } } } + +/* is_identchar --- return true if c can be in an identifier */ + +/* + * 9/2014: This can't be: + * + * #define is_identchar(c) (isalnum(c) || (c) == '_') + * + * because in non-C locales, character codes outside the set of + * ASCII letters and digits pass the test. BLEAH. + */ + +static bool +is_identchar(int c) +{ + switch (c) { + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': + case 's': case 't': case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': + case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + case '0': case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + case '_': + return true; + } + return false; +} |