Expressions #7

Merged
andre merged 21 commits from vm2 into master 2026-05-02 15:07:12 -05:00
5 changed files with 4 additions and 3 deletions
Showing only changes of commit 9e6d9c6212 - Show all commits

2
.idea/tyche.iml generated
View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CIDR" type="CPP_MODULE" version="4" />

View File

@@ -70,7 +70,7 @@ ByteArray Assembler::assemble()
case vm::OperandType::Int8: bp.functions.at(function_id).code.append_int8((int8_t) *oper); break; case vm::OperandType::Int8: bp.functions.at(function_id).code.append_int8((int8_t) *oper); break;
case vm::OperandType::Int16: bp.functions.at(function_id).code.append_int16((int16_t) *oper); break; case vm::OperandType::Int16: bp.functions.at(function_id).code.append_int16((int16_t) *oper); break;
case vm::OperandType::Int32: bp.functions.at(function_id).code.append_int32(*oper); break; case vm::OperandType::Int32: bp.functions.at(function_id).code.append_int32(*oper); break;
case vm::OperandType::NoOperand: default: case vm::OperandType::NoOperand: default: break;
} }
if (tt.type != TokenType::Enter) if (tt.type != TokenType::Enter)

View File

@@ -45,6 +45,7 @@ Operation Code::operation(Location const& location) const
.next_location = { .function_id = location.function_id, .pc = location.pc + 5 }, .next_location = { .function_id = location.function_id, .pc = location.pc + 5 },
}; };
default: default:
break;
} }
throw std::logic_error("Should not get here"); throw std::logic_error("Should not get here");

View File

@@ -187,6 +187,7 @@ std::pair<std::string, size_t> debug_instruction(bc::Bytecode const& bt, uint32_
case OperandType::Int32: case OperandType::Int32:
return debug_instruction(inst, bt.get_code_int32(function_id, addr + 1)); return debug_instruction(inst, bt.get_code_int32(function_id, addr + 1));
default: default:
break;
} }
return { "???", 1 }; return { "???", 1 };

View File

@@ -1,6 +1,7 @@
#ifndef TYCHE_VALUE_HH #ifndef TYCHE_VALUE_HH
#define TYCHE_VALUE_HH #define TYCHE_VALUE_HH
#include <cstdint>
#include <string> #include <string>
#include <variant> #include <variant>