Fix up invalid_syntax error signalling

* src/lread.c (invalid_syntax_lisp): Instead of putting the
line/column in a string, signal an error containing the numbers as
data.  This allows for easier post-processing and is how other
similar errors (like (forward-sexp 1)) do it.
This commit is contained in:
Lars Ingebrigtsen 2021-02-02 09:26:02 +01:00
parent 83efac6477
commit 56804edc83

View file

@ -545,14 +545,13 @@ invalid_syntax_lisp (Lisp_Object s, Lisp_Object readcharfun)
{
if (BUFFERP (readcharfun))
{
xsignal1 (Qinvalid_read_syntax,
CALLN (Fformat, build_string ("%s (line %d, column %d)"),
s,
/* We should already be in the readcharfun
buffer when this error is called, so no need
to switch to it first. */
make_fixnum (count_lines (BEGV_BYTE, PT_BYTE) + 1),
make_fixnum (current_column ())));
xsignal (Qinvalid_read_syntax,
list3 (s,
/* We should already be in the readcharfun
buffer when this error is called, so no need
to switch to it first. */
make_fixnum (count_lines (BEGV_BYTE, PT_BYTE) + 1),
make_fixnum (current_column ())));
}
else
xsignal1 (Qinvalid_read_syntax, s);