Sha256: 473f77f302c495332037475bda0c95cbaf4a3f692063fdc526eccd5c5feb15f5
Contents?: true
Size: 663 Bytes
Versions: 13
Compression:
Stored size: 663 Bytes
Contents
module Antlr4::Runtime class CommonTokenFactory include Singleton def initialize(copy_text = false) @copy_text = false @copy_text = copy_text end def create(source, type, text, channel, start, stop, line, char_position_in_line) t = CommonToken.create1(source, type, channel, start, stop) t.line = line t.char_position_in_line = char_position_in_line if !text.nil? t._text = text elsif @copy_text && !source.b.nil? t.set_text(source.b.text(Interval.of(start, stop))) end t end def create_simple(type, text) CommonToken.create2(type, text) end end end
Version data entries
13 entries across 13 versions & 1 rubygems