# File lib/proc_source.rb, line 134
134:   def self.line_has_open?(str)
135:     return true unless RUBY_VERSION >= '1.9'
136:     lexer = RubyLex.new
137:     lexer.set_input(StringIO.new(str))
138:     success = false
139:     while token = lexer.token
140:       case token
141:       when RubyToken::TkNL
142:         break
143:       when RubyToken::TkDO
144:         success = true
145:       when RubyToken::TkfLBRACE
146:         success = true
147:       when RubyToken::TkCONSTANT
148:         if token.name == "Proc" &&
149:            lexer.token.is_a?(RubyToken::TkDOT)
150:           method = lexer.token
151:           if method.is_a?(RubyToken::TkIDENTIFIER) &&
152:              method.name == "new"
153:             success = true
154:           end
155:         end
156:       end
157:     end
158:     success
159:   end