Skip to content

Fixes @splatting in double quoted strings #165

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

Merged
merged 2 commits into from
Apr 26, 2019

Conversation

msftrncs
Copy link
Contributor

@msftrncs msftrncs commented Apr 24, 2019

fixes #149, fixes #164

Include of #variable was removed from #doubleQuotedString, and a alternation of @ was removed from a match in #variableNoProperty for variables that had a scope modifier.

Double quoted HereDocs do not exhibit this problem, they do not include #variable.

"No @splats.wanted here"
"No @global:splats allowed here"

I'm not noticing any side effects.

This makes no attempt to improve any other part of the variable logic (such as @splats are not allowed to have member access).

remove #variable from #doubleQuotedString, remove @ from #variableNoProperty
@msftrncs
Copy link
Contributor Author

Forgot to mention that this could use to have some test cases as well, both in double quoted strings (sample test included in #149) and in double quoted heredocs.

@msftrncs
Copy link
Contributor Author

I have added some tests for the issue this fixes, and also just-in-case for heredocs. I tested the 'tests' on the syntax prior to this PR to confirm they detect the failure for splats in double quoted strings,

@TylerLeonhardt TylerLeonhardt requested a review from omniomi April 25, 2019 14:28
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TylerLeonhardt TylerLeonhardt merged commit cf27d6e into PowerShell:master Apr 26, 2019
@msftrncs msftrncs deleted the noSplatInStrings branch April 27, 2019 03:35
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.

Incorrect color coding Double-quoted strings treat @tokens as interpolations
2 participants