Skip to content

Add Treetop Support - https://cjheath.github.io/treetop/ #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

eric1234
Copy link
Contributor

A DSL that integrates with Ruby for expressing a PEG (parsing expression grammer). The tool uses itself to define the language so if you really want the full details on the language it is at:

https://github.com/cjheath/treetop/blob/master/lib/treetop/compiler/metagrammar.treetop

But the cliff notes are:

  • Very Ruby-like
  • Only supports single-line comments
  • Embeds proper Ruby code so I just copy/pasted the complexitychecks from the Ruby language specs.

To make this commit I just:

  1. Added it to the languages.json file (per README)
  2. Ran go generate (per README)
  3. Ran ./test-all.sh. This confirmed all green and updated LANGAUGES.md and SCC-OUTPUT-REPORT.html (maybe this step should be added to README?)

I also ran go build to create the binary and tested it against my project which has many Treetop files and confirmed it worked.

A DSL that integrates with Ruby for expressing a PEG (parsing expression
grammer). The tool uses itself to define the language so if you really want
the full details on the language it is at:

https://github.com/cjheath/treetop/blob/master/lib/treetop/compiler/metagrammar.treetop

But the cliff notes are:

* Very Ruby-like
* Only supports single-line comments
* Embeds proper Ruby code so I just copy/pasted the complexitychecks from the
  Ruby language specs.

To make this commit I just:

1. Added it to the `languages.json` file (per README)
2. Ran `go generate` (per README)
3. Ran `./test-all.sh`. This confirmed all green and updated `LANGAUGES.md` and
   `SCC-OUTPUT-REPORT.html` (maybe this step should be added to README?)

I also ran `go build` to create the binary and tested it against my project
which has many Treetop files and confirmed it worked.
@boytertesting boytertesting bot added M/complexity Normal or medium complexity M/size Normal or medium sized change labels Jan 14, 2025
@boyter
Copy link
Owner

boyter commented Jan 14, 2025

One of the best PR's I have ever seen. Not only approved but noted as one for others to look at. Thank you very much!

Will make the next release.

@boyter boyter merged commit 6d92d43 into boyter:master Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M/complexity Normal or medium complexity M/size Normal or medium sized change
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

2 participants