Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
handle module paths in member_expression
  • Loading branch information
CarlOlson committed Jun 14, 2024
commit 3fd539de86fc3b34714f3d4571e8ec38e05bcf3c
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ module.exports = grammar({
field('record', $.primary_expression),
'.',
optional(seq(
field('module', $.module_identifier),
field('module', seq(repeat(seq($.module_identifier, '.')), $.module_identifier)),
'.'
)),
field('property', alias($.value_identifier, $.property_identifier)),
Expand Down
25 changes: 23 additions & 2 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -5458,8 +5458,29 @@
"type": "FIELD",
"name": "module",
"content": {
"type": "SYMBOL",
"name": "module_identifier"
"type": "SEQ",
"members": [
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "module_identifier"
},
{
"type": "STRING",
"value": "."
}
]
}
},
{
"type": "SYMBOL",
"name": "module_identifier"
}
]
}
},
{
Expand Down
6 changes: 5 additions & 1 deletion src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -2356,9 +2356,13 @@
"named": true,
"fields": {
"module": {
"multiple": false,
"multiple": true,
"required": false,
"types": [
{
"type": ".",
"named": false
},
{
"type": "module_identifier",
"named": true
Expand Down
Loading