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

NOWDOC test expects HEREDOC and NOWDOC is not working locally but passes on CI #36

Closed
Ben3eeE opened this issue Nov 30, 2018 · 3 comments
Labels

Comments

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Nov 30, 2018

==========
Nowdocs
==========
<?php
<<<'PHP'
<?php echo phpversion().PHP_SAPI;
PHP
?>
---
(program (expression_statement (heredoc)))

This test fails locally:

    ✗ Nowdocs
        »
        actual expected

        (program (ERROR) (text) (echo_statement (binary_expression (function_call_expression (qualified_name (name)) (arguments)) (qualified_name (name)))) (expression_statement (qualified_name (name))))heredoc)))

I don't know why it doesn't fail on CI but does locally. It seems that NOWDOC is expected to parsed as HEREDOC from the test however which is wrong.

Also testing the tests code in Atom when running atom/language-php#303 confirms that it's parsed the same way as the test.

Expected should be:

(program (expression_statement (nowdoc)))

http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
http://php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc
https://wiki.php.net/rfc/heredoc-with-double-quotes

@Ben3eeE Ben3eeE added the bug label Nov 30, 2018
@lukedan
Copy link

lukedan commented Feb 25, 2021

This is likely due to CRLF line endings. See also tree-sitter/tree-sitter#913.

@maxbrunsfeld
Copy link
Contributor

I think this will be fixed in #55.

@patrickt
Copy link
Contributor

patrickt commented Mar 9, 2021

Thanks to @maxbrunsfeld for the fix!

@patrickt patrickt closed this as completed Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants