mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 20:05:31 +00:00
Improved error report for literal string with %word
This commit is contained in:
parent
9768721b2b
commit
89f40ce7a6
BIN
docs/native.wasm
BIN
docs/native.wasm
Binary file not shown.
5
peglib.h
5
peglib.h
@ -2535,7 +2535,10 @@ inline size_t parse_literal(const char *s, size_t n, SemanticValues &vs,
|
|||||||
|
|
||||||
NotPredicate ope(c.wordOpe);
|
NotPredicate ope(c.wordOpe);
|
||||||
auto len = ope.parse(s + i, n - i, dummy_vs, dummy_c, dummy_dt);
|
auto len = ope.parse(s + i, n - i, dummy_vs, dummy_c, dummy_dt);
|
||||||
if (fail(len)) { return len; }
|
if (fail(len)) {
|
||||||
|
c.set_error_pos(s, lit.data());
|
||||||
|
return len;
|
||||||
|
}
|
||||||
i += len;
|
i += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user