Support for the XPath "<=" operator.
This commit is contained in:
1 parent
6eacf74da4
commit
099227901a
2 files changed
+83
No files matched your search
@@ -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.
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user