qbe

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

commit a968dc687d8a4fa3303a750d3ef1eea9369b2fdd
parent 2ea517ed26e3f1adf84268648cd028efd6825e52
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Wed, 18 Nov 2015 08:56:02 -0500

support _ in identifiers

Diffstat:
Mlisc/parse.c | 2+-
Mminic/minic.y | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisc/parse.c b/lisc/parse.c @@ -225,7 +225,7 @@ Alpha: c = fgetc(inf); err("identifier too long"); tok[i++] = c; c = fgetc(inf); - } while (isalpha(c) || c == '.' || isdigit(c)); + } while (isalpha(c) || c == '.' || c == '_' || isdigit(c)); tok[i] = 0; ungetc(c, inf); if (t != TXXX) { diff --git a/minic/minic.y b/minic/minic.y @@ -6,7 +6,7 @@ #include <string.h> enum { - NString = 16, + NString = 32, NGlo = 256, NVar = 512, NStr = 256, @@ -874,7 +874,7 @@ yylex() die("ident too long"); *p++ = c; c = getchar(); - } while (isalpha(c)); + } while (isalpha(c) || c == '_'); *p = 0; ungetc(c, stdin); for (i=0; kwds[i].s; i++)