Class: BELParser::Language::Semantics::DeeplyNestedStatementWarning
- Inherits:
-
SemanticsWarning
- Object
- SemanticsResult
- SemanticsWarning
- BELParser::Language::Semantics::DeeplyNestedStatementWarning
- Defined in:
- lib/bel_parser/language/semantics/deeply_nested_statement.rb
Overview
DeeplyNestedStatementWarning defines a SemanticsWarning that indicates the nested statement threshold was exceeded.
Instance Attribute Summary collapse
-
#nested_number ⇒ Object
readonly
Returns the value of attribute nested_number.
-
#nested_threshold ⇒ Object
readonly
Returns the value of attribute nested_threshold.
Attributes inherited from SemanticsResult
#expression_node, #specification
Instance Method Summary collapse
-
#initialize(stmt_node, spec, nested_threshold, nested_number) ⇒ DeeplyNestedStatementWarning
constructor
A new instance of DeeplyNestedStatementWarning.
- #to_s ⇒ Object
Methods inherited from SemanticsWarning
Methods inherited from SemanticsResult
Constructor Details
#initialize(stmt_node, spec, nested_threshold, nested_number) ⇒ DeeplyNestedStatementWarning
Returns a new instance of DeeplyNestedStatementWarning.
50 51 52 53 54 |
# File 'lib/bel_parser/language/semantics/deeply_nested_statement.rb', line 50 def initialize(stmt_node, spec, nested_threshold, nested_number) super(stmt_node, spec) @nested_number = nested_number @nested_threshold = nested_threshold end |
Instance Attribute Details
#nested_number ⇒ Object (readonly)
Returns the value of attribute nested_number.
48 49 50 |
# File 'lib/bel_parser/language/semantics/deeply_nested_statement.rb', line 48 def nested_number @nested_number end |
#nested_threshold ⇒ Object (readonly)
Returns the value of attribute nested_threshold.
48 49 50 |
# File 'lib/bel_parser/language/semantics/deeply_nested_statement.rb', line 48 def nested_threshold @nested_threshold end |
Instance Method Details
#to_s ⇒ Object
56 57 58 59 60 61 |
# File 'lib/bel_parser/language/semantics/deeply_nested_statement.rb', line 56 def to_s <<-MSG.gsub(/ {12}/, '').delete("\n") Statement contains more than #{nested_threshold} nested statements (#{nested_number} nested statements). MSG end |