Prefix compiler predicate methods with on_
This commit is contained in:
parent
bea7e19d57
commit
53c142ca26
|
@ -195,9 +195,9 @@ module Oga
|
||||||
test, predicate = *ast
|
test, predicate = *ast
|
||||||
|
|
||||||
if number?(predicate)
|
if number?(predicate)
|
||||||
index_predicate(test, predicate, input, &block)
|
on_index_predicate(test, predicate, input, &block)
|
||||||
else
|
else
|
||||||
expression_predicate(test, predicate, input, &block)
|
on_expression_predicate(test, predicate, input, &block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ module Oga
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
#
|
||||||
def index_predicate(test, predicate, input)
|
def on_index_predicate(test, predicate, input)
|
||||||
int1 = literal('1')
|
int1 = literal('1')
|
||||||
index = to_int(predicate)
|
index = to_int(predicate)
|
||||||
index_var = literal('index')
|
index_var = literal('index')
|
||||||
|
@ -245,7 +245,7 @@ module Oga
|
||||||
# @param [Oga::Ruby::Node] input
|
# @param [Oga::Ruby::Node] input
|
||||||
# @return [Oga::Ruby::Node]
|
# @return [Oga::Ruby::Node]
|
||||||
#
|
#
|
||||||
def expression_predicate(test, predicate, input)
|
def on_expression_predicate(test, predicate, input)
|
||||||
catch_arg = symbol(:predicate_matched)
|
catch_arg = symbol(:predicate_matched)
|
||||||
|
|
||||||
process(test, input) do |matched_test_node|
|
process(test, input) do |matched_test_node|
|
||||||
|
|
Loading…
Reference in New Issue