diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-09-21 15:49:47 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-09-21 15:49:47 -0400 |
commit | b4d06df669e1eaf6c98cacb5c5f299bb5324e804 (patch) | |
tree | 50fb039c2cf280921e7650230cb42b0669e17f0b /ext.c | |
parent | 94e3f93395de538d73826e128281a3ea9591a5a9 (diff) | |
parent | 8b4e8f702df30b2b2238158504de5d8eb436958d (diff) | |
download | egawk-b4d06df669e1eaf6c98cacb5c5f299bb5324e804.tar.gz egawk-b4d06df669e1eaf6c98cacb5c5f299bb5324e804.tar.bz2 egawk-b4d06df669e1eaf6c98cacb5c5f299bb5324e804.zip |
Merge 'master' into select
Diffstat (limited to 'ext.c')
-rw-r--r-- | ext.c | 30 |
1 files changed, 3 insertions, 27 deletions
@@ -46,33 +46,9 @@ extern SRCFILE *srcfiles; static bool is_letter(unsigned char 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 '_': - return true; - default: - return false; - } + return (is_alpha(c) || c == '_'); } -/* is_identifier_char --- return true if a character can be used in an identifier */ - -static bool -is_identifier_char(unsigned char c) -{ - return (is_letter(c) || isdigit(c)); -} - - #define INIT_FUNC "dl_load" /* load_ext --- load an external library */ @@ -224,7 +200,7 @@ make_builtin(const awk_ext_func_t *funcinfo) return awk_false; for (sp++; (c = *sp++) != '\0';) { - if (! is_identifier_char(c)) + if (! is_identchar(c)) return awk_false; } @@ -279,7 +255,7 @@ make_old_builtin(const char *name, NODE *(*func)(int), int count) /* temporary * fatal(_("extension: illegal character `%c' in function name `%s'"), *sp, name); for (sp++; (c = *sp++) != '\0';) { - if (! is_identifier_char(c)) + if (! is_identchar(c)) fatal(_("extension: illegal character `%c' in function name `%s'"), c, name); } |