class BELParser::Language::Semantics::NestedStatementWithoutObject
NestedStatementWithoutObject
implements a {SemanticsFunction} that maps a nested {BELParser::Parsers::AST::Statement} to {SemanticsWarning} if the nested statement does not have an object.
Public Class Methods
map(node, spec, _namespacesi, will_match_partial = false)
click to toggle source
# File lib/bel_parser/language/semantics/nested_statement_without_object.rb, line 14 def self.map(node, spec, _namespacesi, will_match_partial = false) return nil unless node.is_a?(BELParser::Parsers::AST::Statement) return nil unless node.object? && node.object.statement? nested = node.object.child unless nested.object? NestedStatementWithoutObjectWarning.new(node, spec) end end