mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-27 22:02:33 +01:00
39 lines
1.9 KiB
Plaintext
39 lines
1.9 KiB
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
|
|
|
|
interface Foo {
|
|
// TODO: support `let T:! type;`
|
|
|
|
final let I: i32 = 4;
|
|
default let D: bool = true;
|
|
}
|
|
|
|
// CHECK:STDOUT: - filename: associated_constants.carbon
|
|
// CHECK:STDOUT: parse_tree: [
|
|
// CHECK:STDOUT: {kind: 'FileStart', text: ''},
|
|
// CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'},
|
|
// CHECK:STDOUT: {kind: 'IdentifierName', text: 'Foo'},
|
|
// CHECK:STDOUT: {kind: 'InterfaceDefinitionStart', text: '{', subtree_size: 3},
|
|
// CHECK:STDOUT: {kind: 'LetIntroducer', text: 'let'},
|
|
// CHECK:STDOUT: {kind: 'FinalModifier', text: 'final'},
|
|
// CHECK:STDOUT: {kind: 'IdentifierName', text: 'I'},
|
|
// CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
|
|
// CHECK:STDOUT: {kind: 'BindingPattern', text: ':', subtree_size: 3},
|
|
// CHECK:STDOUT: {kind: 'LetInitializer', text: '='},
|
|
// CHECK:STDOUT: {kind: 'IntLiteral', text: '4'},
|
|
// CHECK:STDOUT: {kind: 'LetDecl', text: ';', subtree_size: 8},
|
|
// CHECK:STDOUT: {kind: 'LetIntroducer', text: 'let'},
|
|
// CHECK:STDOUT: {kind: 'DefaultModifier', text: 'default'},
|
|
// CHECK:STDOUT: {kind: 'IdentifierName', text: 'D'},
|
|
// CHECK:STDOUT: {kind: 'BoolTypeLiteral', text: 'bool'},
|
|
// CHECK:STDOUT: {kind: 'BindingPattern', text: ':', subtree_size: 3},
|
|
// CHECK:STDOUT: {kind: 'LetInitializer', text: '='},
|
|
// CHECK:STDOUT: {kind: 'BoolLiteralTrue', text: 'true'},
|
|
// CHECK:STDOUT: {kind: 'LetDecl', text: ';', subtree_size: 8},
|
|
// CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 20},
|
|
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
|
// CHECK:STDOUT: ]
|