File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,16 @@ def eval_binding
58
58
end
59
59
60
60
def eval ( code , store_history )
61
- if Gem ::Version . new ( IRB ::VERSION ) < Gem ::Version . new ( '1.13.0' )
62
- @irb . context . evaluate ( code , 0 )
63
- else
64
- @irb . context . evaluate ( @irb . build_statement ( code ) , 0 )
65
- end
61
+ @irb . context . evaluate ( parse_code ( code ) , 0 )
66
62
@irb . context . last_value unless IRuby . silent_assignment && assignment_expression? ( code )
67
63
end
68
64
65
+ def parse_code ( code )
66
+ return code if Gem ::Version . new ( IRB ::VERSION ) < Gem ::Version . new ( '1.13.0' )
67
+ return @irb . parse_input ( code ) if @irb . respond_to? ( :parse_input )
68
+ return @irb . build_statement ( code ) if @irb . respond_to? ( :build_statement )
69
+ end
70
+
69
71
def complete ( code )
70
72
if @completor
71
73
# preposing and postposing never used, so they are empty, pass only target as code
You can’t perform that action at this time.
0 commit comments