aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_tree.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-02-13 10:08:04 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-02-13 10:10:49 -0800
commit1fbf63381782b0badead61d1576ad6a1e29fc3ea (patch)
tree778b1397a565f6cc214ae62ed6c15921d77d63b7 /parse_tree.cpp
parentf733dc5eae81c092f74522f4e5cc7b3d27f2b943 (diff)
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
Diffstat (limited to 'parse_tree.cpp')
-rw-r--r--parse_tree.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse_tree.cpp b/parse_tree.cpp
index 0db2a06d..41ef9cf0 100644
--- a/parse_tree.cpp
+++ b/parse_tree.cpp
@@ -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++)