optimize eval and fix it for :list

This commit is contained in:
Gwenhael Le Moine 2022-02-17 15:21:24 +01:00
parent f4fa29da5c
commit 0ad027a6b6
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -12,7 +12,11 @@ module RplLang
proc do
args = stack_extract( [:any] )
run( args[0][:value].to_s )
if %i[list string numeric boolean].include?( args[0][:type] )
@stack << args[0] # these types evaluate to themselves
else
run( args[0][:value].to_s )
end
end )
end
end