Skip to content

Commit 444c127

Browse files
authored
handle module paths in member_expression (#248)
1 parent d77653c commit 444c127

File tree

5 files changed

+87836
-87069
lines changed

5 files changed

+87836
-87069
lines changed

grammar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ module.exports = grammar({
10821082
field('record', $.primary_expression),
10831083
'.',
10841084
optional(seq(
1085-
field('module', $.module_identifier),
1085+
field('module', seq(repeat(seq($.module_identifier, '.')), $.module_identifier)),
10861086
'.'
10871087
)),
10881088
field('property', alias($.value_identifier, $.property_identifier)),

src/grammar.json

+23-2
Original file line numberDiff line numberDiff line change
@@ -5458,8 +5458,29 @@
54585458
"type": "FIELD",
54595459
"name": "module",
54605460
"content": {
5461-
"type": "SYMBOL",
5462-
"name": "module_identifier"
5461+
"type": "SEQ",
5462+
"members": [
5463+
{
5464+
"type": "REPEAT",
5465+
"content": {
5466+
"type": "SEQ",
5467+
"members": [
5468+
{
5469+
"type": "SYMBOL",
5470+
"name": "module_identifier"
5471+
},
5472+
{
5473+
"type": "STRING",
5474+
"value": "."
5475+
}
5476+
]
5477+
}
5478+
},
5479+
{
5480+
"type": "SYMBOL",
5481+
"name": "module_identifier"
5482+
}
5483+
]
54635484
}
54645485
},
54655486
{

src/node-types.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -2356,9 +2356,13 @@
23562356
"named": true,
23572357
"fields": {
23582358
"module": {
2359-
"multiple": false,
2359+
"multiple": true,
23602360
"required": false,
23612361
"types": [
2362+
{
2363+
"type": ".",
2364+
"named": false
2365+
},
23622366
{
23632367
"type": "module_identifier",
23642368
"named": true

0 commit comments

Comments
 (0)