hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Hack: decl mode allows closing tag

Open simonwelsh opened this issue 12 years ago • 4 comments

This passes Hack:

<?hh // decl

?>

but running in HHVM gives the Fatal error: syntax error, unexpected T_HH_ERROR, expecting $end. Switching the file to partial of strict correctly gets the Hack does not allow the closing ?> tag from hh_client

simonwelsh avatar Apr 10 '14 02:04 simonwelsh

Good catch! Thanks! I think we should relax HHVM instead of making Hack stricter. Decl is designed to be as permissive as possible.

pikatchu avatar Apr 10 '14 18:04 pikatchu

Hmm, wouldn't that mean that we'd be allowing inline "html" in // decl, though?

elgenie avatar Apr 11 '14 13:04 elgenie

Yeah, I'm with @elgenie and @simonwelsh here -- decl is supposed to be very permissive, but there's still a lot of things you aren't allowed to do there. I think closing tags should be one of them, IMO it's a key part of the Hack syntax, ethos, and mental model that there is no such thing as a closing tag in Hack, the concept just doesn't exist there at all.

jwatzman avatar Apr 14 '14 17:04 jwatzman

D1280962 is out internally to ban ?> even in decl mode. @pikatchu can reject that diff and we'll discuss more here, or forever hold his peace ;)

jwatzman avatar Apr 16 '14 23:04 jwatzman