Skip to content

Commit

Permalink
feat: new and awesome grammar, suitable for ST, VSCode, docs and beyond!
Browse files Browse the repository at this point in the history
Fully covers Tact 1.3.0 🚀

My refactoring kept those goals in mind:

1. Grammar should work with docs, which feature lots of small snippets
without the full context of a regular Tact file

2. Grammar should work with Sublime, VSCode and Monaco editor (VSCode's
underlying editor).

3. Grammar should properly highlight the "happy path", when the
referenced code can be checked by Tact compiler.

After all, this is a TextMate grammar, which operates on sequences of
RegExes. And thus, it's nigh-impossible and mostly pointless to cover
all cases and match up to Ohm's grammer even when one really tries (see
5k+ lines of terse RegEx in TypeScript's TextMate grammar). We just need
the "happy path" to work.

P.S.: Ironically enough, common advice for parsing HTML with regular
expressions is: "Please, don't!", while 80% of all HTML highlighting out
there is done with them :)

Closes #1
Closes #2
  • Loading branch information
novusnota committed May 29, 2024
1 parent 69ad81a commit 78d6e40
Show file tree
Hide file tree
Showing 5 changed files with 1,328 additions and 1,698 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,5 @@ dist
/.venv
!.keep
/*.tact
/*.ohm
/*.json
Loading

0 comments on commit 78d6e40

Please sign in to comment.