Fix syntax error position problem

This commit is contained in:
yhirose 2021-01-16 14:38:06 -05:00
parent 6171d3bf6e
commit 0f4feff175
3 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -2872,12 +2872,12 @@ class ParserGenerator {
public: public:
static std::shared_ptr<Grammar> parse(const char *s, size_t n, static std::shared_ptr<Grammar> parse(const char *s, size_t n,
const Rules &rules, std::string &start, const Rules &rules, std::string &start,
const Log &log) { Log log) {
return get_instance().perform_core(s, n, rules, start, log); return get_instance().perform_core(s, n, rules, start, log);
} }
static std::shared_ptr<Grammar> parse(const char *s, size_t n, static std::shared_ptr<Grammar> parse(const char *s, size_t n,
std::string &start, const Log &log) { std::string &start, Log log) {
Rules dummy; Rules dummy;
return parse(s, n, dummy, start, log); return parse(s, n, dummy, start, log);
} }
@ -3381,7 +3381,7 @@ private:
bool apply_precedence_instruction(Definition &rule, bool apply_precedence_instruction(Definition &rule,
const PrecedenceClimbing::BinOpeInfo &info, const PrecedenceClimbing::BinOpeInfo &info,
const char *s, const Log &log) { const char *s, Log log) {
try { try {
auto &seq = dynamic_cast<Sequence &>(*rule.get_core_operator()); auto &seq = dynamic_cast<Sequence &>(*rule.get_core_operator());
auto atom = seq.opes_[0]; auto atom = seq.opes_[0];
@ -3420,7 +3420,7 @@ private:
std::shared_ptr<Grammar> perform_core(const char *s, size_t n, std::shared_ptr<Grammar> perform_core(const char *s, size_t n,
const Rules &rules, std::string &start, const Rules &rules, std::string &start,
const Log &log) { Log log) {
Data data; Data data;
auto &grammar = *data.grammar; auto &grammar = *data.grammar;
@ -3439,7 +3439,7 @@ private:
} }
std::any dt = &data; std::any dt = &data;
auto r = g["Grammar"].parse(s, n, dt); auto r = g["Grammar"].parse(s, n, dt, nullptr, log);
if (!r.ret) { if (!r.ret) {
if (log) { if (log) {