Support for the XPath mul/* operator.
This commit is contained in:
1 parent
034b360d13
commit
89686b6cff
2 files changed
+50
No files matched your search
@@ -674,6 +674,22 @@ module Oga
|
||||
return on_call_number(context, left) % on_call_number(context, right)
|
||||
end
|
||||
|
||||
##
|
||||
# Processes the `*` operator.
|
||||
#
|
||||
# This operator converts the left and right expressions to numbers and
|
||||
# multiplies the left number with the right number.
|
||||
#
|
||||
# @param [Oga::XPath::Node] ast_node
|
||||
# @param [Oga::XML::NodeSet] context
|
||||
# @return [Float]
|
||||
#
|
||||
def on_mul(ast_node, context)
|
||||
left, right = *ast_node
|
||||
|
||||
return on_call_number(context, left) * on_call_number(context, right)
|
||||
end
|
||||
|
||||
##
|
||||
# Delegates function calls to specific handlers.
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user