diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-04-09 18:56:13 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-04-10 18:40:11 -0700 |
commit | 59f0261dba993a5d632ce6e9963270a582d162e6 (patch) | |
tree | ebc0be44c6259fc090c2612703f7e66366cc0ef3 /src/parse_constants.h | |
parent | 7ad6a90ea2e75388d42b5b223d9273119994037e (diff) |
enhance fish_indent to normalize keywords
Fish keywords can be quoted and split across lines. Prior to this change
`fish_indent` would retain such odd, obfuscated, formatting. This change
results in all keywords being converted to their canonical form.
This required fixing a bug: the keyword member of parse_node_t wasn't being
populated. This hadn't been noticed prior to now because it wasn't used.
Fixes #2921
Diffstat (limited to 'src/parse_constants.h')
-rw-r--r-- | src/parse_constants.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parse_constants.h b/src/parse_constants.h index 03dffd28..4668516b 100644 --- a/src/parse_constants.h +++ b/src/parse_constants.h @@ -73,6 +73,7 @@ enum parse_token_type_t parse_special_type_parse_error, parse_special_type_tokenizer_error, parse_special_type_comment, + LAST_TOKEN_TYPE = parse_special_type_comment, FIRST_TERMINAL_TYPE = parse_token_type_string, LAST_TERMINAL_TYPE = parse_token_type_terminate, @@ -85,7 +86,11 @@ enum parse_token_type_t // Array of strings corresponding to the enums above instantiated in parse_tree.cpp. extern const wchar_t * const 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. */ +// These must be maintained in sorted order (except for none, which isn't a keyword). This enables +// us to do binary search. +// +// IMPORTANT: If the following enum is modified you must update the corresponding keyword_map array +// in parse_tree.cpp. enum parse_keyword_t { parse_keyword_none, |