summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-20 16:37:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-20 16:37:01 +0000
commit4098e5861e4a6dadf17e6502afbc139bcff3cd3b (patch)
tree46efc0ee553a8d4009758a4b18b4b52259923408 /parse.y
parent1b2d3f81ee00c3fc5f002aaf7a646ed08e605610 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y13
1 files changed, 12 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 8fe1ec99b9..ae55beee32 100644
--- a/parse.y
+++ b/parse.y
@@ -1820,7 +1820,18 @@ none : /* none */
#include "regex.h"
#include "util.h"
-#define is_identchar(c) (((int)(c))!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c)))
+/* We remove any previous definition of `SIGN_EXTEND_CHAR',
+ since ours (we hope) works properly with all combinations of
+ machines, compilers, `char' and `unsigned char' argument types.
+ (Per Bothner suggested the basic approach.) */
+#undef SIGN_EXTEND_CHAR
+#if __STDC__
+# define SIGN_EXTEND_CHAR(c) ((signed char)(c))
+#else /* not __STDC__ */
+/* As in Harbison and Steele. */
+# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
+#endif
+#define is_identchar(c) (SIGN_EXTEND_CHAR(c)!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c)))
static char *tokenbuf = NULL;
static int tokidx, toksiz = 0;