This commit is contained in:
2025-10-02 12:51:15 +10:00
parent cd7f9a6a2a
commit d7123aff1e
5 changed files with 26 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ InstructionType strToInstructionType(std::string in) {
else if (in == "while") return InstructionType::While;
else if (in == "compare") return InstructionType::Compare;
else if (in == "input") return InstructionType::Input;
else if (in == "return") return InstructionType::Return;
else return InstructionType::Variable;
}

View File

@@ -6,7 +6,7 @@
enum class InstructionType {
None, Print, Println, Math, Let, Variable, Exit, If, While, Input, Compare, Function
None, Print, Println, Math, Let, Variable, Exit, If, While, Input, Compare, Function, Return
};
enum class ValueType {
@@ -33,6 +33,7 @@ struct Value {
std::unique_ptr<Instruction> processed;
std::string real = "";
InstructionGroup instructionGroup;
bool is_return = false;
std::string toString() const;
Varname varName = Varname();
Value(std::string stringval);