mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 10:21:20 +00:00
When binding a name, add it to name lookup. On NameReference nodes, use name lookup. - Switches from "identifiers" to the more generic "strings". Not strictly necessary here, but it's the overall direction I think we've agreed upon and wanted to do it while building more support out. - Starts doing deduplication of strings. - On BindName, registers names with name lookup. - Does name lookup based on the deduplicated string. - Per discussion with zygoloid, design is intended to be constant-time lookup regardless of the number of parent scopes. - Adds scopes so that we can track names which will be deregistered from lookup.
15 lines
487 B
Plaintext
15 lines
487 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// NOAUTOUPDATE
|
|
// RUN: %{carbon} -v dump semantics-ir %s | %{FileCheck-allow-unmatched}
|
|
//
|
|
// Only checks a couple statements in order to minimize manual update churn.
|
|
// CHECK:STDERR: Push 0: FunctionIntroducer
|
|
// CHECK:STDERR: AddNode block0: BindName(str0, node0)
|
|
|
|
fn Foo() {
|
|
return;
|
|
}
|