This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Split the code doing highlighting from the rest.#37
Open
nickolay wants to merge 1 commit intoatom:masterfrom
Open
Split the code doing highlighting from the rest.#37nickolay wants to merge 1 commit intoatom:masterfrom
nickolay wants to merge 1 commit intoatom:masterfrom
Conversation
Contributor
|
@nickolay mind rebasing with master, also I'd love to know @kevinsawicki's thoughts on this refactor. |
Author
|
@bcoe Thanks for getting back to me! Sure, if you decide this split-up is something you want, I can prepare an updated PR. |
Contributor
|
@nickolay if you're still interested in landing this refactor, please go ahead and update this pull request and I'll work on getting it landed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently
highlights.coffeemixes distinct functionality:first-matemodule. This has many dependencies and is a large part of the whole module.first-mate's grammar. It is self-contained and pretty straightforward, when you know what it does.I suggest splitting the two for the sake of those assessing the library.
My story: I was looking for a library to perform syntax highlighting based on AST. I did not find it yet, but found this library.
I got confused by the "Loading Grammars From Modules" section of the README, as it seemed to suggest there was a way to write a JS module to perform the syntax highlighting, but provided no information on the API of such module, so I went looking into the source code to find what kind of input the highlighting code expects from the tokenizer.
(Turns out you only support TextMate-style language definitions, which are handled by
first-mate, but the bit of code I'm splitting into a separate file would still be reusable in my case.)