Class: LibRubyParser::DecodedInput

Inherits:
Object
  • Object
show all
Defined in:
lib/lib-ruby-parser.rb

Overview

Input decoded by parser.

If your code has magic encoding comment LibRubyParser re-encodes given input and (potentially) operates on a different byte sequence.

This is why this input should be used to get source of all locations.

Using initial input is wrong as you may get a different source range in a different byte representation.

Instance Attribute Summary collapse

Instance Attribute Details

#bytesString

Re-encoded input string

Returns:

  • (String)


191
192
193
# File 'lib/lib-ruby-parser.rb', line 191

def bytes
  @bytes
end

#linesArray<SourceLine>

Array of source lines

Returns:



186
187
188
# File 'lib/lib-ruby-parser.rb', line 186

def lines
  @lines
end

#nameString

Name of the initial input

Returns:

  • (String)


181
182
183
# File 'lib/lib-ruby-parser.rb', line 181

def name
  @name
end