Class: BELParser::Language::Semantics::SemanticsNilNodeWarning

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, expected) ⇒ SemanticsNilNodeWarning

Returns a new instance of SemanticsNilNodeWarning.



10
11
12
13
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 10

def initialize(expression_node, spec, expected)
  super(expression_node, spec)
  @expected_type = expected.ast_type
end

Instance Attribute Details

#expected_typeObject (readonly)

Returns the value of attribute expected_type.



8
9
10
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 8

def expected_type
  @expected_type
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 15

def to_s
  %(Missing the #{@expected_type} type.)
end