class BELParser::Language::Semantics::NonCausalNestedStatement

NonCausalNestedStatement implements a {SemanticsFunction} that maps a nested {BELParser::Parsers::AST::Statement} to {SemanticsWarning} if the relationship is non-causal.

Public Class Methods

map(node, spec, _namespaces, will_match_partial = false) click to toggle source
# File lib/bel_parser/language/semantics/non_causal_nested_statement.rb, line 14
def self.map(node, spec, _namespaces, will_match_partial = false)
  return nil unless node.is_a?(BELParser::Parsers::AST::Statement)
  return nil unless node.object? && node.object.statement?

  rel = node.relationship.string_literal.to_sym
  unless spec.causal_relationships.include?(rel)
    NonCausalNestedStatementWarning.new(node, spec, rel)
  end
end