Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Commit

Permalink
added IsAminoAcidRange; refs OpenBEL/language#9
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Bargnesi committed Apr 4, 2016
1 parent 7a805dc commit 86292c6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/bel/language/semantic_ast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ def amino_acid_of(*amino_acids, **properties)
SemanticAminoAcidOf.new(amino_acids, **properties)
end

def is_amino_acid_range_pattern(**properties)
SemanticIsAminoAcidRange.new(**properties)
end

def variadic_arguments(*params_or_terms, **properties)
SemanticVariadicArguments.new(params_or_terms, **properties)
end
Expand Down Expand Up @@ -563,6 +567,20 @@ def match(value_type, _)
end
end
end

# AST node for IsAminoAcidRange is a semantic AST.
class SemanticIsAminoAcidRange < SemanticASTNode
def initialize(**properties)
super(:is_amino_acid_range, [], properties)
end

def match(string, _)
string_literal = string.children[0]

# TODO: Check string_literal against patterns
success(string)
end
end
end
end
end

0 comments on commit 86292c6

Please sign in to comment.