summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-06 08:56:50 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-06 08:56:50 -0700
commit05c23e031c7e949fd154602945d0f150cbb14c73 (patch)
tree4890bfd20044c0965bb6623306b1455284ded690
parent8b3eb12947305ad3636227b7bfe6132f39b1028f (diff)
downloadtxr-05c23e031c7e949fd154602945d0f150cbb14c73.tar.gz
txr-05c23e031c7e949fd154602945d0f150cbb14c73.tar.bz2
txr-05c23e031c7e949fd154602945d0f150cbb14c73.zip
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.
-rw-r--r--parser.l9
-rw-r--r--txr.110
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 ,