From 05c23e031c7e949fd154602945d0f150cbb14c73 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 6 Sep 2015 08:56:50 -0700 Subject: Parse errors lose program prefix and parens. * parser.l (yyerrorf): Don't print the program prefix and parenthes, except if compatibility to 114 or older is requested. The main motivation for this is the repl, where the program prefix is not informative. The new format is also a de facto standard which is compatible with other parsers. Vim understands it directly. * txr.1: Documented. --- parser.l | 9 +++++++-- txr.1 | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/parser.l b/parser.l index 6d6fca08..087a3db4 100644 --- a/parser.l +++ b/parser.l @@ -108,8 +108,13 @@ void yyerrorf(scanner_t *scanner, val fmt, ...) if (opt_loglevel >= 1) { va_list vl; va_start (vl, fmt); - format(std_error, lit("~a: (~a:~a): "), prog_string, - parser->name, num(parser->lineno), nao); + if (opt_compat && opt_compat <= 114) + format(std_error, lit("~a: (~a:~a): "), prog_string, + parser->name, num(parser->lineno), nao); + else + format(std_error, lit("~a:~a: "), + parser->name, num(parser->lineno), nao); + vformat(std_error, fmt, vl); put_char(chr('\n'), std_error); va_end (vl); diff --git a/txr.1 b/txr.1 index b4d0754d..1ebee7c4 100644 --- a/txr.1 +++ b/txr.1 @@ -33265,6 +33265,16 @@ is given an argument which is equal or lower. For instance .code -C 103 selects the behaviors described below for version 105, but not those for 102. +.IP 114 +\*(TX until version 114 reported parse errors in this format: + +.cblk + ./txr: (file.txr:123): syntax error +.cble + +The new format omits the program name prefix and parentheses. + + .IP 113 Version 113 is the last version in which the .codn stat , -- cgit v1.2.3