Class: BELParser::Language::Semantics::ListFunctionSubjectWarning

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

Overview

ListFunctionSubjectWarning defines a SemanticsWarning that indicates that a list Parsers::AST::Term was used as the Parsers::AST::Subject of a Parsers::AST::Statement.

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(subject_node, spec) ⇒ ListFunctionSubjectWarning

Returns a new instance of ListFunctionSubjectWarning.



35
36
37
# File 'lib/bel_parser/language/semantics/list_function_subject.rb', line 35

def initialize(subject_node, spec)
  super(subject_node, spec)
end

Instance Method Details

#to_sObject



39
40
41
42
43
# File 'lib/bel_parser/language/semantics/list_function_subject.rb', line 39

def to_s
  <<-MSG.gsub(/ {12}/, '').delete("\n")
    List term is only valid in the Object of a Statement.
  MSG
end