summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
65b1733)
* src/syntax.c: Add `Qscan_error'.
* src/syntax.c (syms_of_syntax): DEFERROR_STANDARD it.
* src/syntax.c (scan_lists): Use it.
* lisp/subr.el (error): Add it to the docstring.
Signed-off-by: Steve Youngs <steve@sxemacs.org>
syntax-error
invalid-read-syntax
invalid-regexp
syntax-error
invalid-read-syntax
invalid-regexp
structure-formation-error
list-formation-error
malformed-list
structure-formation-error
list-formation-error
malformed-list
Lisp_Object Vsyntax_designator_chars_string;
Lisp_Object Vsyntax_designator_chars_string;
+Lisp_Object Qscan_error;
+
/* This is the internal form of the parse state used in parse-partial-sexp. */
struct lisp_parse_state {
/* This is the internal form of the parse state used in parse-partial-sexp. */
struct lisp_parse_state {
enum syntaxcode code;
int syncode;
int min_depth = depth; /* Err out if depth gets less than this. */
enum syntaxcode code;
int syncode;
int min_depth = depth; /* Err out if depth gets less than this. */
+ Bufpos last_good = from;
if (depth > 0)
min_depth = 0;
if (depth > 0)
min_depth = 0;
c = BUF_FETCH_CHAR(buf, from);
syncode = SYNTAX_CODE_FROM_CACHE(mirrortab, c);
code = SYNTAX_FROM_CODE(syncode);
c = BUF_FETCH_CHAR(buf, from);
syncode = SYNTAX_CODE_FROM_CACHE(mirrortab, c);
code = SYNTAX_FROM_CODE(syncode);
+ if (depth == min_depth)
+ last_good = from;
from++;
/* a 1-char comment start sequence */
from++;
/* a 1-char comment start sequence */
if (depth < min_depth) {
if (noerror)
return Qnil;
if (depth < min_depth) {
if (noerror)
return Qnil;
- error("Containing expression "
- "ends prematurely");
+ signal_type_error_2(Qscan_error,
+ "Containing expression "
+ "ends prematurely",
+ make_int(last_good),
+ make_int(from));
if (noerror) {
return Qnil;
}
if (noerror) {
return Qnil;
}
- error("Containing expression "
- "ends prematurely");
+ signal_type_error_2(Qscan_error,
+ "Containing expression "
+ "ends premeturely",
+ make_int(last_good),
+ make_int(from));
- error("Unbalanced parentheses");
+ signal_type_error_2(Qscan_error, "Unbalanced parentheses",
+ make_int(last_good), make_int(from));
DEFSUBR(Fscan_sexps);
DEFSUBR(Fbackward_prefix_chars);
DEFSUBR(Fparse_partial_sexp);
DEFSUBR(Fscan_sexps);
DEFSUBR(Fbackward_prefix_chars);
DEFSUBR(Fparse_partial_sexp);
+
+ DEFERROR_STANDARD(Qscan_error, Qsyntax_error);
}
void vars_of_syntax(void)
}
void vars_of_syntax(void)