mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-22 02:35:14 +08:00
Simplify begin_header production
The TOK_END is swallowed by the subsequent job_list anyway.
This commit is contained in:
parent
9e8e5af064
commit
cb1e3c501d
@ -891,7 +891,9 @@ static void test_indents()
|
|||||||
|
|
||||||
const indent_component_t components7[] =
|
const indent_component_t components7[] =
|
||||||
{
|
{
|
||||||
{L"begin; end", 0},
|
{L"begin", 0},
|
||||||
|
{L";", 1},
|
||||||
|
{L"end", 0},
|
||||||
{L"foo", 0},
|
{L"foo", 0},
|
||||||
{L"", 0},
|
{L"", 0},
|
||||||
{NULL, -1}
|
{NULL, -1}
|
||||||
|
@ -341,18 +341,9 @@ RESOLVE_ONLY(while_header)
|
|||||||
|
|
||||||
PRODUCTIONS(begin_header) =
|
PRODUCTIONS(begin_header) =
|
||||||
{
|
{
|
||||||
{KEYWORD(parse_keyword_begin), parse_token_type_end},
|
|
||||||
{KEYWORD(parse_keyword_begin)}
|
{KEYWORD(parse_keyword_begin)}
|
||||||
};
|
};
|
||||||
RESOLVE(begin_header)
|
RESOLVE_ONLY(begin_header)
|
||||||
{
|
|
||||||
switch (token2.type) {
|
|
||||||
case parse_token_type_end:
|
|
||||||
return 0;
|
|
||||||
default:
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PRODUCTIONS(function_header) =
|
PRODUCTIONS(function_header) =
|
||||||
{
|
{
|
||||||
|
@ -253,7 +253,7 @@ bool parse_tree_from_string(const wcstring &str, parse_tree_flags_t flags, parse
|
|||||||
block_header = for_header | while_header | function_header | begin_header
|
block_header = for_header | while_header | function_header | begin_header
|
||||||
for_header = FOR var_name IN argument_list <TOK_END>
|
for_header = FOR var_name IN argument_list <TOK_END>
|
||||||
while_header = WHILE job <TOK_END>
|
while_header = WHILE job <TOK_END>
|
||||||
begin_header = BEGIN | BEGIN <TOK_END>
|
begin_header = BEGIN
|
||||||
|
|
||||||
# Functions take arguments, and require at least one (the name). No redirections allowed.
|
# Functions take arguments, and require at least one (the name). No redirections allowed.
|
||||||
function_header = FUNCTION argument argument_list <TOK_END>
|
function_header = FUNCTION argument argument_list <TOK_END>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user