Fixed some Expression and Operand memory issues.

This commit is contained in:
Brad Arant committed 2024-09-26 16:58:55 -07:00
1 parent 3db9227adc
commit 5a97da3d1c
8 files changed
+10 -11

No files matched your search

+3 -4
View File
@@ -7,7 +7,7 @@ namespace jet {
Operand::Operand(coreutils::ZString &in) {
in.skipWhitespace();
std::cout << "op: [" << in.unparsed() << "]" << std::endl;
if(in.ifNext("SUBSTRING")) {
if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for SUBSTRING parameters.");
@@ -48,10 +48,9 @@ namespace jet {
boolean = false;
string = "false";
return;
} else if(in.startsWithDouble()) {
char *temp = in.getCursor();
} else if(in.startsWithNumber()) {
doubleValue = in.asDouble();
string = coreutils::ZString(temp, in.getCursor() - temp);
string = std::to_string(doubleValue);
return;
} else if(in.ifNext("'")) {
string = in.getTokenExclude("'");