lib/sdl4r/parser/token.rb in sdl4r-0.9.6 vs lib/sdl4r/parser/token.rb in sdl4r-0.9.7
- old
+ new
@@ -31,11 +31,11 @@
class Token # :nodoc: all
def initialize(text, line = -1, position = -1)
@text = text
@line = line
- @pos = position
+ @position = position
@size = text.length
begin
@type = nil
@object = nil
@@ -90,11 +90,11 @@
@type = :SEMICOLON
end
end
rescue ArgumentError
- raise SdlParseError.new($!.message, @line, @pos)
+ raise SdlParseError.new($!.message, @line, @position)
end
@type = :IDENTIFIER if @type.nil? # if all hope is lost, it's an identifier
@punctuation =
@@ -114,10 +114,10 @@
def object_for_literal
return @object
end
def to_s
- @type.to_s + " " + @text + " pos:" + @pos.to_s
+ @type.to_s + " " + @text + " pos:" + @position.to_s
end
# This special parse method is used only by the Token class for
# tokens which are ambiguously either a TimeSpan or the time component
# of a date/time type