summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-28 23:39:43 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-28 23:39:43 -0800
commit032c3eafdddac6d8d74836b817860ff51e683330 (patch)
tree1a89f2a52e1c11750c4db22a72ca1e259c4431c4 /lisc
parentb65a6892ddf9256e963df1f0818f22ca09f6b75b (diff)
downloadroux-032c3eafdddac6d8d74836b817860ff51e683330.tar.gz
Make err nonstatic.
Diffstat (limited to 'lisc')
-rw-r--r--lisc/lisc.h1
-rw-r--r--lisc/parse.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/lisc/lisc.h b/lisc/lisc.h
index 8a65887..edac623 100644
--- a/lisc/lisc.h
+++ b/lisc/lisc.h
@@ -491,6 +491,7 @@ extern OpDesc opdesc[NOp];
 void parse(FILE *, char *, void (Dat *), void (Fn *));
 void printfn(Fn *, FILE *);
 void printref(Ref, Fn *, FILE *);
+void err(char *, ...);
 
 /* mem.c */
 void memopt(Fn *);
diff --git a/lisc/parse.c b/lisc/parse.c
index be93ca3..8143ef6 100644
--- a/lisc/parse.c
+++ b/lisc/parse.c
@@ -136,7 +136,7 @@ static int ntyp;
 
 
 
-static void
+void
 err(char *s, ...)
 {
 	char buf[100], *p, *end;
@@ -266,8 +266,8 @@ Alpha:		c = fgetc(inf);
 	} while (isalpha(c) || c == '$' || c == '.' || c == '_' || isdigit(c));
 	tok[i] = 0;
 	ungetc(c, inf);
+	tokval.str = tok;
 	if (t != TXXX) {
-		tokval.str = tok;
 		return t;
 	}
 	for (i=0; i<NPubOp; i++)
@@ -277,7 +277,7 @@ Alpha:		c = fgetc(inf);
 	for (i=0; tmap[i].str; i++)
 		if (strcmp(tok, tmap[i].str) == 0)
 			return tmap[i].tok;
-	err("unknown keyword");
+	err("unknown keyword %s", tokval.str);
 	return TXXX;
 }