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

Coloring in tokens #864

Merged
merged 1 commit into from Oct 22, 2019
Merged

Coloring in tokens #864

merged 1 commit into from Oct 22, 2019

Conversation

wycats
Copy link
Contributor

@wycats wycats commented Oct 22, 2019

No description provided.

@gitpod-io
Copy link

gitpod-io bot commented Oct 22, 2019


println!("");
ptree::print_tree(&tokens.tracer().clone().print(Text::from(line))).unwrap();
println!("");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these expected?

Copy link
Member

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 wycats marked this pull request as ready for review October 22, 2019 22:30
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 wycats merged commit 29ec9a4 into master Oct 22, 2019
@andrasio andrasio deleted the coloring_in_tokens branch October 23, 2019 00:27
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants