Skip to content

Commit

Permalink
Merge pull request #7 from joker1007/make-member-not-hidden
Browse files Browse the repository at this point in the history
fix: make member node not hidden
  • Loading branch information
joker1007 authored Dec 7, 2023
2 parents e3274ac + c60813d commit 5f29849
Show file tree
Hide file tree
Showing 8 changed files with 5,027 additions and 4,830 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ module.exports = grammar({
$.class_name,
optional($.module_type_parameters),
optional($.superclass),
alias(repeat(choice($._member, $._nestable_decls)), $.members),
alias(repeat(choice($.member, $._nestable_decls)), $.members),
"end"
)
),
Expand All @@ -212,7 +212,7 @@ module.exports = grammar({
alias($.class_name, $.module_name),
optional($.module_type_parameters),
optional($.module_self_type_binds),
alias(repeat(choice($._member, $._nestable_decls)), $.members),
alias(repeat(choice($.member, $._nestable_decls)), $.members),
"end"
)
),
Expand Down Expand Up @@ -330,7 +330,7 @@ module.exports = grammar({
seq("?", "{", $.parameters, optional($.self_type_binding), "->", $.type, "}"),
),

_member: $ => seq(
member: $ => seq(
alias(repeat($.annotation), $.annotations),
choice(
$.ivar_member,
Expand Down
6 changes: 3 additions & 3 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@
"members": [
{
"type": "SYMBOL",
"name": "_member"
"name": "member"
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -1433,7 +1433,7 @@
"members": [
{
"type": "SYMBOL",
"name": "_member"
"name": "member"
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -2855,7 +2855,7 @@
}
]
},
"_member": {
"member": {
"type": "SEQ",
"members": [
{
Expand Down
43 changes: 29 additions & 14 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@
}
},
{
"type": "members",
"type": "member",
"named": true,
"fields": {},
"children": {
Expand All @@ -723,55 +723,70 @@
"named": true
},
{
"type": "class_alias_decl",
"type": "extend_member",
"named": true
},
{
"type": "class_decl",
"type": "include_member",
"named": true
},
{
"type": "const_decl",
"type": "ivar_member",
"named": true
},
{
"type": "extend_member",
"type": "method_member",
"named": true
},
{
"type": "include_member",
"type": "prepend_member",
"named": true
},
{
"type": "interface_decl",
"type": "visibility_member",
"named": true
}
]
}
},
{
"type": "members",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "class_alias_decl",
"named": true
},
{
"type": "ivar_member",
"type": "class_decl",
"named": true
},
{
"type": "method_member",
"type": "const_decl",
"named": true
},
{
"type": "module_alias_decl",
"type": "interface_decl",
"named": true
},
{
"type": "module_decl",
"type": "member",
"named": true
},
{
"type": "prepend_member",
"type": "module_alias_decl",
"named": true
},
{
"type": "type_alias_decl",
"type": "module_decl",
"named": true
},
{
"type": "visibility_member",
"type": "type_alias_decl",
"named": true
}
]
Expand Down
Loading

0 comments on commit 5f29849

Please sign in to comment.