From 58b5eef8494a46bf0d84db12fc731341734cb86b Mon Sep 17 00:00:00 2001 From: Lee Jarvis Date: Thu, 19 May 2011 18:20:00 +0100 Subject: [PATCH] no need for explicit "true" -- force true for return value still though --- lib/pry/pry_instance.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 66f96002..a1d6f691 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -402,8 +402,7 @@ class Pry # valid_expression?("class Hello") #=> false # valid_expression?("class Hello; end") #=> true def valid_expression?(code) - RubyParser.new.parse(code) - true + !!RubyParser.new.parse(code) rescue Racc::ParseError, SyntaxError false end