# File lib/pry/pry_instance.rb, line 604 def complete_expression?(str) if defined?(Rubinius::Melbourne19) && RUBY_VERSION =~ /^1\.9/ Rubinius::Melbourne19.parse_string(str, Pry.eval_path) elsif defined?(Rubinius::Melbourne) Rubinius::Melbourne.parse_string(str, Pry.eval_path) else catch(:valid) do Helpers::BaseHelpers.silence_warnings do eval("BEGIN{throw :valid}\n#{str}", binding, Pry.eval_path) end end end # Assert that a line which ends with a , is incomplete. str !~ /[,]\z/ rescue SyntaxError => e if incomplete_user_input_exception?(e) false else raise e end end