Resolver - Class declarations
This commit is contained in:
parent
5702abe44d
commit
9bfb549a22
1 changed files with 7 additions and 0 deletions
|
@ -37,6 +37,7 @@ enum SymState {
|
|||
enum SymKind {
|
||||
Variable,
|
||||
Function,
|
||||
Class,
|
||||
}
|
||||
|
||||
/// General information about a symbol.
|
||||
|
@ -261,6 +262,12 @@ impl VarResolver for StmtNode {
|
|||
rs.with_scope(|rs| resolve_function(rs, &decl.params, &decl.body))
|
||||
}
|
||||
|
||||
StmtNode::ClassDecl(decl) => {
|
||||
rs.declare(&decl.name, SymKind::Class)?;
|
||||
rs.define(&decl.name);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
StmtNode::If {
|
||||
condition,
|
||||
then_branch,
|
||||
|
|
Loading…
Reference in a new issue