We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The parsing of heredocs and nowdocs in Hack is broken, and this is visible in both the typechecker and h2tp.
h2tp
HipHop VM 3.15.2 (rel) Compiler: tags/HHVM-3.15.2-0-g83ac3e5e3f5657be0cf4c55884044f86a7818b90 Repo schema: 608339137764e8365964a1adaa7a27d125b6076f
<?hh // strict function main():void { echo <<<eof hello $foo1 eof; // no error? echo "hello $foo2"; // error: Undefined variable $foo2 }
Hack produces a type error for both the undefined variables $foo1 and $foo2.
$foo1
$foo2
An error is only produced for the reference to $foo2. The Hack parser can't see the variable $foo1 in the heredoc.
Run h2tp on this file:
<?hh // strict function main():void { echo <<<'end' test1 end; $foo = 1; echo <<<end test2 $foo test2 end; }
<?php require_once ($GLOBALS["HACKLIB_ROOT"]); function main() { echo ("test1"); $foo = 1; echo ("test2 " . $foo . " test2"); }
<?php require_once ($GLOBALS["HACKLIB_ROOT"]); function main() { echo ("'end'\ntest1\nen"); $foo = 1; echo ("end\ntest2 \044foo test2\nen"); }
The text was updated successfully, but these errors were encountered:
@ericlippert I'm thinking of trying to fix this, but is the new parser close enough to being finished that I shouldn't bother?
Sorry, something went wrong.
Fine by me if you fix it. We're still a ways out from having the new parser ready for production. Thanks!
I am going over old issues on this repository, to see which ones apply to the current versions of hhvm.
Support for h2tp was removed in 486f44a.
No branches or pull requests
The parsing of heredocs and nowdocs in Hack is broken, and this is visible in both the typechecker and
h2tp
.HHVM Version
1. Hack
Standalone code, or other way to reproduce the problem
Expected result
Hack produces a type error for both the undefined variables
$foo1
and$foo2
.Actual result
An error is only produced for the reference to
$foo2
. The Hack parser can't see the variable$foo1
in the heredoc.2.
h2tp
Standalone code, or other way to reproduce the problem
Run
h2tp
on this file:Expected result
Actual result
The text was updated successfully, but these errors were encountered: