Class: BELParser::Language::Semantics::SemanticVariadicArguments

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

Overview

AST node for VariadicArguments is a semantic AST.

Instance Attribute Summary

Attributes inherited from AST::Node

#children, #hash, #type

Instance Method Summary collapse

Methods inherited from SemanticASTNode

#terminal?

Methods inherited from AST::Node

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

Methods included from Parsers

#serialize

Constructor Details

#initialize(children = [], **properties) ⇒ SemanticVariadicArguments

Returns a new instance of SemanticVariadicArguments.



402
403
404
# File 'lib/bel_parser/language/semantics_ast.rb', line 402

def initialize(children = [], **properties)
  super(:variadic_arguments, children, properties)
end

Instance Method Details

#match(parse_node, spec, will_match_partial = false) ⇒ Object



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/bel_parser/language/semantics_ast.rb', line 406

def match(parse_node, spec, will_match_partial = false)
  return nil_node_warning(
    parse_node,
    spec,
    BELParser::Parsers::AST::Argument) if parse_node.nil?

  if parse_node.type == BELParser::Parsers::AST::Argument.ast_type
    success(parse_node, spec)
  else
    type_warning(
      parse_node,
      spec,
      BELParser::Parsers::AST::Argument,
      parse_node)
  end
end