Skip to content

Commit

Permalink
handle module paths in member_expression (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlOlson authored Jul 25, 2024
1 parent d77653c commit 444c127
Show file tree
Hide file tree
Showing 5 changed files with 87,836 additions and 87,069 deletions.
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

0 comments on commit 444c127

Please sign in to comment.