While I was making a separate environment to add in keywords and execute via env.parseString(_str), I was getting strange compiling errors until I realized that it's just accessing Catspeak itself. (On a off note, there's a memory leak here too)
I think it should be changed to something like this instead.
static parseString = function (src) {
var buff = __catspeak_create_buffer_from_string(src);
var result = parse(buff);
buffer_delete(buff);
return result;
};
Code that demonstrates this problem:
env = new CatspeakEnvironment();
env.renameKeyword(
"//", "div",
"--", "//"
);
// Fails to parse due to pointing towards Catspeak in .parseString
var asg = env.parseString(@"// A Comment!
num = 42;
return num;
");
func = env.compileGML(asg);
show_debug_message(func());
What version of Catspeak are you using?
3.0.0-beta3
What happened?
While I was making a separate environment to add in keywords and execute via
env.parseString(_str)
, I was getting strange compiling errors until I realized that it's just accessing Catspeak itself. (On a off note, there's a memory leak here too)I think it should be changed to something like this instead.
Code that demonstrates this problem: