-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fast ANSI string operations in C #316
Merged
Merged
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
* Omit empty tags now. * Better color representation.
Plus the output classes as well.
Especially broken color sequences.
We only emit it if there was an unkown SGR tag in the input. Otherwise we use the more specific closing tags.
* Now we always close a color tag, before we start another one. * 0m is now only emitted when there was an unknown SGR tag before.
Also simplify data structure of colors, just store the color number directly, we are using 254 and 255 for 256 and RGB color, anyway.
I.e. <t1><t2>...</t2></t1> instead of <t1><t2>...</t1></t2>.
Plus helper function for CSS and also ansi_simplify().
When there are no tags.
It does not currently find hyperlink seqs...
Coming to the other functions as well...
15 tasks
They convert to UTF-8 on input, always return UTF-8.
`LENGTH(NULL)` does not seems to work well on R 3.4 and before.
Also add `utf8_nchar()`. Towards #317.
The second might happen after the DLL was unloaded, e.g. in testthatlabs, I am not sure why.
It is nice to see that it is happening.
To avoid name clash with testthat.
`ansi_substr()` and `ansi_substring()` uses this now, and the new `utf8_substr()` function as well. The latter is slightly faster, but it does not work for ANSI styled strings.
Some chunks in the docs create this, and it is very small, so it is simpler to just include it.
For simplified ANSI sequences.
IDK how and when they were removed...
And that ansi_* functions do not handle it.
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.
Implemented:
ansi_simplify()
ansi_substr()
ansi_has_any()
ansi_strip()
ansi_html()
utf8_nchar()
TODO:
Support ANSI hyperlinks in the C ANSI iterator.NA
s.Might also implement other
ansi_*()
functions in C, to make them faster.Closes #316.