[broken] Throw out builtin bool
This commit is contained in:
parent
9d03c1425e
commit
3eda062c21
1 changed files with 6 additions and 32 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue