Class: BELParser::Language::Semantics::SemanticArgument

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

Overview

AST node for Argument 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_sexp, #updated

Constructor Details

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

Returns a new instance of SemanticArgument.



379
380
381
# File 'lib/bel_parser/language/semantics_ast.rb', line 379

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

Instance Method Details

#match(parse_node, spec) ⇒ Object



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/bel_parser/language/semantics_ast.rb', line 383

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

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