summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-28 19:40:06 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-28 19:40:06 -0800
commitec7c4e0d60e22c10b6f7817436bd3f4abf2d5356 (patch)
treeb0fc3249043cc27f83d4f26d594b0afb112cb270 /lisc
parent7f738bb025195cfb91403588480877c12e72a6d6 (diff)
downloadroux-ec7c4e0d60e22c10b6f7817436bd3f4abf2d5356.tar.gz
Make parser slightly more accepting.
	'_' is ok to start a symbol, and '$' is an acceptable character
	within a symbol.
Diffstat (limited to 'lisc')
-rw-r--r--lisc/parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisc/parse.c b/lisc/parse.c
index 2c25476..1a39db6 100644
--- a/lisc/parse.c
+++ b/lisc/parse.c
@@ -247,15 +247,15 @@ lex()
 	}
 	if (0)
 Alpha:		c = fgetc(inf);
-	if (!isalpha(c) && c != '.')
-		err("lexing failure");
+	if (!isalpha(c) && c != '.' && c != '_')
+		err("lexing failure: invalid character %c (%d)", c, c);
 	i = 0;
 	do {
 		if (i >= NString-1)
 			err("identifier too long");
 		tok[i++] = c;
 		c = fgetc(inf);
-	} while (isalpha(c) || c == '.' || c == '_' || isdigit(c));
+	} while (isalpha(c) || c == '$' || c == '.' || c == '_' || isdigit(c));
 	tok[i] = 0;
 	ungetc(c, inf);
 	if (t != TXXX) {