XPath compiler support for not()

This commit is contained in:
Yorick Peterse 2015-08-18 14:27:38 +02:00
parent 2585fbd0b7
commit 43dab548e9
1 changed files with 12 additions and 0 deletions

View File

@ -914,6 +914,18 @@ module Oga
end
end
# @param [Oga::Ruby::Node] input
# @param [AST::Node] arg
# @return [Oga::Ruby::Node]
def on_call_not(input, arg)
arg_ast = try_match_first_node(arg, input)
call_arg = unique_literal(:call_arg)
conversion = literal(Conversion)
call_arg.assign(arg_ast)
.followed_by(conversion.to_boolean(call_arg).not)
end
##
# Delegates type tests to specific handlers.
#