Reimplement exec parsing. Instead of special-casing exec as a command,

promote it to a decoration (like 'command' or 'builtin'). This makes tab
completion and syntax highlighting treat exec's first argument as a
command and is otherwise a nice simplification. Fixes #1300
This commit is contained in:
ridiculousfish
2014-02-13 10:08:04 -08:00
parent f733dc5eae
commit 1fbf633817
9 changed files with 36 additions and 15 deletions

View File

@@ -237,6 +237,8 @@ wcstring keyword_description(parse_keyword_t k)
return L"command";
case parse_keyword_builtin:
return L"builtin";
case parse_keyword_exec:
return L"exec";
}
return format_string(L"Unknown keyword type %ld", static_cast<long>(k));
}
@@ -1049,7 +1051,8 @@ static parse_keyword_t keyword_for_token(token_type tok, const wchar_t *tok_txt)
{L"or", parse_keyword_or},
{L"not", parse_keyword_not},
{L"command", parse_keyword_command},
{L"builtin", parse_keyword_builtin}
{L"builtin", parse_keyword_builtin},
{L"exec", parse_keyword_exec}
};
for (size_t i=0; i < sizeof keywords / sizeof *keywords; i++)