tolerant-php-parser icon indicating copy to clipboard operation
tolerant-php-parser copied to clipboard

Incorrectly identified need for closing brace

Open russjudge opened this issue 6 years ago • 2 comments

Attached below is the code that was identified as needing a closing brace. The plug-in marked the end of the file as the point needing the brace

index.txt

russjudge avatar Nov 28 '18 13:11 russjudge

This has a parse error in php 7.0 and 7.3

Marking the syntax error to be the end of the file seems like the reasonable behavior (this typically emits errors where the MissingToken is). What do you expect the behavior to be?

It might be user friendly to have additional information about the start as well, if that's what you meant.

php -l index.txt

Parse error: syntax error, unexpected end of file in index.txt on line 67
Errors parsing index.txt

TysonAndre avatar Nov 28 '18 15:11 TysonAndre

There is a short PHP Tag at the closing UL. I don't think tolerant PHP parser recognizes this as PHP code. Short tags are deprecated anyway.

sunverwerth avatar Nov 29 '18 09:11 sunverwerth