Fixed logical AND and OR operators, read more

The definition of '&&':
  Return the first falsy value, or the last value, skipping the evaluation of other operands.

The definition of '||':
  Return the first truthy value, or the last value, skipping the evaluation of other operands.

Toy now follows these definitions.

Fixed #154
This commit is contained in:
2024-12-26 16:09:16 +11:00
parent 153ab54be6
commit cc4ff3f6d8
11 changed files with 279 additions and 40 deletions

View File

@@ -11,6 +11,7 @@ typedef enum Toy_OpcodeType {
TOY_OPCODE_ASSIGN_COMPOUND, //assign to a compound's internals
TOY_OPCODE_ACCESS,
TOY_OPCODE_DUPLICATE, //duplicate the top of the stack
TOY_OPCODE_ELIMINATE, //remove the top of the stack
//arithmetic instructions
TOY_OPCODE_ADD,