@@ -73,17 +73,9 @@ def new_block_body
73
73
74
74
alias_method :ruby_new_tokenizer , :new_tokenizer
75
75
def new_tokenizer ( source , start_line_number : nil , for_liquid_tag : false )
76
- unless liquid_c_nodes_disabled?
77
- source = source . to_s . to_str
78
- if source . bytesize <= Liquid ::C ::Tokenizer ::MAX_SOURCE_BYTE_SIZE
79
- source = source . encode ( Encoding ::UTF_8 )
80
- return Liquid ::C ::Tokenizer . new ( source , start_line_number || 0 , for_liquid_tag )
81
- else
82
- @liquid_c_nodes_disabled = true
83
- end
84
- end
85
-
86
- ruby_new_tokenizer ( source , start_line_number : start_line_number , for_liquid_tag : for_liquid_tag )
76
+ source = source . to_s . to_str
77
+ source = source . encode ( Encoding ::UTF_8 )
78
+ Liquid ::C ::Tokenizer . new ( source , start_line_number || 0 , for_liquid_tag )
87
79
end
88
80
89
81
def parse_expression ( markup )
@@ -96,15 +88,7 @@ def parse_expression(markup)
96
88
97
89
# @api private
98
90
def liquid_c_nodes_disabled?
99
- # Liquid::Profiler exposes the internal parse tree that we don't want to build when
100
- # parsing with liquid-c, so consider liquid-c to be disabled when using it.
101
- # Also, some templates are parsed before the profiler is running, on which case we
102
- # provide the `disable_liquid_c_nodes` option to enable the Ruby AST to be produced
103
- # so the profiler can use it on future runs.
104
- return @liquid_c_nodes_disabled if defined? ( @liquid_c_nodes_disabled )
105
-
106
- @liquid_c_nodes_disabled = !Liquid ::C . enabled || @template_options [ :profile ] ||
107
- @template_options [ :disable_liquid_c_nodes ] || self . class . liquid_c_nodes_disabled
91
+ false
108
92
end
109
93
end
110
94
0 commit comments