mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-21 23:11:17 -03:00
Allow variables in commands
Syntax highlighting for these coming in next commit. Fixes #154
This commit is contained in:
@@ -1127,14 +1127,12 @@ static bool detect_errors_in_plain_statement(const wcstring &buff_src,
|
||||
}
|
||||
}
|
||||
|
||||
if (maybe_t<wcstring> mcommand = command_for_plain_statement(pst, buff_src)) {
|
||||
wcstring command = std::move(*mcommand);
|
||||
if (maybe_t<wcstring> unexp_command = command_for_plain_statement(pst, buff_src)) {
|
||||
wcstring command;
|
||||
// Check that we can expand the command.
|
||||
if (!expand_one(command, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_VARIABLES | EXPAND_SKIP_JOBS,
|
||||
NULL)) {
|
||||
// TODO: leverage the resulting errors.
|
||||
errored = append_syntax_error(parse_errors, source_start, ILLEGAL_CMD_ERR_MSG,
|
||||
command.c_str());
|
||||
if (expand_to_command_and_args(*unexp_command, &command, nullptr, parse_errors) ==
|
||||
EXPAND_ERROR) {
|
||||
errored = true;
|
||||
}
|
||||
|
||||
// Check that pipes are sound.
|
||||
|
||||
Reference in New Issue
Block a user