Allow semi-colon-less 1 liners in PHP tags.
ryangjchandler opened this issue · comments
Ryan Chandler commented
Example from Laravel framework:
<div class="w-full mx-2 py-1 mt-1 bg-yellow text-black text-center uppercase">
<?php echo htmlspecialchars($content) ?>
</div>
Omitting the semicolon at the end of this statement is allowed. We should probably do a lookahead to see if the next token is a closing tag and if it is, skip the semicolon check.
Saif Eddin Gmati commented
this is actually easy, in semi()
function, expect either a semi-colon or ?>
.
another thing to note that ;;;;;;;;;;;;;;;;;
is same as ;
.