Exception: NestedText::Errors::ParseInvalidIndentationCharError
- Inherits:
-
ParseError
- Object
- StandardError
- NestedText::Error
- InternalError
- ParseError
- NestedText::Errors::ParseInvalidIndentationCharError
- Defined in:
- lib/nestedtext/errors_internal.rb
Instance Attribute Summary
Attributes inherited from ParseError
Instance Method Summary collapse
-
#initialize(line) ⇒ ParseInvalidIndentationCharError
constructor
A new instance of ParseInvalidIndentationCharError.
Constructor Details
#initialize(line) ⇒ ParseInvalidIndentationCharError
Returns a new instance of ParseInvalidIndentationCharError.
164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/nestedtext/errors_internal.rb', line 164 def initialize(line) printable_char = line.content[0].dump.gsub(/"/, '') # Looking for non-breaking space is just to be compatible with official tests. explanation = '' if printable_char == '\\u00A0' printable_char = '\\xa0' explanation = ' (NO-BREAK SPACE)' end = "invalid character in indentation: '#{printable_char}'#{explanation}." super(line, line.indentation, ) end |