allow leading and closing empty lines and spaces before delimiters in

string and programs
This commit is contained in:
Gwenhael Le Moine 2022-01-18 22:29:29 +01:00
parent 3e53cb9715
commit de89407e41
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -11,8 +11,8 @@ module Rpl
# we trim enclosing characters if necessary
preparsed_input = args[0][:value]
preparsed_input = preparsed_input.gsub( '\n', ' ' ).strip if %i[string program].include?( args[0][:type] )
preparsed_input = preparsed_input[1..-2] if %i[string name program].include?( args[0][:type] )
preparsed_input.gsub!( '\n', ' ' ) if %i[string program].include?( args[0][:type] )
parsed_input = Rpl::Lang::Parser.new.parse_input( preparsed_input.to_s )
stack, dictionary = Rpl::Lang::Runner.new.run_input( parsed_input,