Repository navigation
Support ANSII-C quoting in strings prefixed with $ - #54
Merged
Merged
Conversation
Contributor
|
This looks good to me. Thanks! I agree with your choice to keep it as a separate node type. |
Contributor
|
I think you have access to merge and publish now, but let me know if not. |
Member
Author
|
Looks like I don't have permission to publish to npm. |
Member
Author
|
Published to npm as |
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.
Refs atom/language-shellscript#146
Bash supports ANSII-C quoting in single-quoted strings that are prefixed with
$. For example, the string$'Here\'s Johnny'escapes the embedded single quote when prefixed with$. The expanded result is then treated as a single-quoted string.To support this, I took my cue from
raw_string, which is defined via a simple regex. I added a new symbol calledansii_c_stringwith a slightly more complex regular expression that allows escaped quotes single within the a string prefixed by$. One thing I wondered is whether this node should be aliased toraw_string, but it felt like that was adding complexity just to discard information from the tree, so I held off on it. Happy to adjust this though based on feedback.