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

Backtick operator does not parse interpolated variables #135

Closed
Sjord opened this issue May 31, 2022 · 2 comments
Closed

Backtick operator does not parse interpolated variables #135

Sjord opened this issue May 31, 2022 · 2 comments

Comments

@Sjord
Copy link
Contributor

Sjord commented May 31, 2022

The backtick execution operator can have variables that are interpolated, but these are not parsed.

<?php
`hello $world`;

Actual:

(program [0, 0] - [2, 0]
  (php_tag [0, 0] - [0, 5])
  (expression_statement [1, 0] - [1, 15]
    (shell_command_expression [1, 0] - [1, 14])))

Expected:

(program [0, 0] - [2, 0]
  (php_tag [0, 0] - [0, 5])
  (expression_statement [1, 0] - [1, 15]
    (shell_command_expression [1, 0] - [1, 14])))
      (string [1, 1] - [1, 7])
      (variable_name [1, 7] - [1, 13]
        (name [1, 8] - [1, 13])))))
@Sjord
Copy link
Contributor Author

Sjord commented Jun 6, 2022

I created some tests for this.

@cfroystad
Copy link
Collaborator

Beautiful! Thanks for the tests. This should be fairly straight forward once all the quirks in heredoc has been ironed out

cfroystad added a commit to cfroystad/tree-sitter-php that referenced this issue Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants