Fix getstrcharat error message

This commit is contained in:
2025-08-25 11:22:02 +10:00
parent e906734aca
commit db99b9ac9f

View File

@@ -660,26 +660,26 @@ Literal exec(vector<Instruction> in, bool executingFunction) {
if (holds_alternative<string>(get<Literal>(l.args[0]).val)) {
instr = get<string>(get<Literal>(l.args[0]).val);
} else {
error("First argument of getlistat must be a string literal");
error("First argument of getstrcharat must be a string literal");
}
} else {
error("First argument of getlistat must be a string literal");
error("First argument of getstrcharat must be a string literal");
}
if (holds_alternative<Literal>(l.args[1])) {
if (holds_alternative<int>(get<Literal>(l.args[1]).val)) {
ref = get<int>(get<Literal>(l.args[1]).val);
} else {
error("Second argument of getlistat must be an integer literal");
error("Second argument of getstrcharat must be an integer literal");
}
} else {
error("Second argument of getlistat must be an integer literal");
error("Second argument of getstrcharat must be an integer literal");
}
if (holds_alternative<Direct>(l.args[2])) {
var = get<Direct>(l.args[2]);
} else {
error("Third argument of getlistat must be a direct reference");
error("Third argument of getstrcharat must be a direct reference");
}
if (instr.size() > ref) {