From: NeilBrown Date: Fri, 28 Jun 2019 09:40:11 +0000 (+1000) Subject: parsergen: add token location to tracing X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=23eff3db9345ded5920fba114c0b411466c7cbf9 parsergen: add token location to tracing When we print the look-ahead token for tracing, add the line/column location so it can be easily cross-references to the source code. Signed-off-by: NeilBrown --- diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index fdbe0ea..c167e09 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -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)