Skip to content
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

Import improvements #1

Merged
merged 32 commits into from
May 26, 2024
Merged

Conversation

fingolfin
Copy link
Member

I just discovered the fork of this repository by @reiniscirpons. Really cool! Opening this PR so I won't forget where to look for it in the future.

If you are interested in "completing" this, I'd be happy to migrate the repository to the gap-system GitHub organization and give you direct write access there, to make it more official and perhaps invite others to contribute. Thoughts?

@reiniscirpons
Copy link
Collaborator

Hi @fingolfin, thank you for the kind words! I actually meant to get in contact with you about exactly this, but marking etc. got in the way and I forgot.

I would like to finishing the grammar. The main hurdle left at the moment is handling leading period floats e.g. .1 and correctly distinguishing them from record selectors (it seems this is not really used much in the GAP corpus, but is the last big language feature missing). The suggestion to migrate it to the gap-system organization is good and I would very much appreciate write access. I am also no expert in writing tree-sitter grammars, so contributions and suggestions from others would be greatly appreciated. Overall I agree with your proposal.

Having the grammar in as part of the official gap-system repository also opens up new possibilities of integrating tree-sitter with GAP itself, e.g. improving syntax highlighting in the interactive GAP sessions. I would also like to mention the tree-sitter-gaptst grammar I've been working on for parsing .tst files, which uses tree-sitter-gap for language injections. Do you think it would make sense to migrate tree-sitter-gaptst to the gap-system organization as well, or should this project be separate at the moment?

@fingolfin
Copy link
Member Author

Great to hear you are interested in finishing this :-)

Regarding float literals like .1 -- IMHO it would also be OK to ignore them for now -- as you say, they are rare to use (and I think it was a mistake to introduce them in the first place; I've been thinking about pushing towards deprecating and ultimately removing this, see gap-system/gap#3280). That said, for now it is there, and I wouldn't want to stop you from implementing it -- but if that's really the only thing stopping this from being "ready", we shouldn't hesitate to make a first "release" now (I guess that would include registering it with npm, so that npm install tree-sitter-gap tree-sitter would work, and submitting it for inclusion in the list on https://tree-sitter.github.io/tree-sitter/)

Having tree-sitter-gaptst on gap-system sounds sensible as well.

My plan would to migrate this repository here to gap-system, then give you write access, so that you can merge / push / integrate your work as you deem fit. I'll wait a bit with that in case you have a better suggestion.

@reiniscirpons
Copy link
Collaborator

I believe using the external scanner I should be able to implement leading period floats, its just that until now there were lower hanging fruit which I've prioritized. The suggestion about making a first release and submitting it to registries is good, I will look into that once the migration is done.

I agree with the proposed plan, no better suggestions here.

@fingolfin
Copy link
Member Author

@reiniscirpons I've transferred this repository and gave you "maintainer" access (if that turns out to be too limited I can still upgrade it to admin, just let me know if you run into blocks).

I've also sent you an invite to the gap-system GitHub org. Once you accepted that, you should be able to transfer your other treesitter repository.

Let me know if you need assistance with any of that.

Finally, you may wish to consider joining the GAP Slack (a multi user chat system) to be able to chat with others about this or other GAP related stuff: https://gap-system.org/slack should allow you to join.

Partially implement floats.

Improve permutations.

Start implementing multiline strings.

Add tests.
Fix empty perm and function call conflict.

Begin adding line continuations.
Improve record expressions.

Add support for function call options.
Add GAP variables.

Add list and record selectors.

Add more tests.
Add support for escape sequences.

Allow identifiers to start with numbers.

Make strings and chars handle # correctly.
Improve selectors to allow for more variable types.

Fix various corner cases for literals and function calls.
Make line continuations work in literals and identifiers.

Unify true and false into bool.

Improve Makefile.
Implement string external scanner.

Add more tests.
Add fail boolean.

Improve color highlighting.

Add highlight tests.
Improve syntax highlighting selectors.

Bump required tree-sitter version.

Improve README.
Refactor line continuation regex function.

Fix minor typos.
Add support for conversion markers in floats.

Add support for conversion markers in trailing period floats.

Add more tests.
Improve corpus extraction for tests.

Improve make clean.

Format code with Prettier.

Add formatting command to Makefile.
Add some tests from testinstall/kernel/scanner.tst

Add some tests from testinstall/kernel/read.tst
Restrict allowed range expression index types
Remove unused rule conflict declaration

Use tree-sitter calloc

Change queries to respect new precedence rules

Update Makefile
Bump version to 0.2.0.

BREAKING CHANGE: Tools previously using the `tree-sitter-gap` package
should now change the grammar name from `GAP` to `gap`.
Add script to visualize parse trees.

Add example parse tree image to README.

Add example image generation to Makefile.
@reiniscirpons reiniscirpons merged commit f56a710 into gap-system:master May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants