diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-07-22 07:25:44 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-07-22 07:25:44 -0700 |
commit | 31741b4cf50f75993faf20555343ca0a59d0ff9f (patch) | |
tree | 2f468023a89e5823d11a59a262121395cdfa4b31 /parser.y | |
parent | 4c1341f2d2be88f36e5799aac9275c88233e1abe (diff) | |
download | txr-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 'parser.y')
-rw-r--r-- | parser.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1848,7 +1848,7 @@ int parse_once(val self, val stream, val name) #if CONFIG_DEBUG_SUPPORT unsigned dbg_state = debug_clear(opt_dbg_expansion ? 0 : DBG_ENABLE); #endif - val parser_obj = ensure_parser(stream); + val parser_obj = ensure_parser(stream, name); parser_t *parser = parser_get_impl(self, parser_obj); parser->rec_source_loc = 1; |