| 228 | } |
| 229 | |
| 230 | void NameResolver::ResolveLocalVar(Var* var) { |
| 231 | if (var->is_name()) { |
| 232 | if (!current_func_) { |
| 233 | return; |
| 234 | } |
| 235 | |
| 236 | Index index = current_func_->GetLocalIndex(*var); |
| 237 | if (index == kInvalidIndex) { |
| 238 | PrintError(&var->loc, "undefined local variable \"%s\"", |
| 239 | var->name().c_str()); |
| 240 | return; |
| 241 | } |
| 242 | |
| 243 | var->set_index(index); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | void NameResolver::ResolveBlockDeclarationVar(BlockDeclaration* decl) { |
| 248 | if (decl->has_func_type) { |
nothing calls this directly
no test coverage detected