forked from ground/ground
Fix getstrcharat error message
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -660,26 +660,26 @@ Literal exec(vector<Instruction> in, bool executingFunction) {
|
|||||||
if (holds_alternative<string>(get<Literal>(l.args[0]).val)) {
|
if (holds_alternative<string>(get<Literal>(l.args[0]).val)) {
|
||||||
instr = get<string>(get<Literal>(l.args[0]).val);
|
instr = get<string>(get<Literal>(l.args[0]).val);
|
||||||
} else {
|
} else {
|
||||||
error("First argument of getlistat must be a string literal");
|
error("First argument of getstrcharat must be a string literal");
|
||||||
}
|
}
|
||||||
} else {
|
} 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<Literal>(l.args[1])) {
|
||||||
if (holds_alternative<int>(get<Literal>(l.args[1]).val)) {
|
if (holds_alternative<int>(get<Literal>(l.args[1]).val)) {
|
||||||
ref = get<int>(get<Literal>(l.args[1]).val);
|
ref = get<int>(get<Literal>(l.args[1]).val);
|
||||||
} else {
|
} else {
|
||||||
error("Second argument of getlistat must be an integer literal");
|
error("Second argument of getstrcharat must be an integer literal");
|
||||||
}
|
}
|
||||||
} else {
|
} 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])) {
|
if (holds_alternative<Direct>(l.args[2])) {
|
||||||
var = get<Direct>(l.args[2]);
|
var = get<Direct>(l.args[2]);
|
||||||
} else {
|
} 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) {
|
if (instr.size() > ref) {
|
||||||
|
Reference in New Issue
Block a user