Class: BELParser::Language::Semantics::SemanticsInvalidFunctionWarning

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

Instance Attribute Summary

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_functions) ⇒ SemanticsInvalidFunctionWarning

Returns a new instance of SemanticsInvalidFunctionWarning.



110
111
112
113
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 110

def initialize(expression_node, spec, expected_functions)
  super(expression_node, spec)
  @expected_functions = expected_functions
end

Instance Method Details

#to_sObject



115
116
117
118
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 115

def to_s
  function = @expression_node.string_literal
  %(Function of "#{function}" does not match expected: #{@expected_functions.join(', ')})
end