mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-19 04:41:15 -03:00
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
This commit is contained in:
@@ -1078,9 +1078,11 @@ bool parse_ll_t::top_node_handle_terminal_types(parse_token_t token)
|
||||
|
||||
if (matched)
|
||||
{
|
||||
// Success. Tell the node that it matched this token, and what its source range is
|
||||
// In the parse phase, we only set source ranges for terminal types. We propagate ranges to parent nodes afterwards.
|
||||
// Success. Tell the node that it matched this token, and what its source range is in
|
||||
// the parse phase, we only set source ranges for terminal types. We propagate ranges to
|
||||
// parent nodes afterwards.
|
||||
parse_node_t &node = node_for_top_symbol();
|
||||
node.keyword = token.keyword;
|
||||
node.source_start = token.source_start;
|
||||
node.source_length = token.source_length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user