Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Remove rule redundant rule method_def.
Browse files Browse the repository at this point in the history
Instead of having:

for code:

```
def foo
end
```

It used to generate:

```
(def (method_def (identifier)))
```

now it generates:

```
(def (identifier))
```
  • Loading branch information
hugopl committed Nov 29, 2024
1 parent 50b4d59 commit 3bc4c60
Show file tree
Hide file tree
Showing 5 changed files with 11,052 additions and 11,144 deletions.
5 changes: 2 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = grammar({
$.module,
$.include,
$.extend,
$.abstract_def,
$.def,
$._expression,
),
Expand Down Expand Up @@ -117,8 +118,6 @@ module.exports = grammar({

extend: $ => seq('extend', choice($.constant, $.self)),

def: $ => choice($.abstract_def, $.method_def),

_base_def: $ =>
prec.right(
seq(
Expand Down Expand Up @@ -157,7 +156,7 @@ module.exports = grammar({
abstract_def: $ =>
seq(optional(choice($.private, $.protected)), 'abstract', $._base_def),

method_def: $ =>
def: $ =>
seq(
optional(choice($.private, $.protected)),
$._base_def,
Expand Down
19 changes: 5 additions & 14 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3bc4c60

Please sign in to comment.