summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/parser.c b/parser.c
index 577c338..d7f750a 100644
--- a/parser.c
+++ b/parser.c
@@ -264,7 +264,7 @@ parseoperators(Term *list)
for(i = 0, t = list; i < length; i++){
Operator *op = getoperator(t->text);
- if(op && t->tag == AtomTok){
+ if(op && t->tag == AtomTerm){
infos[i].type = op->type;
infos[i].level = op->level;
}else{
@@ -292,7 +292,10 @@ parseoperators(Term *list)
}
if(index == -1){
- print("Can't parse, list contains no operators");
+ print("Can't parse, list of length %d contains no operators: ", length);
+ for(i = 0; i < length; i++)
+ print("%S(%d) ", prettyprint(terms[i]), infos[i].level);
+ print("\n");
syntaxerror("parseoperators");
}
@@ -439,6 +442,7 @@ nexttoken(void)
replaypeek = -1;
}
+SkipWhite:
/* Skip whitespace */
while(isspacerune(peek))
peek = Bgetrune(parsein);
@@ -447,7 +451,7 @@ nexttoken(void)
if(peek == L'%'){
while(peek != L'\n')
peek = Bgetrune(parsein);
- peek = Bgetrune(parsein);
+ goto SkipWhite;
}
/* Variables */