Method: BELParser::Language::Semantics::SemanticIdentifier#match

Defined in:
lib/bel_parser/language/semantics_ast.rb

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



525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
# File 'lib/bel_parser/language/semantics_ast.rb', line 525

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

  if identifier.type != BELParser::Parsers::AST::Identifier.ast_type
    return type_warning(
      identifier,
      spec,
      BELParser::Parsers::AST::Identifier,
      identifier)
  end

  value_patterns.map { |pattern| pattern.match(identifier, spec) }
end