qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit ec7c4e0d60e22c10b6f7817436bd3f4abf2d5356
parent 7f738bb025195cfb91403588480877c12e72a6d6
Author: Ori Bernstein <ori@eigenstate.org>
Date:   Sun, 28 Feb 2016 19:40:06 -0800

Make parser slightly more accepting.

	'_' is ok to start a symbol, and '$' is an acceptable character
	within a symbol.

Diffstat:
Mlisc/parse.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 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) {