class SyntaxTree::Parser::SingleByteString

Represents a line in the source. If this class is being used, it means that every character in the string is 1 byte in length, so we can just return the start of the line + the index.

Attributes

start[R]

Public Class Methods

new(start) click to toggle source
# File lib/syntax_tree/parser.rb, line 25
def initialize(start)
  @start = start
end

Public Instance Methods

[](byteindex) click to toggle source
# File lib/syntax_tree/parser.rb, line 29
def [](byteindex)
  start + byteindex
end