Skip to content

Commit

Permalink
Remove specific named body fields
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 committed Jul 23, 2022
1 parent 99381fb commit ec7fdab
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 278 deletions.
12 changes: 6 additions & 6 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ module.exports = grammar({
seq(
field('parameters', alias($.parameters, $.method_parameters)),
choice(
seq(optional($._terminator), optional(field('method_body', $.body_statement)), 'end'),
seq(optional($._terminator), optional(field('body', $.body_statement)), 'end'),
$._body_expr
)

Expand All @@ -169,7 +169,7 @@ module.exports = grammar({
field('parameters', alias($.bare_parameters, $.method_parameters))
),
$._terminator,
optional(field('method_body', $.body_statement)),
optional(field('body', $.body_statement)),
'end'
),
),
Expand Down Expand Up @@ -266,7 +266,7 @@ module.exports = grammar({
field('name', choice($.constant, $.scope_resolution)),
field('superclass', optional($.superclass)),
$._terminator,
optional(field('namespace_body', $.body_statement)),
optional(field('body', $.body_statement)),
'end'
),

Expand All @@ -282,15 +282,15 @@ module.exports = grammar({
alias($._singleton_class_left_angle_left_langle, '<<'),
field('value', $._arg),
$._terminator,
optional(field('namespace_body', $.body_statement)),
optional(field('body', $.body_statement)),
'end'
),

module: $ => seq(
'module',
field('name', choice($.constant, $.scope_resolution)),
choice(
seq($._terminator, optional(field('namespace_body', $.body_statement)), 'end'),
seq($._terminator, optional(field('body', $.body_statement)), 'end'),
'end'
)
),
Expand Down Expand Up @@ -830,7 +830,7 @@ module.exports = grammar({
field('parameters', $.block_parameters),
optional($._terminator)
)),
optional(field('do_block_body', $.body_statement)),
optional(field('body', $.body_statement)),
'end'
),

Expand Down
12 changes: 6 additions & 6 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
"members": [
{
"type": "FIELD",
"name": "method_body",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "body_statement"
Expand Down Expand Up @@ -399,7 +399,7 @@
"members": [
{
"type": "FIELD",
"name": "method_body",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "body_statement"
Expand Down Expand Up @@ -954,7 +954,7 @@
"members": [
{
"type": "FIELD",
"name": "namespace_body",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "body_statement"
Expand Down Expand Up @@ -1088,7 +1088,7 @@
"members": [
{
"type": "FIELD",
"name": "namespace_body",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "body_statement"
Expand Down Expand Up @@ -1144,7 +1144,7 @@
"members": [
{
"type": "FIELD",
"name": "namespace_body",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "body_statement"
Expand Down Expand Up @@ -4905,7 +4905,7 @@
"members": [
{
"type": "FIELD",
"name": "do_block_body",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "body_statement"
Expand Down
48 changes: 24 additions & 24 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -1380,26 +1380,26 @@
"type": "class",
"named": true,
"fields": {
"name": {
"body": {
"multiple": false,
"required": true,
"required": false,
"types": [
{
"type": "constant",
"named": true
},
{
"type": "scope_resolution",
"type": "body_statement",
"named": true
}
]
},
"namespace_body": {
"name": {
"multiple": false,
"required": false,
"required": true,
"types": [
{
"type": "body_statement",
"type": "constant",
"named": true
},
{
"type": "scope_resolution",
"named": true
}
]
Expand Down Expand Up @@ -1596,7 +1596,7 @@
"type": "do_block",
"named": true,
"fields": {
"do_block_body": {
"body": {
"multiple": false,
"required": false,
"types": [
Expand Down Expand Up @@ -2338,7 +2338,7 @@
"type": "method",
"named": true,
"fields": {
"method_body": {
"body": {
"multiple": false,
"required": false,
"types": [
Expand Down Expand Up @@ -2435,26 +2435,26 @@
"type": "module",
"named": true,
"fields": {
"name": {
"body": {
"multiple": false,
"required": true,
"required": false,
"types": [
{
"type": "constant",
"named": true
},
{
"type": "scope_resolution",
"type": "body_statement",
"named": true
}
]
},
"namespace_body": {
"name": {
"multiple": false,
"required": false,
"required": true,
"types": [
{
"type": "body_statement",
"type": "constant",
"named": true
},
{
"type": "scope_resolution",
"named": true
}
]
Expand Down Expand Up @@ -2995,7 +2995,7 @@
"type": "singleton_class",
"named": true,
"fields": {
"namespace_body": {
"body": {
"multiple": false,
"required": false,
"types": [
Expand All @@ -3021,7 +3021,7 @@
"type": "singleton_method",
"named": true,
"fields": {
"method_body": {
"body": {
"multiple": false,
"required": false,
"types": [
Expand Down
Loading

0 comments on commit ec7fdab

Please sign in to comment.