From 04162b05eafeacc8d73059e76c218edae05dbf44 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 20 Jan 2018 14:09:40 -0800 Subject: [PATCH] Remove the giant 'Fish grammar' comment The fish grammar is now captured more precisely in parse_grammar.h --- src/parse_tree.h | 86 ------------------------------------------------ 1 file changed, 86 deletions(-) diff --git a/src/parse_tree.h b/src/parse_tree.h index 6f48fcfb6..7c5a1028b 100644 --- a/src/parse_tree.h +++ b/src/parse_tree.h @@ -222,90 +222,4 @@ using parsed_source_ref_t = std::shared_ptr; parsed_source_ref_t parse_source(wcstring src, parse_tree_flags_t flags, parse_error_list_t *errors, parse_token_type_t goal = symbol_job_list); -// Fish grammar: -// -// # A job_list is a list of jobs, separated by semicolons or newlines -// -// job_list = | -// job job_list | -// job_list -// -// # A job is a non-empty list of statements, separated by pipes. (Non-empty is useful for cases -// like if statements, where we require a command). To represent "non-empty", we require a -// statement, followed by a possibly empty job_continuation, and then optionally a background -// specifier '&' -// -// job = statement job_continuation optional_background -// job_continuation = | -// statement job_continuation -// -// # A statement is a normal command, or an if / while / and etc -// -// statement = boolean_statement | block_statement | if_statement | switch_statement | -// decorated_statement -// -// # A block is a conditional, loop, or begin/end -// -// if_statement = if_clause else_clause end_command arguments_or_redirections_list -// if_clause = job andor_job_list job_list -// else_clause = | -// else_continuation -// else_continuation = if_clause else_clause | -// job_list -// -// switch_statement = SWITCH argument case_item_list end_command -// arguments_or_redirections_list -// case_item_list = | -// case_item case_item_list | -// case_item_list -// -// case_item = CASE argument_list job_list -// -// block_statement = block_header job_list end_command arguments_or_redirections_list -// block_header = for_header | while_header | function_header | begin_header -// for_header = FOR var_name IN argument_list -// while_header = WHILE job andor_job_list -// begin_header = BEGIN -// -// # Functions take arguments, and require at least one (the name). No redirections allowed. -// function_header = FUNCTION argument argument_list -// -// # A boolean statement is AND or OR or NOT -// boolean_statement = AND statement | OR statement | NOT statement -// -// # An andor_job_list is zero or more job lists, where each starts with an `and` or `or` boolean -// statement -// andor_job_list = | -// job andor_job_list | -// andor_job_list -// -// # A decorated_statement is a command with a list of arguments_or_redirections, possibly with -// "builtin" or "command" or "exec" -// -// decorated_statement = plain_statement | COMMAND plain_statement | BUILTIN plain_statement | -// EXEC -// -// plain_statement -// plain_statement = arguments_or_redirections_list -// -// argument_list = | argument argument_list -// -// arguments_or_redirections_list = | -// argument_or_redirection arguments_or_redirections_list -// argument_or_redirection = argument | redirection -// argument = -// -// redirection = -// -// optional_background = | -// -// end_command = END -// -// # A freestanding_argument_list is equivalent to a normal argument list, except it may contain -// TOK_END (newlines, and even semicolons, for historical reasons -// -// freestanding_argument_list = | -// argument freestanding_argument_list | -// freestanding_argument_list - #endif