From ec3527909cf09433f15cd0ac952e82f3a5592192 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Sun, 26 Mar 2023 01:54:21 +0100 Subject: [PATCH] refactor: remove unused function --- internal/php8/lexer.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) 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 }