We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a63bdc7 commit c101ce0Copy full SHA for c101ce0
src/lpython/semantics/python_ast_to_asr.cpp
@@ -1487,6 +1487,19 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
1487
}
1488
1489
1490
+ void visit_ClassDef(const AST::ClassDef_t &x) {
1491
+ SymbolTable *parent_scope = current_scope;
1492
+ current_scope = al.make_new<SymbolTable>(parent_scope);
1493
+ for (size_t i=0; i<x.n_body; i++) {
1494
+ visit_stmt(*x.m_body[i]);
1495
+ }
1496
+ tmp = ASR::make_Class_t(al, x.base.base.loc,
1497
+ nullptr, nullptr, 0);
1498
+ ASR::symbol_t * t = ASR::down_cast<ASR::symbol_t>(tmp);
1499
+ parent_scope->scope[x.m_name] = t;
1500
+ current_scope = parent_scope;
1501
1502
+
1503
void create_GenericProcedure(const Location &loc) {
1504
for(auto &p: overload_defs) {
1505
std::string def_name = p.first;
0 commit comments