rpl code formatting

This commit is contained in:
Gwenhael Le Moine 2022-01-20 11:56:38 +01:00
parent f8c36f9e41
commit 7a97361514
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -67,7 +67,13 @@ module Rpl
# add to a stored variable. ex: 1 'name' sto+ 'name' 2 sto+
def sto_add( stack, dictionary )
stack << { value: '« dup type "name" == « swap » ift over rcl + swap sto »',
stack << { value: '
«
dup type "name" ==
« swap »
ift
over rcl + swap sto
»',
type: :program }
Rpl::Lang::Core.eval( stack, dictionary )
@ -75,7 +81,13 @@ module Rpl
# substract to a stored variable. ex: 1 'name' sto- 'name' 2 sto-
def sto_subtract( stack, dictionary )
stack << { value: '« dup type "name" == « swap » ift over rcl swap - swap sto »',
stack << { value: '
«
dup type "name" ==
« swap »
ift
over rcl swap - swap sto
»',
type: :program }
Rpl::Lang::Core.eval( stack, dictionary )
@ -83,7 +95,13 @@ module Rpl
# multiply a stored variable. ex: 3 'name' sto* 'name' 2 sto*
def sto_multiply( stack, dictionary )
stack << { value: '« dup type "name" == « swap » ift over rcl * swap sto »',
stack << { value: '
«
dup type "name" ==
« swap »
ift
over rcl * swap sto
»',
type: :program }
Rpl::Lang::Core.eval( stack, dictionary )
@ -91,7 +109,13 @@ module Rpl
# divide a stored variable. ex: 3 'name' sto/ 'name' 2 sto/
def sto_divide( stack, dictionary )
stack << { value: '« dup type "name" == « swap » ift over rcl swap / swap sto »',
stack << { value: '
«
dup type "name" ==
« swap »
ift
over rcl swap / swap sto
»',
type: :program }
Rpl::Lang::Core.eval( stack, dictionary )