diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-12-08 14:13:23 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-12-08 14:13:23 -0800 |
commit | 67b1f14a6f6d095af9141640c6d26771a5236693 (patch) | |
tree | 061f9cbd7dbd15ba952be2830f40f8dfd480a277 /builtin.cpp | |
parent | dd0cc5ed9fa60f4bae5530d1708a2974eb0c454f (diff) |
Better support for parse errors in indenting
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/builtin.cpp b/builtin.cpp index 59f3cf71..3172dbdc 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -3985,12 +3985,14 @@ int builtin_parse(parser_t &parser, wchar_t **argv) stdout_buffer.append(errors.at(i).describe(src)); stdout_buffer.push_back(L'\n'); } - } - else - { - const wcstring dump = parse_dump_tree(parse_tree, src); - fprintf(stderr, "%ls", dump.c_str()); - } + + stdout_buffer.append(L"(Reparsed with continue after error)\n"); + parse_tree.clear(); + errors.clear(); + parse_t::parse(src, parse_flag_continue_after_error, &parse_tree, &errors, true); + } + const wcstring dump = parse_dump_tree(parse_tree, src); + fprintf(stderr, "%ls", dump.c_str()); } return STATUS_BUILTIN_OK; } |