Superclasses 29

This commit is contained in:
nazrin 2025-06-15 11:15:24 +00:00
parent 28b0c71be1
commit 51bc1395f8
10 changed files with 88 additions and 18 deletions

View file

@ -30,15 +30,15 @@ int main(){
"./test/perverseclosure.lox".match("return from outer create inner closure value ".replace(" ", "\n"));
"./test/class.lox".match("The German chocolate cake is delicious!\n");
"./test/methods.lox".match("Enjoy your cup of coffee and chicory\nnot a method\n");
/* "./test/super.lox".match("Fry until golden brown.\nPipe full of custard and coat with chocolate.\nA method\n"); */
"./test/super.lox".match("Fry until golden brown.\nPipe full of custard and coat with chocolate.\nA method\n");
"./test/err/invalid_syntax.lox".shouldFail(RetVal.other);
"./test/err/already_defined.lox".shouldFail(RetVal.other, "Already a variable with this name");
"./test/err/undefined_var.lox".shouldFail(RetVal.runtime, "Undefined variable");
"./test/err/self_ref_vardecl.lox".shouldFail(RetVal.runtime, "Undefined variable");
"./test/err/global_scope_return.lox".shouldFail(RetVal.other, "Can't return from top-level code");
/* "./test/err/super_outside_class.lox".shouldFail(RetVal.other, "Can't use 'super' outside of a class"); */
/* "./test/err/super_without_superclass.lox".shouldFail(RetVal.other, "Can't use 'super' in a class with no superclass"); */
"./test/err/super_outside_class.lox".shouldFail(RetVal.other, "Can't use 'super' outside of a class");
"./test/err/super_without_superclass.lox".shouldFail(RetVal.other, "Can't use 'super' in a class with no superclass");
return failures;
}