From 51850e9303c61da1adbe5c9bf8fa562428b0b440 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 9 Feb 2021 22:27:20 +0100 Subject: [PATCH] Output human-readable descriptions of some parse errors "echo > )" provokes one of these. --- src/parse_tree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/parse_tree.cpp b/src/parse_tree.cpp index 3dc16ff26..7a445668a 100644 --- a/src/parse_tree.cpp +++ b/src/parse_tree.cpp @@ -179,6 +179,12 @@ wcstring token_type_user_presentable_description(parse_token_type_t type, parse_ return L"end of the statement"; case parse_token_type_t::terminate: return L"end of the input"; + case parse_token_type_t::error: + return L"a parse error"; + case parse_token_type_t::tokenizer_error: + return L"an incomplete token"; + case parse_token_type_t::comment: + return L"a comment"; default: { return format_string(L"a %ls", token_type_description(type)); }