summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-07-22 07:25:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-07-22 07:25:44 -0700
commit31741b4cf50f75993faf20555343ca0a59d0ff9f (patch)
tree2f468023a89e5823d11a59a262121395cdfa4b31 /match.c
parent4c1341f2d2be88f36e5799aac9275c88233e1abe (diff)
downloadtxr-31741b4cf50f75993faf20555343ca0a59d0ff9f.tar.gz
txr-31741b4cf50f75993faf20555343ca0a59d0ff9f.tar.bz2
txr-31741b4cf50f75993faf20555343ca0a59d0ff9f.zip
txr: regression: lack of file name in error messages.
This was broken on April 21, 2019 in commit 2e36e0feae8d1dd75c8410b365d7dc33b30ce66b (April 21, 2019) which changed parse_once in such a way that the name being passed down was no longer stored in the parser. The ensure_parser function being relied upon doesn't take on the responsibility of propagating the name from the stream to the parser, so the parser ends up with a nil name. Let's just smooth this over by having ensure_parser take a name parameter. If ensure_parser creates a new parser, it puts in the name. If the name is nil, then it is taken from the stream. * eval.c (load): Pass name to ensure_parser. * match.c (v_load): Likewise. * parser.c (parser): Take name parameter, and plant into newly constructed parser. (ensure_parser): Take name parameter. When creating a parser, give it that name, or if name is specified as nil, then give it the name taken from the stream. (parser_set_lineno): Pass nil name to ensure_parser. (lisp_parse_impl, read_file_common): Pass name to ensure_parser. * parser.h (parser, ensure_parser): Declarations updated. * parser.y (parse_once): Pass name to ensure_parser. * txr.c (txr_main): Pass spec_file_str to ensure_parser.
Diffstat (limited to 'match.c')
-rw-r--r--match.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/match.c b/match.c
index 1e0e00e7..a543634f 100644
--- a/match.c
+++ b/match.c
@@ -4331,7 +4331,7 @@ static val v_load(match_files_ctx *c)
if (!txr_lisp_p) {
int gc = gc_state(0);
- val parser_obj = ensure_parser(stream);
+ val parser_obj = ensure_parser(stream, name);
parser_t *parser = parser_get_impl(self, parser_obj);
parse_once(self, stream, name);