CObjMethod refactor

This commit is contained in:
2020-11-12 23:04:09 -06:00
parent 40ae495aaf
commit 08b6dcbf4c
12 changed files with 135 additions and 65 deletions

View File

@@ -955,7 +955,7 @@ static void functionDeclaration(CParseState *pstate) {
}
static void returnStatement(CParseState *pstate) {
if (pstate->compiler->type != FTYPE_FUNCTION) {
if (pstate->compiler->type != FTYPE_FUNCTION && pstate->compiler->type != FTYPE_METHOD) {
error(pstate, "Expected 'return' in function!");
return;
}