class BELParser::Language::Semantics::SemanticIsAminoAcidRange

AST node for IsAminoAcidRange is a semantic AST.

Constants

START_STOP
UNDETERMINED
UNKNOWN_START_STOP

Public Class Methods

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

Public Instance Methods

match(value_node, spec, will_match_partial = false) click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 744
def match(value_node, spec, will_match_partial = false)
  ident_or_string = value_node.children[0]
  value =
    case ident_or_string
    when BELParser::Parsers::AST::String
      ident_or_string.string_value
    else
      ident_or_string.string_literal
    end

  case value
  when START_STOP, UNDETERMINED, UNKNOWN_START_STOP
    success(value_node, spec)
  else
    invalid_amino_acid_range_warning(value_node, spec)
  end
end