Output human-readable descriptions of some parse errors

"echo > )" provokes one of these.
This commit is contained in:
Johannes Altmanninger 2021-02-09 22:27:20 +01:00
parent 86707378cc
commit 51850e9303

View file

@ -179,6 +179,12 @@ wcstring token_type_user_presentable_description(parse_token_type_t type, parse_
return L"end of the statement"; return L"end of the statement";
case parse_token_type_t::terminate: case parse_token_type_t::terminate:
return L"end of the input"; 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: { default: {
return format_string(L"a %ls", token_type_description(type)); return format_string(L"a %ls", token_type_description(type));
} }