Class: BELParser::Language::Semantics::SemanticsNotNilNodeWarning

Inherits:
SemanticsWarning show all
Defined in:
lib/bel_parser/language/semantics_ast_warnings.rb

Instance Attribute Summary collapse

Attributes inherited from SemanticsResult

#expression_node, #specification

Instance Method Summary collapse

Methods inherited from SemanticsWarning

#failure?, #success?

Methods inherited from SemanticsResult

#failure?, #msg, #success?

Constructor Details

#initialize(expression_node, spec) ⇒ SemanticsNotNilNodeWarning

Returns a new instance of SemanticsNotNilNodeWarning.



23
24
25
26
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 23

def initialize(expression_node, spec)
  super(expression_node, spec)
  @actual_type = expression_node.type
end

Instance Attribute Details

#actual_typeObject (readonly)

Returns the value of attribute actual_type.



21
22
23
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 21

def actual_type
  @actual_type
end

Instance Method Details

#to_sObject



28
29
30
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 28

def to_s
  %(Expected nothing, but saw #{actual_type} type.)
end