mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-27 10:20:11 +01:00
This should cover: ``` library "lib" api; import Foo library default; import library default; import library "lib"; ``` This splits out `PackageName` and `LibraryName` to their own parse nodes so that checking can ignore them and still get a balanced parse tree (otherwise, we essentially need to implement handling of the parse nodes only to remove the identifiers/string literals -- the optional names mean we can't blindly do that as before). For reference, these nodes don't need to be handled because CheckParseTree will need to directly funnel import information along with checked IRs.
18 lines
701 B
Plaintext
18 lines
701 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
|
|
//
|
|
// AUTOUPDATE
|
|
|
|
package Geometry impl;
|
|
|
|
// CHECK:STDOUT: - filename: impl.carbon
|
|
// CHECK:STDOUT: parse_tree: [
|
|
// CHECK:STDOUT: {kind: 'FileStart', text: ''},
|
|
// CHECK:STDOUT: {kind: 'PackageIntroducer', text: 'package'},
|
|
// CHECK:STDOUT: {kind: 'PackageName', text: 'Geometry'},
|
|
// CHECK:STDOUT: {kind: 'PackageImpl', text: 'impl'},
|
|
// CHECK:STDOUT: {kind: 'PackageDirective', text: ';', subtree_size: 4},
|
|
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
|
// CHECK:STDOUT: ]
|