Skip to content

Commit

Permalink
fix: use correct keyword for type aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
cfcosta authored and rvcas committed Jul 12, 2023
1 parent 2c9bd21 commit 02527db
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 94 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = grammar({
$.module_comment,
$.definition_comment,
$.comment,
$.alias
$.type_alias
)),
_definition: ($) => choice($.import),

Expand Down Expand Up @@ -37,8 +37,8 @@ module.exports = grammar({
)
),

alias: ($) =>
seq("alias", $.type_definition, "=", $.type_definition),
type_alias: ($) =>
seq("type", $.type_definition, "=", $.type_definition),

type_definition: ($) =>
seq($.type_identifier, optional(seq("<", repeat_separated_by($.type_argument, ","), ">"))),
Expand Down
6 changes: 3 additions & 3 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
{
"type": "SYMBOL",
"name": "alias"
"name": "type_alias"
}
]
}
Expand Down Expand Up @@ -269,12 +269,12 @@
}
]
},
"alias": {
"type_alias": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "alias"
"value": "type"
},
{
"type": "SYMBOL",
Expand Down
46 changes: 23 additions & 23 deletions src/node-types.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
[
{
"type": "alias",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "type_definition",
"named": true
}
]
}
},
{
"type": "identifier",
"named": true,
Expand Down Expand Up @@ -68,10 +53,6 @@
"multiple": true,
"required": false,
"types": [
{
"type": "alias",
"named": true
},
{
"type": "comment",
"named": true
Expand All @@ -87,6 +68,25 @@
{
"type": "module_comment",
"named": true
},
{
"type": "type_alias",
"named": true
}
]
}
},
{
"type": "type_alias",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "type_definition",
"named": true
}
]
}
Expand Down Expand Up @@ -208,10 +208,6 @@
"type": ">",
"named": false
},
{
"type": "alias",
"named": false
},
{
"type": "as",
"named": false
Expand All @@ -228,6 +224,10 @@
"type": "module_comment",
"named": true
},
{
"type": "type",
"named": false
},
{
"type": "use",
"named": false
Expand Down
Loading

0 comments on commit 02527db

Please sign in to comment.