Remove unneeded read method

This commit is contained in:
Julia Boutin
2025-10-30 12:00:44 +01:00
committed by Guilherme Carreiro
parent ae05ba071c
commit 98fbd985d8
3 changed files with 11 additions and 9 deletions
-8
View File
@@ -12,14 +12,6 @@ module Liquid
@p = point
end
def read(type = nil)
token = @tokens[@p]
if type && token[0] != type
raise SyntaxError, "Expected #{type} but found #{@tokens[@p].first}"
end
token[1]
end
def consume(type = nil)
token = @tokens[@p]
if type && token[0] != type
+1 -1
View File
@@ -113,7 +113,7 @@ module Liquid
return p.consume(:string) if p.look(:string)
return p.consume(:id) if p.look(:id)
found = p.look(:end_of_string) ? "nothing" : p.read
found = p.consume || "nothing"
raise SyntaxError, options[:locale].t("errors.syntax.render_invalid_template_name", found: found)
end