This repository was archived by the owner on Aug 2, 2024. It is now read-only.
Open
Conversation
Literals will be the same colour as the user's terminal's directories.
Collaborator
|
Thanks, @sudoPom! @thevirtuoso1973, can you please review it? |
Collaborator
|
As I remember, star dependencies are not allowed if we want to publish our library on crates.io: |
Author
|
Will do! |
* Ansi term version * Itertools re added (whoops)
Comment on lines
+536
to
+545
| fn get_color(color_of: &str) -> ansi_term::Style{ | ||
| let colors = LsColors::from_env().unwrap_or_default(); | ||
| let mut style: std::option::Option<&lscolors::Style>; | ||
| match color_of{ | ||
| "Directory" => style = colors.style_for_indicator(lscolors::Indicator::Directory), | ||
| "Normal" => style = colors.style_for_indicator(lscolors::Indicator::Normal), | ||
| _ => panic!("The only used LSColours are 'Directory' and 'Normal'") | ||
| }; | ||
| style.map(Style::to_ansi_term_style).unwrap_or_default() | ||
| } |
Contributor
There was a problem hiding this comment.
This would be a nice place to define a mapping from nodes to colors.
But for now, I suggest changing the match to something like
"ImagePred" => blah blah directory...
_ => blah blah normal...
Contributor
There was a problem hiding this comment.
Also we probably don't need to unwrap/panic over a missing color env, so pick some default if possible.
Contributor
|
I like the idea of using directory color. Also generally use |
Comment on lines
-713
to
-739
| /// Returns a normalized version of a resolution error --- should be better for hash equality. | ||
| /// Without this, may get a lot of resolution errors, for example, that are identical except for a different | ||
| /// auxiliary variable index. | ||
| fn normalize(self) -> ResolutionError { | ||
| match self { | ||
| ResolutionError::UnknownPredicate(l) => { | ||
| ResolutionError::UnknownPredicate(l.normalized_terms()) | ||
| } | ||
| ResolutionError::InsufficientGroundness(ls) => ResolutionError::InsufficientGroundness( | ||
| ls.into_iter().map(|x| x.normalized_terms()).collect(), | ||
| ), | ||
| ResolutionError::MaximumDepthExceeded(ls, s) => ResolutionError::MaximumDepthExceeded( | ||
| ls.into_iter().map(|x| x.normalized_terms()).collect(), | ||
| s, | ||
| ), | ||
| ResolutionError::BuiltinFailure(l, s) => { | ||
| ResolutionError::BuiltinFailure(l.normalized_terms(), s) | ||
| } | ||
| ResolutionError::InsufficientRules(l) => { | ||
| ResolutionError::InsufficientRules(l.normalized_terms()) | ||
| } | ||
| ResolutionError::InconsistentGroundnessSignature(sigs) => { | ||
| ResolutionError::InconsistentGroundnessSignature(sigs.to_vec()) | ||
| } | ||
| ResolutionError::NegationProof(l) => { | ||
| ResolutionError::NegationProof(l.normalized_terms()) | ||
| } |
Contributor
There was a problem hiding this comment.
also, you're probably aware but this (and another change) shouldn't be removed
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proofs produced by the
modus proofcommand will now contain literals that are coloured the same way that the user's terminal colours directories, so it is guaranteed to be easily visible to the user. This PR should close #185 .Before fix:
After fix: