diff --git a/internal/php8/lexer.go b/internal/php8/lexer.go index 8bb9d89..799c4fc 100644 --- a/internal/php8/lexer.go +++ b/internal/php8/lexer.go @@ -217,6 +217,16 @@ func (lex *Lexer) ungetStr(suffix string) { } } +// addOpenTagToken adds the open tag the token starts with: { - lex.addFreeFloatingToken(tkn, token.T_OPEN_TAG, lex.ts, lex.te) + lex.addOpenTagToken(tkn) fnext php; }; ' { diff --git a/internal/php8/scanner_test.go b/internal/php8/scanner_test.go index 90809b9..8968bfc 100644 --- a/internal/php8/scanner_test.go +++ b/internal/php8/scanner_test.go @@ -405,6 +405,50 @@ func TestShebang(test *testing.T) { assert.DeepEqual(test, expected, actual) } +func TestOpenTagAtEnd(test *testing.T) { + src := `