Skip to content

Commit

Permalink
add field for the name of a moduleInstantiation
Browse files Browse the repository at this point in the history
Co-authored-by: Erik Krogh Kristensen <[email protected]>
  • Loading branch information
tausbn and erik-krogh authored Jul 14, 2022
1 parent 980233c commit fd62fd9
Show file tree
Hide file tree
Showing 6 changed files with 36,220 additions and 35,381 deletions.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = grammar({
conflicts: $ => [
[$.simpleId, $.className],
[$.simpleId, $.literalId],
[$.moduleName, $.varName],
[$.simpleId, $.moduleInstantiation],
[$.className, $.moduleInstantiation],
],
Expand Down Expand Up @@ -407,7 +408,7 @@ module.exports = grammar({
),

moduleInstantiation: $ => seq(
$._upper_id,
field("name", $.moduleName),
"<",
sep1($.signatureExpr, ","),
">"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Sam Lanning <[email protected]>",
"license": "MIT",
"devDependencies": {
"tree-sitter-cli": "^0.19.5"
"tree-sitter-cli": "^0.20.6"
},
"scripts": {
"tree-sitter": "tree-sitter",
Expand Down Expand Up @@ -42,4 +42,4 @@
"example": "examples",
"test": "test"
}
}
}
12 changes: 10 additions & 2 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2962,8 +2962,12 @@
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_upper_id"
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "moduleName"
}
},
{
"type": "STRING",
Expand Down Expand Up @@ -3310,6 +3314,10 @@
"simpleId",
"literalId"
],
[
"moduleName",
"varName"
],
[
"simpleId",
"moduleInstantiation"
Expand Down
13 changes: 12 additions & 1 deletion src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -3296,7 +3296,18 @@
{
"type": "moduleInstantiation",
"named": true,
"fields": {},
"fields": {
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "moduleName",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
Expand Down
Loading

0 comments on commit fd62fd9

Please sign in to comment.