1
Fork 0

Basic compiler infra

This commit is contained in:
Caio 2022-06-02 09:00:04 -03:00
parent 5e6bb83268
commit aa115eba12
7 changed files with 129 additions and 25 deletions

View file

@ -160,7 +160,7 @@ impl<'a> ExtCtxt<'a> {
attrs: AttrVec::new(),
tokens: None,
});
ast::Stmt { id: ast::DUMMY_NODE_ID, kind: ast::StmtKind::Local(local), span: sp }
self.stmt_local(local, sp)
}
// Generates `let _: Type;`, which is usually used for type assertions.
@ -174,6 +174,10 @@ impl<'a> ExtCtxt<'a> {
attrs: AttrVec::new(),
tokens: None,
});
self.stmt_local(local, span)
}
pub fn stmt_local(&self, local: P<ast::Local>, span: Span) -> ast::Stmt {
ast::Stmt { id: ast::DUMMY_NODE_ID, kind: ast::StmtKind::Local(local), span }
}