diff --git a/src/execute.c b/src/execute.c index 35bd391..b7ee263 100644 --- a/src/execute.c +++ b/src/execute.c @@ -27,11 +27,11 @@ typedef enum static void prefix_operator(Stack *stack, char op) { - // if (NAME[0] != '@' && (NAME[1] == '\0' || NAME[1] == '\n')) - // { - // printf("%c\n", op); - // kms(stack, "Invalid usage of prefix operators"); - // } + if (NAME[0] != '@' && (NAME[1] == '\0' || NAME[1] == '\n')) + { + printf("%c\n", op); + kms(stack, "Invalid usage of prefix operators"); + } switch (op) { diff --git a/tests/test.lb b/tests/test.lb new file mode 100644 index 0000000..a66f1b4 --- /dev/null +++ b/tests/test.lb @@ -0,0 +1,18 @@ +; Лабашки ооп + + +@ 4441 ; Класс + + @ 4442 ; Поле + сеттер + |field + |jmp 0 + + @ 4443 ; Поле + сеттер + |field + |jmp 0 + + @ 44411 ; Метод + push 444111 ; Метка для возвращения + push 2 + jmp 4442 + @ 444111 ; ^^^ \ No newline at end of file