Module: RubyBreaker::Runtime::TypeSigParser

Defined in:
lib/rubybreaker/runtime/typesig_parser.rb

Constant Summary collapse

PARSER =
TypeGrammarParser.new

Class Method Summary collapse

Class Method Details

.parse(str) ⇒ Object

This is a simple redirecting method for parsing type signature. The only special thing about this method is that, if there are multiple lines in the signature, it will look at each line and construct a MethodListType to represent the intersection type.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rubybreaker/runtime/typesig_parser.rb', line 23

def self.parse(str)

  meth_types = []
  
  # Get caller information and set the global location 
  my_caller = caller[1]
  if my_caller
    file,line,junk = my_caller.split(":")
    Position.set(file,line,-1)
  end

  return PARSER.parse(str).value
  
rescue => e
  
  puts e
  
end