2020-01-28 09:00:13 -05:00
|
|
|
#--
|
2019-05-13 08:25:22 -04:00
|
|
|
#
|
2020-02-26 23:33:51 -05:00
|
|
|
#
|
2019-05-13 08:25:22 -04:00
|
|
|
#
|
|
|
|
# Copyright (c) 1999-2006 Minero Aoki
|
|
|
|
#
|
|
|
|
# This program is free software.
|
|
|
|
# You can distribute/modify this program under the terms of
|
|
|
|
# the GNU LGPL, Lesser General Public License version 2.1.
|
|
|
|
# For details of LGPL, see the file "COPYING".
|
|
|
|
#
|
2020-01-28 09:00:13 -05:00
|
|
|
#++
|
2019-05-13 08:25:22 -04:00
|
|
|
|
|
|
|
module Racc
|
|
|
|
|
|
|
|
class SourceText
|
|
|
|
def initialize(text, filename, lineno)
|
|
|
|
@text = text
|
|
|
|
@filename = filename
|
|
|
|
@lineno = lineno
|
|
|
|
end
|
|
|
|
|
|
|
|
attr_reader :text
|
|
|
|
attr_reader :filename
|
|
|
|
attr_reader :lineno
|
|
|
|
|
|
|
|
def to_s
|
|
|
|
"#<SourceText #{location()}>"
|
|
|
|
end
|
|
|
|
|
|
|
|
def location
|
|
|
|
"#{@filename}:#{@lineno}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|