mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Rename parser dir to parse (#3178)
Continuing with #3070. Just a dir and file rename (mostly removing prefixes, although for parse_tree_fuzzer and parse_tree_file_test I'm dropping "tree" instead of "parse"). Everything in the parse dir should be marked as a move.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// 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:STDERR: fail_comma_only.carbon:[[@LINE+3]]:9: Expected `.field: field_type` or `.field = value`.
|
||||
// CHECK:STDERR: var x: {,} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {,} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: ',', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 11},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,30 @@
|
||||
// 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:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+3]]:17: Expected `.field: field_type`.
|
||||
// CHECK:STDERR: var x: {.a: i32,,} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a: i32,,} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: ',', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 9},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 11},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 16},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,30 @@
|
||||
// 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:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: Expected `.field = value`.
|
||||
// CHECK:STDERR: var x: {.a = 0,,} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a = 0,,} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '0'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: ',', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 9},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 11},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 16},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,26 @@
|
||||
// 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:STDERR: fail_dot_only.carbon:[[@LINE+3]]:10: Expected identifier after `.`.
|
||||
// CHECK:STDERR: var x: {.} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: '}', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 7},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 12},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,32 @@
|
||||
// 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:STDERR: fail_dot_string_colon.carbon:[[@LINE+3]]:10: Expected identifier after `.`.
|
||||
// CHECK:STDERR: var x: {."hello": i32, .y: i32} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {."hello": i32, .y: i32} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: '"hello"', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: ':', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'y'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 11},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 13},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 18},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,32 @@
|
||||
// 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:STDERR: fail_dot_string_equals.carbon:[[@LINE+3]]:10: Expected identifier after `.`.
|
||||
// CHECK:STDERR: var x: {."hello" = 0, .y = 4} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {."hello" = 0, .y = 4} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: '"hello"', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '0'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '=', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'y'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '4'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 11},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 13},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 18},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,31 @@
|
||||
// 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:STDERR: fail_extra_token_in_type.carbon:[[@LINE+3]]:17: Expected `,` or `}`.
|
||||
// CHECK:STDERR: var x: {.a: i32 banana} = {.a = 0};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a: i32 banana} = {.a = 0};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', has_error: yes, subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 8},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '0'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 17},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,31 @@
|
||||
// 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:STDERR: fail_extra_token_in_value.carbon:[[@LINE+3]]:28: Expected `,` or `}`.
|
||||
// CHECK:STDERR: var x: {.a: i32} = {.a = 0 banana};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a: i32} = {.a = 0 banana};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 8},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '0'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', has_error: yes, subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 17},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: Expected `.field: field_type` or `.field = value`.
|
||||
// CHECK:STDERR: var x: {a:} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {a:} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: 'a', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: Expected `.field: field_type` or `.field = value`.
|
||||
// CHECK:STDERR: var x: {a=} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {a=} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: 'a', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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:STDERR: fail_identifier_only.carbon:[[@LINE+3]]:9: Expected `.field: field_type` or `.field = value`.
|
||||
// CHECK:STDERR: var x: {a} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {a} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: 'a', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,27 @@
|
||||
// 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:STDERR: fail_missing_type.carbon:[[@LINE+3]]:12: Expected expression.
|
||||
// CHECK:STDERR: var x: {.a:} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a:} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'InvalidParse', text: '}', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: ':', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 8},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 13},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,27 @@
|
||||
// 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:STDERR: fail_missing_value.carbon:[[@LINE+3]]:12: Expected expression.
|
||||
// CHECK:STDERR: var x: {.a=} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a=} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'InvalidParse', text: '}', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '=', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 8},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 13},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,31 @@
|
||||
// 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:STDERR: fail_mix_type_and_value.carbon:[[@LINE+3]]:21: Expected `.field: field_type`.
|
||||
// CHECK:STDERR: var x: {.a: i32, .b = 0} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a: i32, .b = 0} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'b'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 10},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 12},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 17},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,29 @@
|
||||
// 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:STDERR: fail_mix_value_and_type.carbon:[[@LINE+3]]:17: Expected `.field = value`.
|
||||
// CHECK:STDERR: var x: {.a = 0, b: i32} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a = 0, b: i32} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '0'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: 'b', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 8},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 10},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 15},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,65 @@
|
||||
// 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:STDERR: fail_mix_with_unknown.carbon:[[@LINE+6]]:25: Expected `.field = value`.
|
||||
// CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32};
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:29: Expected `.field = value`.
|
||||
// CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32};
|
||||
// CHECK:STDERR: ^
|
||||
var x: i32 = {.a = 1, .b, .c: i32};
|
||||
|
||||
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+6]]:26: Expected `.field: field_type`.
|
||||
// CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1};
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:31: Expected `.field: field_type`.
|
||||
// CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1};
|
||||
// CHECK:STDERR: ^
|
||||
var x: i32 = {.a: i32, .b, .c = 1};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '1'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'b'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'c'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 14},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 20},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'b'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'c'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 14},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 20},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,26 @@
|
||||
// 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:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+3]]:11: Expected `.field: field_type` or `.field = value`.
|
||||
// CHECK:STDERR: var x: {.a} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.a} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 7},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 12},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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:STDERR: fail_type_no_designator.carbon:[[@LINE+3]]:9: Expected `.field: field_type` or `.field = value`.
|
||||
// CHECK:STDERR: var x: {i32} = {};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {i32} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldUnknown', text: 'i32', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,20 @@
|
||||
// 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
|
||||
|
||||
var y: {} = {};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'y'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,28 @@
|
||||
// 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
|
||||
|
||||
var z: {.n: i32} = {.n = 4};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'z'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'n'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 8},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'n'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '4'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 17},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,30 @@
|
||||
// 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
|
||||
|
||||
var z: {.n: i32,} = {.n = 4,};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'z'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'n'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 7},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 9},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'n'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '4'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 7},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 19},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
@@ -0,0 +1,38 @@
|
||||
// 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
|
||||
|
||||
var x: {.a: i32, .b: i32} = {.a = 1, .b = 2};
|
||||
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'b'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 11},
|
||||
// CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 13},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'a'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '1'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructComma', text: ','},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'b'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'Literal', text: '2'},
|
||||
// CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 11},
|
||||
// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 27},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
Reference in New Issue
Block a user