all words expect ( stack, dictionary )

This commit is contained in:
Gwenhael Le Moine 2021-12-08 12:34:12 +01:00
parent 300e061beb
commit e318296e29
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 12 additions and 12 deletions

View file

@ -45,7 +45,7 @@ module Rpl
[stack, args] [stack, args]
end end
def __todo( stack ) def __todo( stack, _dictionary )
puts '__NOT IMPLEMENTED__' puts '__NOT IMPLEMENTED__'
stack stack
end end

View file

@ -6,7 +6,7 @@ module Rpl
module_function module_function
# binary operator > # binary operator >
def greater_than( stack ) def greater_than( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] ) stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] )
stack << { type: :boolean, stack << { type: :boolean,
@ -26,7 +26,7 @@ module Rpl
end end
# binary operator < # binary operator <
def less_than( stack ) def less_than( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] ) stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] )
stack << { type: :boolean, stack << { type: :boolean,
@ -36,7 +36,7 @@ module Rpl
end end
# binary operator <= # binary operator <=
def less_or_equal_than( stack ) def less_or_equal_than( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] ) stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] )
stack << { type: :boolean, stack << { type: :boolean,
@ -46,7 +46,7 @@ module Rpl
end end
# boolean operator != (different) # boolean operator != (different)
def different( stack ) def different( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] ) stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] )
stack << { type: :boolean, stack << { type: :boolean,
@ -56,7 +56,7 @@ module Rpl
end end
# boolean operator and # boolean operator and
def and( stack ) def and( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[boolean], %i[boolean]] ) stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[boolean], %i[boolean]] )
stack << { type: :boolean, stack << { type: :boolean,
@ -66,7 +66,7 @@ module Rpl
end end
# boolean operator or # boolean operator or
def or( stack ) def or( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[boolean], %i[boolean]] ) stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[boolean], %i[boolean]] )
stack << { type: :boolean, stack << { type: :boolean,
@ -76,7 +76,7 @@ module Rpl
end end
# boolean operator xor # boolean operator xor
def xor( stack ) def xor( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[boolean], %i[boolean]] ) stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[boolean], %i[boolean]] )
stack << { type: :boolean, stack << { type: :boolean,
@ -86,7 +86,7 @@ module Rpl
end end
# boolean operator not # boolean operator not
def not( stack ) def not( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[boolean]] ) stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[boolean]] )
stack << { type: :boolean, stack << { type: :boolean,
@ -96,7 +96,7 @@ module Rpl
end end
# boolean operator same (equal) # boolean operator same (equal)
def same( stack ) def same( stack, dictionary )
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] ) stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any any] )
stack << { type: :boolean, stack << { type: :boolean,
@ -106,7 +106,7 @@ module Rpl
end end
# true boolean # true boolean
def true( stack ) def true( stack, dictionary )
stack << { type: :boolean, stack << { type: :boolean,
value: true } value: true }
@ -114,7 +114,7 @@ module Rpl
end end
# false boolean # false boolean
def false( stack ) def false( stack, dictionary )
stack << { type: :boolean, stack << { type: :boolean,
value: false } value: false }