aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parse_constants.h
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-04-05 15:43:24 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-04-05 19:29:23 -0700
commit4ff8e6e7818747d805ac44be0a36aedef4deaa5c (patch)
treeb3ce6c2af09f052278201d6b0209b69a16ac8787 /src/parse_constants.h
parent8e8b5a648197ca83af50064bc9492ca855e9d705 (diff)
change how redirections are formatted
Modify `fish_indent` to emit redirections without a space before the target of the redirection; e.g., "2>&1" rather than "2>& 1" as the former is clearer to humans. Fixes #2899
Diffstat (limited to 'src/parse_constants.h')
-rw-r--r--src/parse_constants.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parse_constants.h b/src/parse_constants.h
index e7c6399f..afc88c6c 100644
--- a/src/parse_constants.h
+++ b/src/parse_constants.h
@@ -11,6 +11,8 @@
#define PARSE_ASSERT(a) assert(a)
#define PARSER_DIE() do { fprintf(stderr, "Parser dying!\n"); exit_without_destructors(-1); } while (0)
+// IMPORTANT: If the following enum is modified you must update the corresponding parser_token_types
+// array in parse_tree.cpp.
enum parse_token_type_t
{
token_type_invalid,
@@ -41,7 +43,7 @@ enum parse_token_type_t
symbol_plain_statement,
symbol_arguments_or_redirections_list,
symbol_argument_or_redirection,
-
+
symbol_andor_job_list,
symbol_argument_list,
@@ -80,6 +82,8 @@ enum parse_token_type_t
FIRST_PARSE_TOKEN_TYPE = parse_token_type_string,
LAST_PARSE_TOKEN_TYPE = parse_token_type_end
} __packed;
+// Array of strings corresponding to the enums above instantiated in parse_tree.cpp.
+extern wcstring parser_token_types[];
/* These must be maintained in sorted order (except for none, which isn't a keyword). This enables us to do binary search. */
enum parse_keyword_t