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

Fixes #30: String interpretation issues #31

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@lerouquin

lerouquin commented Jun 16, 2013

Added a check for plain strings (single or double quoted).

This also resolves the following issue:

Before :

{"my string.with a dot"|myFunction}
outputs to
<?php echo myFunction( my string["with a dot"] ); ?>
which results in a parse error.

After :

{"my string.with a dot"|myFunction}
outputs to
<?php echo myFunction( "my string.with a dot" ); ?>
which is the expected behavior.

Fixes #30: String interpretation issue
Added a check for plain strings (single or double quoted)
@eliemichel

This comment has been minimized.

Show comment
Hide comment
@eliemichel

eliemichel Sep 1, 2014

Contributor

Please comment the regex to explain what it is intended to match!

  1. Is it useful to "mute" parenthesis with ?: here?
  2. \\\' is not a valid escape sequence. If you want to match \', you need to add one more backslash.
  3. What is I want to end a string with a single backslash? "foo\" will fail since the backslash escapes the colon. But "foo\\" will display an extra backslash.

#"((\\(\\|"))|[^\\"])*?"# should work to match a double colon string. (escape it again to include it inside a PHP string).

Contributor

eliemichel commented Sep 1, 2014

Please comment the regex to explain what it is intended to match!

  1. Is it useful to "mute" parenthesis with ?: here?
  2. \\\' is not a valid escape sequence. If you want to match \', you need to add one more backslash.
  3. What is I want to end a string with a single backslash? "foo\" will fail since the backslash escapes the colon. But "foo\\" will display an extra backslash.

#"((\\(\\|"))|[^\\"])*?"# should work to match a double colon string. (escape it again to include it inside a PHP string).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment