mirror of
https://github.com/github/codeql.git
synced 2026-05-14 11:19:27 +02:00
unified: drop element field on _parenthesized_type
Same pattern we've seen many times before: a field on an anonymous node gets attached to the parent node instead. I'm not 100% sure this is the right solution, but it seemed wrong to just make `_parenthesized_type` named instead (we don't usually name parentheticals). At the very least, this cleans up the spurious navigation_expression.element and tuple_type_item.element fields.
This commit is contained in:
@@ -567,10 +567,7 @@ module.exports = grammar({
|
||||
_parenthesized_type: ($) =>
|
||||
seq(
|
||||
"(",
|
||||
field(
|
||||
"element",
|
||||
choice($.opaque_type, $.existential_type, $.dictionary_type)
|
||||
),
|
||||
choice($.opaque_type, $.existential_type, $.dictionary_type),
|
||||
")"
|
||||
),
|
||||
navigation_expression: ($) =>
|
||||
|
||||
@@ -314,7 +314,6 @@ named:
|
||||
rhs: expression
|
||||
mutation_modifier:
|
||||
navigation_expression:
|
||||
element?: [dictionary_type, existential_type, opaque_type]
|
||||
suffix: navigation_suffix
|
||||
target+: ["(", ")", array_type, dictionary_type, existential_type, expression, opaque_type, user_type]
|
||||
navigation_suffix:
|
||||
@@ -459,8 +458,7 @@ named:
|
||||
$children?: tuple_type_item
|
||||
element*: tuple_type_item
|
||||
tuple_type_item:
|
||||
$children*: [parameter_modifiers, wildcard_pattern]
|
||||
element?: [dictionary_type, existential_type, opaque_type]
|
||||
$children*: [dictionary_type, existential_type, opaque_type, parameter_modifiers, wildcard_pattern]
|
||||
name?: simple_identifier
|
||||
type?: type
|
||||
type:
|
||||
|
||||
Reference in New Issue
Block a user