Commit a8b3c0e2 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Create symbols for variable declarations.

parent beea3ed5
......@@ -592,8 +592,11 @@ bool Semantic::visit(ParameterDeclarationAST *ast)
bool Semantic::visit(VariableDeclarationAST *ast)
{
const Type *ty = type(ast->type);
Q_UNUSED(ty);
ExprResult initializer = expression(ast->initializer);
if (ast->name) {
Variable *var = _engine->newVariable(_scope, *ast->name, ty);
_scope->add(var);
}
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment