C escapes#174
Closed
thdot wants to merge 2 commits into
Closed
Conversation
A new command line option --c-esacpes is implemented which treats files as if they contain C-style character escapes. So for example "\nHello" is parsed as "hello" instead of "nhello".
Codecov Report
@@ Coverage Diff @@
## master #174 +/- ##
==========================================
+ Coverage 87.81% 88.41% +0.59%
==========================================
Files 2 3 +1
Lines 665 656 -9
Branches 93 94 +1
==========================================
- Hits 584 580 -4
+ Misses 62 58 -4
+ Partials 19 18 -1
Continue to review full report at Codecov.
|
Collaborator
|
I like the idea. |
larsoner
reviewed
Oct 28, 2017
| action='store_true', default=False, | ||
| help='Treats files as if they contain C-style character ' | ||
| 'escapes. So for example "\\nHello" is parsed as ' | ||
| '"hello" instead of "nhallo".') |
Member
There was a problem hiding this comment.
nhallo -> nhello
also \\nHello -> \\nhello or capitalize the other two
And maybe r"\nhello" is clearer than "\\nhello"?
| quiet_level = 0 | ||
| encodings = ['utf-8', 'iso-8859-1'] | ||
| word_regex = re.compile(r"[\w\-']+") | ||
| c_escape_regex = re.compile(r'\\\w') |
Member
There was a problem hiding this comment.
Would it be better to use the standard set of escape sequences?
Contributor
Author
peternewman
reviewed
Jan 4, 2018
|
|
||
|
|
||
| def test_c_escapes(): | ||
| """Test c-esacpes option""" |
Collaborator
There was a problem hiding this comment.
Meta spelling error, it should be c-escapes! 😄
Contributor
|
ping @thdot — any progress? If not, we can close this PR. |
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 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.
A new command line option
--c-esacpesis implemented which treats files as if they contain C-style character escapes. So for example "\nHello" is parsed as "hello" instead of "nhello".What do you think?