lang: Rename boolean "Not" to "Invert"

This commit is contained in:
Jookia 2023-08-29 23:15:34 +10:00
parent 7b462e5408
commit 6297541e91
2 changed files with 6 additions and 6 deletions

View file

@ -30,17 +30,17 @@ bool boolean_value(Object obj) {
return boolean->value;
}
static void boolean_not(VmState state, Object obj, void *priv) {
static void boolean_invert(VmState state, Object obj, void *priv) {
(void)priv;
int arg_count = vm_stack_depth(state);
abort_if(arg_count != 1, "boolean_not called with extra arguments");
abort_if(arg_count != 1, "boolean_invert called with extra arguments");
bool value = boolean_value(obj);
bool not = !value;
vm_stack_set(state, 0, boolean_create(not ));
bool invert = !value;
vm_stack_set(state, 0, boolean_create(invert ));
}
static struct object_call calls[] = {
{.name = "Not", .handler = boolean_not, .priv = NULL},
{.name = "Invert", .handler = boolean_invert, .priv = NULL},
{.name = NULL, /* end */}};
static struct object_class boolean_class = {

View file

@ -1,6 +1,6 @@
Function BoolTest
Set A To True
Set B To A Not
Set B To A Invert
Return B
EndFunction
Function NoneTest