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

shell: balance parentheses inside $(...) interpolation #1216

Merged
merged 3 commits into from
Jun 25, 2019

Conversation

jneen
Copy link
Member

@jneen jneen commented Jun 25, 2019

Fixes #812

To lex correctly, we must make sure that interpolation does not end
until the balanced parenthesis. For this we need to use the state stack
to track the parenthesis depth.

http://jneen.net/ added 3 commits June 25, 2019 09:47
Fixes #812

To lex correctly, we must make sure that interpolation does not end
until the balanced parenthesis. For this we need to use the state stack
to track the parenthesis depth.
@jneen
Copy link
Member Author

jneen commented Jun 25, 2019

I also noticed a bug in the visual spec relating to backslash escapes in heredocs. Basically the heredoc regex was skipping over backslashes before handing them to the :interp state, so the :interp state wrongly saw a variable in e.g. \$BASH_VERSION. Fixed by adding backslash as a stop character in the heredoc regex.

@pyrmont pyrmont merged commit 2a8ce70 into master Jun 25, 2019
pyrmont added a commit to pyrmont/rouge that referenced this pull request Jun 25, 2019
The update to the Shell lexer made as a result of rouge-ruby#1216 should have
included an update to the PowerShell lexer. This is because the Shell
lexer renamed the `:paren` state. Since the PowerShell lexer relies on
this state, it needed to be updated to refer to the new state. This
commit does that.
pyrmont added a commit that referenced this pull request Jun 25, 2019
The update to the Shell lexer made as a result of #1216 should have
included an update to the PowerShell lexer. This is because the Shell
lexer renamed the `:paren` state. Since the PowerShell lexer relies on
this state, it needed to be updated to refer to the new state. This
commit does that.
@tancnle tancnle deleted the bugfix.shell-parens branch September 22, 2021 12:26
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.

Shell highlighting incorrect for combining $(...) with ((...))
2 participants