ruby--ruby/lib/racc/sourcetext.rb

36 lines
539 B
Ruby
Raw Normal View History

#--
2019-05-13 12:25:22 +00:00
#
#
2019-05-13 12:25:22 +00:00
#
# Copyright (c) 1999-2006 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the same terms of ruby.
# see the file "COPYING".
2019-05-13 12:25:22 +00:00
#
#++
2019-05-13 12:25:22 +00: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