Class: BELParser::Language::Semantics::NonCausalNestedStatement
- Inherits:
-
Object
- Object
- BELParser::Language::Semantics::NonCausalNestedStatement
- Includes:
- SemanticsFunction
- Defined in:
- lib/bel_parser/language/semantics/non_causal_nested_statement.rb
Overview
NonCausalNestedStatement implements a SemanticsFunction that maps a nested Parsers::AST::Statement to SemanticsWarning if the relationship is non-causal.
Class Method Summary collapse
Class Method Details
.map(node, spec, _namespaces) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/bel_parser/language/semantics/non_causal_nested_statement.rb', line 14 def self.map(node, spec, _namespaces) 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 |