-
-
Notifications
You must be signed in to change notification settings - Fork 419
Add lexer for Typst #877
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
Comments
I converted the new pygments lexer (credits go to @jvoisin) to the Chroma XML format using Only the line <rule pattern="(_|^|+|-|/|*|->|<-|!=|==)\b"><token type="Operator"/></rule> was broken and an error was shown while running the test. To fix it, I escaped the special characters +, -, /, and * by preceding them with a backslash (\): <rule pattern="(_|\^|\+|\-|\/|\*|>|<|!=|==)\b"><token type="Operator"/></rule> However, there are still a few problems remaining, as shown below: My example works just fine in |
FYI I have looked at this problem and put some incremental work into the typst lexer at https://github.com/pygments/pygments It will probably be the easiest if we first develop there and then simply copy the lexer over just as you did before. Happy for feedback on my recent PR over there: |
Discovered while hacking on alecthomas#877
Combining the latest state pygments/pygments#2724 (with If anyone wants to play with it, the converted xml is attached (as TXT to please github...) |
Discovered while building on top of #877 (comment) (by @miliog) The pygments "regex.words" should be escaped, since they may contain special regex chars (like `^` or `+`).
Closes alecthomas#877
Closes alecthomas#877
Pygment's MR just got merged, I just opened a PR here, feel free to test it locally: #1007 |
Is there an existing issue for this?
What is the missing lexer?
Typst is a new markup language and I've noticed that
chroma
doesn't support it.The syntax documentation can be found here:
https://typst.app/docs/reference/syntax/
Links to existing syntax definitions
Github Linguist uses the following:
https://github.com/michidk/typst-grammar/blob/master/grammars/tmlanguage.json
The text was updated successfully, but these errors were encountered: