class BELParser::Language::Semantics::SemanticValue

AST node for Value is a semantic AST.

Public Class Methods

new(children = [], **properties) click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 460
def initialize(children = [], **properties)
  super(:value, children, properties)
end

Public Instance Methods

match(parse_node, spec, will_match_partial = false) click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 472
def match(parse_node, spec, will_match_partial = false)
  return nil_node_warning(
    parse_node,
    spec,
    BELParser::Parsers::AST::Value) if parse_node.nil?

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

  value_patterns.map do |pattern|
    pattern.match(parse_node, spec)
  end
end
terminal?() click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 464
def terminal?
  true
end
value_patterns() click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 468
def value_patterns
  children
end