Correctly report the range of tokenizer errors

This enables proper syntax highlighting of tokenizer errors.
This commit is contained in:
ridiculousfish
2019-10-27 15:44:08 -07:00
parent 0bfd897ee0
commit afd20b8e1a
4 changed files with 19 additions and 13 deletions

View File

@@ -4623,6 +4623,11 @@ static void test_highlighting() {
{L"true", highlight_role_t::command},
});
highlight_tests.push_back({
{L"false", highlight_role_t::command},
{L"|&", highlight_role_t::error},
});
auto &vars = parser_t::principal_parser().vars();
// Verify variables and wildcards in commands using /bin/cat.
vars.set(L"VARIABLE_IN_COMMAND", ENV_LOCAL, {L"a"});