This class represents a position of the type acquired from either the type signature or code during runtime. It can also be used for internal error checking or debuging purpose.
This class method is a utility function to convert a string in the caller() array.
# File lib/rubybreaker/debug/context.rb, line 49 def self.convert_caller_to_pos(caller_ary, idx=0) tokens = caller_ary[idx].split(":") return self.new(tokens[0],tokens[1],-1,tokens[2]) # no col end
This class method returns a new position object for the current parsing position.
# File lib/rubybreaker/debug/context.rb, line 43 def self.get() return Position.new(@@file,@@line,@@col) end
# File lib/rubybreaker/debug/context.rb, line 23 def initialize(file="",line=-1,col=-1,meth="") @file = file @line = line @col = col @method = meth end
This class method is to set the current parsing position.
# File lib/rubybreaker/debug/context.rb, line 35 def self.set(file,line,col) @@file = file @@line = line @@col = col end
# File lib/rubybreaker/debug/context.rb, line 30 def to_s() return "#{@file}:(#{@line},#{@col}):in #{@method}" end