trim "" from strings before use
This commit is contained in:
parent
5d4c978c76
commit
6b57d03627
1 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ module Rpl
|
||||||
def from_string( stack, dictionary )
|
def from_string( stack, dictionary )
|
||||||
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[string]] )
|
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[string]] )
|
||||||
|
|
||||||
parsed_input = Rpl::Lang::Parser.new.parse_input( args[0][:value] )
|
parsed_input = Rpl::Lang::Parser.new.parse_input( args[0][:value][1..-2] )
|
||||||
|
|
||||||
stack += parsed_input
|
stack += parsed_input
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ module Rpl
|
||||||
|
|
||||||
stack << { type: :numeric,
|
stack << { type: :numeric,
|
||||||
base: 10,
|
base: 10,
|
||||||
value: args[0][:value].ord }
|
value: args[0][:value][1..-2].ord }
|
||||||
|
|
||||||
[stack, dictionary]
|
[stack, dictionary]
|
||||||
end
|
end
|
||||||
|
@ -53,7 +53,7 @@ module Rpl
|
||||||
|
|
||||||
stack << { type: :numeric,
|
stack << { type: :numeric,
|
||||||
base: 10,
|
base: 10,
|
||||||
value: args[0][:value].length }
|
value: args[0][:value][1..-2].length }
|
||||||
|
|
||||||
[stack, dictionary]
|
[stack, dictionary]
|
||||||
end
|
end
|
||||||
|
@ -64,7 +64,7 @@ module Rpl
|
||||||
|
|
||||||
stack << { type: :numeric,
|
stack << { type: :numeric,
|
||||||
base: 10,
|
base: 10,
|
||||||
value: args[1][:value].index( args[0][:value] ) }
|
value: args[1][:value][1..-2].index( args[0][:value][1..-2] ) }
|
||||||
|
|
||||||
[stack, dictionary]
|
[stack, dictionary]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue