Exception: NestedText::Errors::ParseInvalidIndentationError
- Inherits:
-
ParseError
- Object
- StandardError
- NestedText::Error
- InternalError
- ParseError
- NestedText::Errors::ParseInvalidIndentationError
- Defined in:
- lib/nestedtext/errors_internal.rb
Instance Attribute Summary
Attributes inherited from ParseError
Instance Method Summary collapse
-
#initialize(line, ind_exp) ⇒ ParseInvalidIndentationError
constructor
A new instance of ParseInvalidIndentationError.
Constructor Details
#initialize(line, ind_exp) ⇒ ParseInvalidIndentationError
Returns a new instance of ParseInvalidIndentationError.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/nestedtext/errors_internal.rb', line 114 def initialize(line, ind_exp) prev_line = line.prev if prev_line.nil? && ind_exp == 0 = "top-level content must start in column 1." elsif !prev_line.nil? && prev_line.attribs.key?("value") && prev_line.indentation < line.indentation && i[dict_item list_item].member?(prev_line.tag) = "invalid indentation." elsif !prev_line.nil? && line.indentation < prev_line.indentation # Can't use ind_exp here, because it's a difference if the previous line was further indented. See test_load_error_dict_10 = "invalid indentation, partial dedent." else = "invalid indentation." end # Need to wrap like official tests. #wrap always add an extra \n we need to chop off. = .wrap(70).chop super(line, ind_exp, ) end |