Class: BELParser::Language::Semantics::SemanticHasNamespace

Inherits:
SemanticASTNode show all
Defined in:
lib/bel_parser/language/semantics_ast.rb

Overview

AST node for HasNamespace is a semantic AST.

Instance Attribute Summary

Attributes inherited from AST::Node

#children, #hash, #type

Instance Method Summary collapse

Methods inherited from SemanticASTNode

#terminal?

Methods inherited from AST::Node

#==, #append, #concat, #dup, #eql?, #inspect, #to_a, #to_ast, #to_sexp, #updated

Constructor Details

#initialize(**properties) ⇒ SemanticHasNamespace

Returns a new instance of SemanticHasNamespace.



557
558
559
# File 'lib/bel_parser/language/semantics_ast.rb', line 557

def initialize(**properties)
  super(:has_namespace, [], properties)
end

Instance Method Details

#match(prefix, spec) ⇒ Object



561
562
563
564
565
566
567
# File 'lib/bel_parser/language/semantics_ast.rb', line 561

def match(prefix, spec)
  if prefix.respond_to?(:namespace) && prefix.namespace
    success(prefix, spec)
  else
    missing_namespace_warning(prefix, spec)
  end
end