chore: include filename for static variables

This commit is contained in:
2026-04-01 17:01:35 +01:00
parent d01abac9e9
commit a4e4942069
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
#include "types.hpp"
int translateCommand(std::string&, Command);
int translateCommand(std::string&, const std::string, Command);
+3 -3
View File
@@ -10,8 +10,8 @@
int process(std::string source) {
std::ifstream ifs(source);
std::string out = source.substr(0, source.find_last_of('.')) + ".asm";
std::ofstream ofs(out);
std::string filename = source.substr(0, source.find_last_of('.'));
std::ofstream ofs(filename + ".asm", std::ofstream::trunc);
std::string line;
std::string output;
@@ -31,7 +31,7 @@ int process(std::string source) {
for (const Command &cmd : commands) {
int translateResult;
if ((translateResult = translateCommand(output, cmd)) != 0) {
if ((translateResult = translateCommand(output, filename, cmd)) != 0) {
return translateResult;
}