Support for the XPath "<=" operator.

This commit is contained in:
Yorick Peterse committed 2014-09-01 22:40:50 +02:00
1 parent 6eacf74da4
commit 099227901a
2 files changed
+83

No files matched your search

+17
View File
@@ -786,6 +786,23 @@ module Oga
return on_call_number(context, left) > on_call_number(context, right)
end
##
# Processes the `<=` operator.
#
# This operator converts the left and right expression to a number and
# returns `true` if the first number is lower-than or equal to the second
# number.
#
# @param [Oga::XML::Node] ast_node
# @param [Oga::XML::NodeSet] context
# @return [TrueClass|FalseClass]
#
def on_lte(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.
#