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

Major improvements to the textmate grammar #287

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

thetarnav
Copy link
Contributor

@thetarnav thetarnav commented Dec 25, 2023

I've been making a lot of small changes to the grammar since last time, but only now I think they are stable enough to share.

More and more tokens have their proper scopes guessed from just the syntax. I think that almost every token could be guessed accurately, with few exceptions to leave to semantic tokens.

Here are few changes:

  • typeid is now a support.type.primitive, instead of a keyword, similar to other builtin types
  • Added $ and % as operators
  • every type annotation (foo: Bar(Baz)) will assume only types can be on the right side
  • assignments using :: that aren't followed by strict, proc, etc. will have a variable.other.constant scope

image

  • added block labels
  • Every function call now has a meta.function-call scope.

image

  • mark as types some tokens that can only be types

image

And few small fixes and improvements, like using --- in forgein code blocks.

image

I've been vscode with those changes for a while and tried to go over odin and old codebases to see if there are some bugs with highlighting, but it seems to be working pretty well.
But it probably would be smart for someone else to try them as well.

@DanielGavin
Copy link
Owner

Sweet thanks.

I'll try and get it on my computer locally and use it for a while.

@DanielGavin DanielGavin merged commit 692b1b9 into DanielGavin:master Jan 2, 2024
6 checks passed
@thetarnav thetarnav deleted the textmate-improvements branch January 2, 2024 20:18
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