Sha256: a77c77c2fbd4aa57f83bd9efea4821c38a937ec8f7cb801c15f4afa98b871e65
Contents?: true
Size: 673 Bytes
Versions: 2
Compression:
Stored size: 673 Bytes
Contents
# frozen_string_literal: true class Language class Parser class Interuption < StandardError def initialize(parser, atom = Atom.new) @parser = parser @atom = atom end def message "\n#{line}#{" " * column_index}^\n" end def line l = input.lines[line_index] l += "\n" if l[-1] != "\n" l end def line_index input[...cursor].count("\n") end def column_index cursor - input.lines[...line_index].sum(&:size) end private def cursor @parser.cursor end def input @parser.input end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
language-ruby-1.1.2 | lib/language/parser/interuption.rb |
language-ruby-1.1.0 | lib/language/parser/interuption.rb |