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
Coloring in tokens #864
Merged
Merged
Coloring in tokens #864
Conversation
This file contains 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
wycats
force-pushed
the
coloring_in_tokens
branch
from
October 22, 2019 17:05
1da91a8
to
a7a6b40
Compare
wycats
force-pushed
the
coloring_in_tokens
branch
2 times, most recently
from
October 22, 2019 18:02
d425335
to
7c7fa77
Compare
andrasio
reviewed
Oct 22, 2019
src/shell/helper.rs
Outdated
|
||
println!(""); | ||
ptree::print_tree(&tokens.tracer().clone().print(Text::from(line))).unwrap(); | ||
println!(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah.. it's a draft PR.
wycats
force-pushed
the
coloring_in_tokens
branch
from
October 22, 2019 22:27
7c7fa77
to
d8936ab
Compare
wycats
force-pushed
the
coloring_in_tokens
branch
from
October 22, 2019 22:43
d8936ab
to
66d0180
Compare
This commit should finish the `coloring_in_tokens` feature, which moves the shape accumulator into the token stream. This allows rollbacks of the token stream to also roll back any shapes that were added. This commit also adds a much nicer syntax highlighter trace, which shows all of the paths the highlighter took to arrive at a particular coloring output. This change is fairly substantial, but really improves the understandability of the flow. I intend to update the normal parser with a similar tracing view. In general, this change also fleshes out the concept of "atomic" token stream operations. A good next step would be to try to make the parser more error-correcting, using the coloring infrastructure. A follow-up step would involve merging the parser and highlighter shapes themselves.
wycats
force-pushed
the
coloring_in_tokens
branch
from
October 22, 2019 23:19
66d0180
to
6a7c00e
Compare
elferherrera
pushed a commit
to elferherrera/nushell
that referenced
this pull request
Feb 7, 2022
kubouch
pushed a commit
that referenced
this pull request
Feb 7, 2022
bobhy
pushed a commit
to bobhy/nushell
that referenced
this pull request
Oct 22, 2023
Co-authored-by: Jelle Besseling <jelle@bigbridge.nl>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.