mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:11:05 +01:00
- `xor` keyword is removed, with `^` used in its place. - For consistency, also replaced unary `~` with unary `^`, as those changes come from the same proposal. - `type` keyword is added. - To keep existing tests working, parsing support for `type` literal is added too. - `is` keyword is removed; we'd already added the `impls` keyword to the list. - Several other missing keywords added.
36 lines
1.8 KiB
Plaintext
36 lines
1.8 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
|
|
// CHECK:STDOUT: [
|
|
// CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
|
|
// CHECK:STDOUT: {kind: 'Name', text: 'F'},
|
|
// CHECK:STDOUT: {kind: 'ParameterListStart', text: '('},
|
|
// CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2},
|
|
// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 5},
|
|
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
|
// CHECK:STDOUT: {kind: 'Name', text: 'q'},
|
|
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
|
// CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2},
|
|
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 4},
|
|
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
|
// CHECK:STDOUT: {kind: 'NameExpression', text: 'p'},
|
|
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8},
|
|
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
|
// CHECK:STDOUT: {kind: 'Name', text: 't'},
|
|
// CHECK:STDOUT: {kind: 'Literal', text: 'type'},
|
|
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3},
|
|
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
|
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
|
// CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2},
|
|
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8},
|
|
// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 22},
|
|
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
|
// CHECK:STDOUT: ]
|
|
|
|
fn F() {
|
|
var q: i32* = p;
|
|
var t: type = i32*;
|
|
}
|