[broken] Throw out builtin bool

This commit is contained in:
Reid 'arrdem' McKenzie 2022-06-15 23:10:54 -06:00
parent d2d6840bad
commit 7fe052e7fc

View file

@ -5,37 +5,7 @@ import typing as t
class Opcode: class Opcode:
#################################################################################################### # Note that there's no IF, TRUE or FALSE required if bool is a builtin.
# Logic
####################################################################################################
# FIXME: This should become an instantiation of the BOOL enum
class TRUE(t.NamedTuple):
"""() -> (bool)
Push the constant TRUE onto the stack.
"""
# FIXME: This should become an instantiation of the BOOL enum
class FALSE(t.NamedTuple):
"""() -> (bool)
Push the constant FALSE onto the stack.
"""
# FIXME: This should become a `VTEST` macro ... or may be replaceable
class IF(t.NamedTuple):
"""(bool) -> ()
Branch to another point if the top item of the stack is TRUE. Otherwise fall through.
"""
target: int
# not, and, or, xor etc. can all be functions given if.
class GOTO(t.NamedTuple): class GOTO(t.NamedTuple):
"""() -> () """() -> ()
@ -211,12 +181,16 @@ class Opcode:
nargs: int = 0 nargs: int = 0
class VTEST(t.NamedTuple): class VTEST(t.NamedTuple):
"""(VARIANTREF<a ⊢ A ⊂ B>, B) -> (bool) """(VARIANTREF<a ⊢ A ⊂ B>, B) -> ()
Test whether B is a given arm of a variant A . Test whether B is a given arm of a variant A .
If it is, branch to the given target.
Otherwise fall through.
""" """
target: int
class VLOAD(t.NamedTuple): class VLOAD(t.NamedTuple):
"""(VARIANTREF<a ⊢ A ⊂ B>, B) -> (A) """(VARIANTREF<a ⊢ A ⊂ B>, B) -> (A)