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

[Q] Can I combine lexers? #57

Open
dkuku opened this issue Feb 7, 2023 · 1 comment
Open

[Q] Can I combine lexers? #57

dkuku opened this issue Feb 7, 2023 · 1 comment

Comments

@dkuku
Copy link

dkuku commented Feb 7, 2023

I see there is a diff lexer. Can it be used with elixir lexer to show diff output with code highlight like it's done on github diffs?

@tmbb
Copy link
Collaborator

tmbb commented Aug 31, 2024

There isn't an easy way to combine lexers in a general way.
My advice is to have a "master" lexer, which combines the actual lexers together.

For example, you could have a ElixirDiffLexer which would render a diff reusing the main combinator of the Elixir renderer.

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

No branches or pull requests

2 participants