Class: BELParser::Language::Semantics::SemanticIsNil

Inherits:
SemanticASTNode show all
Defined in:
lib/bel_parser/language/semantics_ast.rb

Overview

AST node for Nil is a semantic AST.

Instance Attribute Summary

Attributes inherited from AST::Node

#children, #hash, #type

Instance Method Summary collapse

Methods inherited from AST::Node

#==, #append, #concat, #dup, #eql?, #inspect, #to_a, #to_ast, #to_sexp, #updated

Constructor Details

#initialize(**properties) ⇒ SemanticIsNil

Returns a new instance of SemanticIsNil.



495
496
497
# File 'lib/bel_parser/language/semantics_ast.rb', line 495

def initialize(**properties)
  super(:is_nil, [], properties)
end

Instance Method Details

#match(parse_node, spec) ⇒ Object



503
504
505
506
507
508
509
# File 'lib/bel_parser/language/semantics_ast.rb', line 503

def match(parse_node, spec)
  if parse_node.nil?
    success(parse_node, spec)
  else
    not_nil_node_warning(parse_node, spec)
  end
end

#terminal?Boolean

Returns:

  • (Boolean)


499
500
501
# File 'lib/bel_parser/language/semantics_ast.rb', line 499

def terminal?
  true
end