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.
166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/nestedtext/errors_internal.rb', line 166 def initialize(line) char = line.content[0] # Official-tests kludge; Translate rubys \u00 to python's unicodedata.name \x format. printable_char = char.dump.gsub(/"/, '').gsub(/\\u0*/, '\x').downcase explanation = '' # Official-tests kludge; ASCII chars have printable names too, # but they are not used in reference implementation. explanation = " (#{UnicodeUtils.char_name(char)})" unless char.ord < 128 = "invalid character in indentation: '#{printable_char}'#{explanation}." super(line, line.indentation, ) end |