Exception: NestedText::Errors::InvalidIndentationChar
- Inherits:
-
ParseError
- Object
- StandardError
- NestedText::Error
- InternalError
- ParseError
- NestedText::Errors::InvalidIndentationChar
- Defined in:
- lib/nestedtext/errors.rb
Instance Attribute Summary
Attributes inherited from ParseError
Instance Method Summary collapse
-
#initialize(line) ⇒ InvalidIndentationChar
constructor
A new instance of InvalidIndentationChar.
Constructor Details
#initialize(line) ⇒ InvalidIndentationChar
Returns a new instance of InvalidIndentationChar.
153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/nestedtext/errors.rb', line 153 def initialize(line) printable_char = line.content[0].dump.gsub(/"/, "") # Looking for non-breaking space is just to be compatialbe 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 |