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

lexers: add initial version of CUE lexer #858

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

myitcv
Copy link
Contributor

@myitcv myitcv commented Sep 23, 2023

This commit adds a decent first-cut of a lexer for CUE (https://cuelang.org).

The main aspects of the language are implemented, but there are likely a number of edge cases not covered, especially when it comes to string interpolation, but this is a sufficiently decent first cut so as to warrant merging into the chroma project rather than first working in a fork.

This was tested locally for visual correctness using

mkdir -p _examples
(command cd ./cmd/chroma; go run . --lexer=cue --html --html-inline-styles) < lexers/testdata/cue.actual > _examples/cue.html

and then loading _examples/cue.html in a browser.

Closes #857

This commit adds a decent first-cut of a lexer for CUE
(https://cuelang.org).

The main aspects of the language are implemented, but there are likely a
number of edge cases not covered, especially when it comes to string
interpolation, but this is a sufficiently decent first cut so as to
warrant merging into the chroma project rather than first working in a
fork.

This was tested locally for visual correctness using

    mkdir -p _examples
    (command cd ./cmd/chroma; go run . --lexer=cue --html --html-inline-styles) < lexers/testdata/cue.actual > _examples/cue.html

and then loading _examples/cue.html in a browser.

Closes alecthomas#857
@myitcv myitcv mentioned this pull request Sep 23, 2023
Closed
1 task
@alecthomas alecthomas merged commit 827bd93 into alecthomas:master Sep 23, 2023
2 checks passed
@alecthomas
Copy link
Owner

Thanks, looks good.

For future reference you can just run ./bin/chroma to compile and run.

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.

CUE
2 participants