mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
fix class in local scope
This commit is contained in:
parent
e1373766b1
commit
68273017b8
@ -2317,6 +2317,7 @@ static Error* compile_function(Compiler* self, int decorators) {
|
|||||||
|
|
||||||
static Error* compile_class(Compiler* self, int decorators) {
|
static Error* compile_class(Compiler* self, int decorators) {
|
||||||
Error* err;
|
Error* err;
|
||||||
|
if(ctx()->level > 1) return SyntaxError(self, "class definition not allowed here");
|
||||||
consume(TK_ID);
|
consume(TK_ID);
|
||||||
py_Name name = py_namev(Token__sv(prev()));
|
py_Name name = py_namev(Token__sv(prev()));
|
||||||
bool has_base = false;
|
bool has_base = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user