diff --git a/internal/php8/lexer.go b/internal/php8/lexer.go index 45ba443..12d2a34 100644 --- a/internal/php8/lexer.go +++ b/internal/php8/lexer.go @@ -112,42 +112,6 @@ func (lex *Lexer) isNotStringEnd(s byte) bool { } func (lex *Lexer) isHeredocEnd(p int) bool { - o, err := version.New("7.3") - if err != nil { - panic(err) - } - - if lex.phpVersion.GreaterOrEqual(o) { - return lex.isHeredocEndSince73(p) - } - - return lex.isHeredocEndBefore73(p) -} - -func (lex *Lexer) isHeredocEndBefore73(p int) bool { - if lex.data[p-1] != '\r' && lex.data[p-1] != '\n' { - return false - } - - l := len(lex.heredocLabel) - if len(lex.data) < p+l { - return false - } - - if len(lex.data) > p+l && lex.data[p+l] != ';' && lex.data[p+l] != '\r' && - lex.data[p+l] != '\n' { - return false - } - - if len(lex.data) > p+l+1 && lex.data[p+l] == ';' && lex.data[p+l+1] != '\r' && - lex.data[p+l+1] != '\n' { - return false - } - - return bytes.Equal(lex.heredocLabel, lex.data[p:p+l]) -} - -func (lex *Lexer) isHeredocEndSince73(p int) bool { if lex.data[p-1] != '\r' && lex.data[p-1] != '\n' { return false }