Skip to content

Commit 51c4c9e

Browse files
authored
Merge pull request #251 from tree-sitter/fix-missing-alias
fix: add alias for nested_identifiers from javascript grammar
2 parents a232b3a + 11583b2 commit 51c4c9e

File tree

6 files changed

+116245
-115598
lines changed

6 files changed

+116245
-115598
lines changed

common/define-grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ module.exports = function defineGrammar(dialect) {
237237
seq(
238238
field('name', choice(
239239
$.identifier,
240-
$.nested_identifier
240+
alias($.nested_identifier, $.member_expression),
241241
)),
242242
field('type_arguments', optional($.type_arguments))
243243
)

tsx/src/grammar.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7230,8 +7230,13 @@
72307230
"name": "identifier"
72317231
},
72327232
{
7233-
"type": "SYMBOL",
7234-
"name": "nested_identifier"
7233+
"type": "ALIAS",
7234+
"content": {
7235+
"type": "SYMBOL",
7236+
"name": "nested_identifier"
7237+
},
7238+
"named": true,
7239+
"value": "member_expression"
72357240
}
72367241
]
72377242
}

tsx/src/node-types.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,7 +3412,7 @@
34123412
"named": true
34133413
},
34143414
{
3415-
"type": "nested_identifier",
3415+
"type": "member_expression",
34163416
"named": true
34173417
}
34183418
]
@@ -3460,7 +3460,7 @@
34603460
"named": true
34613461
},
34623462
{
3463-
"type": "nested_identifier",
3463+
"type": "member_expression",
34643464
"named": true
34653465
}
34663466
]

0 commit comments

Comments
 (0)