]> ocean-lang.org Git - ocean/blobdiff - csrc/parsergen.mdc
parsergen: add token location to tracing
[ocean] / csrc / parsergen.mdc
index df73f513ceec725931af6c78832d234a0913e45a..c167e0967cddac00f2fe937027ff3165b45f37bd 100644 (file)
@@ -1334,11 +1334,11 @@ into the go to set, so the item is ineffective.
                        continue;
                if (symset_find(&done, s->num) < 0) {
                        symset_add(&done, s->num, 0);
-                       if (s->line_like)
-                               is->starts_line = 1;
                }
                if (s->type != Nonterminal)
                        continue;
+               if (s->line_like)
+                       is->starts_line = 1;
                again = 1;
                if (type >= LALR) {
                        // Need the LA set.
@@ -3029,7 +3029,7 @@ end inside square brackets.
                        fputs(reserved_words[tk->num], trace);
                else
                        text_dump(trace, tk->txt, 20);
-               fputs("]", trace);
+               fprintf(trace, ":%d:%d]", tk->line, tk->col);
        }
 
        void parser_trace_action(FILE *trace, char *action)