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

Build TextMate grammar from YAML #42

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Marcelotsvaz
Copy link

I want to implement #32 and fix some bugs in the syntax highlighting but working with the TextMate grammar in JSON is a miserable experience. Building the JSON from a YAML file is a huge improvement.

YAML Advantages Over JSON

  • Multi-line strings for commented regexes
  • No double escaping regexes
  • Basic code re-use with YAML anchors
  • Less typing with unquoted strings
  • No complains about trailing commas (this drives me crazy in JSON)

Later we can add variable substitution and includes if needed.

What I Did

  • Converted the JSON grammar to YAML
  • Did some manual cleanup (I will do more later)
  • Created a build script to convert it back to JSON
  • Added some instructions in CONTRIBUTING.md

Building the Grammar

yarn build:grammar

This will run build/grammar.mjs.

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.

1 participant