svlog: generate rib for var decls
Have variable declarations create a rib such that subsequent code can
find them.
@@ -71,6 +71,9 @@ pub(crate) fn local_rib<'gcx>(cx: &impl Context<'gcx>, node_id: NodeId) -> Resul
RibKind::Normal(Spanned::new(decl.name.name, decl.name.span), node_id)
}
AstNode::Module(_) => RibKind::Module(HashMap::new()),
+ AstNode::VarDecl(decl, _, _) => {
+ RibKind::Normal(Spanned::new(decl.name, decl.name_span), node_id)
+ }
_ => {
return cx.local_rib(
cx.parent_node_id(node_id)
