unified: Remove some pointless fields

All of these fields have contents that are uniquely determined by the
node they appear on, so they convey no information.
This commit is contained in:
Taus
2026-05-13 14:22:06 +00:00
parent caef72b047
commit f4f85b58ca
2 changed files with 5 additions and 9 deletions

View File

@@ -1050,7 +1050,7 @@ module.exports = grammar({
"if",
sep1(field("condition", $.if_condition), ","),
field("body", $.block),
optional(seq(field("else_keyword", $["else"]), $._else_options))
optional(seq(alias($["else"], "else"), $._else_options))
)
),
if_condition: ($) =>
@@ -1067,7 +1067,7 @@ module.exports = grammar({
seq(
"guard",
sep1(field("condition", $.if_condition), ","),
field("else_keyword", $["else"]),
alias($["else"], "else"),
field("body", $.block)
)
),
@@ -1712,7 +1712,7 @@ module.exports = grammar({
prec.right(
seq(
field("modifiers", optional($.modifiers)),
field("declaration_kind", "protocol"),
"protocol",
field("name", alias($.simple_identifier, $.type_identifier)),
field("type_parameters", optional($.type_parameters)),
optional(seq(":", $._inheritance_specifiers)),
@@ -1744,7 +1744,7 @@ module.exports = grammar({
seq(
field("modifiers", optional($.modifiers)),
optional("class"),
field("name", "init"),
"init",
optional(choice($._quest, field("bang", $.bang))),
field("type_parameters", optional($.type_parameters)),
$._function_value_parameters,

View File

@@ -270,7 +270,6 @@ named:
do_statement:
body: block
catch*: catch_block
else:
enum_case_entry:
data_contents?: enum_type_parameters
name: simple_identifier
@@ -333,7 +332,6 @@ named:
guard_statement:
body: block
condition+: if_condition
else_keyword: else
hex_literal:
identifier:
part+: simple_identifier
@@ -348,7 +346,6 @@ named:
body: block
condition+: if_condition
else_branch?: [block, if_statement]
else_keyword?: else
implicitly_unwrapped_type:
name: type
import_declaration:
@@ -370,7 +367,6 @@ named:
bang?: bang
body?: block
modifiers?: modifiers
name: "init"
parameter*: function_parameter
throws?: [throws, throws_clause]
type_constraints?: type_constraints
@@ -526,7 +522,6 @@ named:
protocol_declaration:
attribute*: attribute
body: protocol_body
declaration_kind: "protocol"
inherits*: inheritance_specifier
modifiers?: modifiers
name: type_identifier
@@ -794,6 +789,7 @@ unnamed:
- "dsohandle"
- "dynamic"
- "each"
- "else"
- "enum"
- "extension"
- "externalMacro"