mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Automate the addition of RUN and simplify RUN lines (#2292)
This was an offshoot of the discussion about how much boilerplate we could remove. lit requires RUN lines be there, everything else is optional.
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'EmptyDeclaration', text: ';'},
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FileEnd', text: ''},
|
||||
|
||||
+5
-5
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 15, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 16, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
@@ -26,10 +26,10 @@
|
||||
|
||||
// NOTE: Move to its own directory when more tests are added.
|
||||
fn F() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
a.;
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
a.fn;
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
a.42;
|
||||
}
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'EmptyDeclaration', text: ';', has_error: yes},
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/no_intro_with_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_no_intro_with_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
foo;
|
||||
+3
-3
@@ -2,11 +2,11 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/no_intro_without_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_no_intro_without_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
foo bar baz
|
||||
+5
-5
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 4, kind: 'VariableDeclaration', text: 'var', has_error: yes, subtree_size: 5, children: [
|
||||
// CHECK:STDOUT: {node_index: 3, kind: 'VariableInitializer', text: '=', subtree_size: 4, children: [
|
||||
@@ -13,7 +13,7 @@
|
||||
// CHECK:STDOUT: {node_index: 5, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/paren_match_regression.carbon:[[@LINE+3]]:5: Expected pattern in `var` declaration.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/paren_match_regression.carbon:[[@LINE+2]]:12: Expected `,` or `)`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/paren_match_regression.carbon:[[@LINE+1]]:15: Expected `;` after expression.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+3]]:5: Expected pattern in `var` declaration.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+2]]:12: Expected `,` or `)`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+1]]:15: Expected `;` after expression.
|
||||
var = (foo {})
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 24, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 25, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 3, kind: 'PackageDirective', text: 'package', subtree_size: 4, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'Geometry'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 13, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 14, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 26, kind: 'VariableDeclaration', text: 'var', subtree_size: 27, children: [
|
||||
// CHECK:STDOUT: {node_index: 12, kind: 'PatternBinding', text: ':', subtree_size: 13, children: [
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 14, kind: 'VariableDeclaration', text: 'var', subtree_size: 15, children: [
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'PatternBinding', text: ':', subtree_size: 7, children: [
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'VariableDeclaration', text: 'var', subtree_size: 7, children: [
|
||||
// CHECK:STDOUT: {node_index: 2, kind: 'PatternBinding', text: ':', subtree_size: 3, children: [
|
||||
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 20, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 21, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
@@ -30,7 +30,7 @@
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
fn foo() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/colon_instead_of_in.carbon:[[@LINE+1]]:19: `:` should be replaced by `in`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/fail_colon_instead_of_in.carbon:[[@LINE+1]]:19: `:` should be replaced by `in`.
|
||||
for (var x: i32 : y) {
|
||||
Print(x);
|
||||
}
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 19, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 20, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
@@ -29,7 +29,7 @@
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
fn foo() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/missing_in.carbon:[[@LINE+1]]:19: Expected `in` after loop `var` declaration.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/fail_missing_in.carbon:[[@LINE+1]]:19: Expected `in` after loop `var` declaration.
|
||||
for (var x: i32 y) {
|
||||
Print(x);
|
||||
}
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 17, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 18, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
@@ -27,7 +27,7 @@
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
fn foo() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/missing_var.carbon:[[@LINE+1]]:8: Expected `var` declaration.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/fail_missing_var.carbon:[[@LINE+1]]:8: Expected `var` declaration.
|
||||
for (x: i32 in y) {
|
||||
Print(x);
|
||||
}
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 32, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 33, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 21, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 22, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 4, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 5, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 2, kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 3, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
@@ -11,5 +11,5 @@
|
||||
// CHECK:STDOUT: {node_index: 3, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/identifier_instead_of_sig.carbon:[[@LINE+1]]:8: Expected `(` after function name.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_identifier_instead_of_sig.carbon:[[@LINE+1]]:8: Expected `(` after function name.
|
||||
fn foo bar;
|
||||
+3
-3
@@ -2,13 +2,13 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclarationEnd', text: ';'}]},
|
||||
// CHECK:STDOUT: {node_index: 2, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/missing_name.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_missing_name.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
fn ();
|
||||
+3
-3
@@ -2,13 +2,13 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'}]},
|
||||
// CHECK:STDOUT: {node_index: 2, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/no_sig_or_semi.carbon:[[@LINE+1]]:7: Expected `(` after function name.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_no_sig_or_semi.carbon:[[@LINE+1]]:7: Expected `(` after function name.
|
||||
fn foo
|
||||
+3
-3
@@ -2,13 +2,13 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclarationEnd', text: ';'}]},
|
||||
// CHECK:STDOUT: {node_index: 2, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/only_fn_and_semi.carbon:[[@LINE+1]]:3: Expected function name after `fn` keyword.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_only_fn_and_semi.carbon:[[@LINE+1]]:3: Expected function name after `fn` keyword.
|
||||
fn;
|
||||
+3
-3
@@ -2,13 +2,13 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclarationEnd', text: ';'}]},
|
||||
// CHECK:STDOUT: {node_index: 2, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/repeated_fn_and_semi.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_repeated_fn_and_semi.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
fn fn;
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'FunctionDeclaration', text: 'fn', has_error: yes},
|
||||
// CHECK:STDOUT: {node_index: 5, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 5, children: [
|
||||
@@ -14,7 +14,7 @@
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/skip_indented_newline_until_outdent.carbon:[[@LINE+1]]:6: Expected function name after `fn` keyword.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon:[[@LINE+1]]:6: Expected function name after `fn` keyword.
|
||||
fn (x,
|
||||
y,
|
||||
z)
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclarationEnd', text: ';'}]},
|
||||
@@ -15,7 +15,7 @@
|
||||
// CHECK:STDOUT: {node_index: 7, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/skip_indented_newline_with_semi.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
fn (x,
|
||||
y,
|
||||
z);
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'FunctionDeclaration', text: 'fn', has_error: yes},
|
||||
// CHECK:STDOUT: {node_index: 5, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 5, children: [
|
||||
@@ -14,7 +14,7 @@
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/skip_indented_newline_without_semi.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
fn (x,
|
||||
y,
|
||||
z)
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'FunctionDeclaration', text: 'fn', has_error: yes},
|
||||
// CHECK:STDOUT: {node_index: 5, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 5, children: [
|
||||
@@ -14,6 +14,6 @@
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/skip_to_newline_without_semi.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
fn ()
|
||||
fn F();
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 4, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 5, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
@@ -13,6 +13,6 @@
|
||||
// CHECK:STDOUT: {node_index: 5, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/skip_without_semi_to_curly.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
struct X { fn () }
|
||||
fn F();
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 4, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 5, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
@@ -13,5 +13,5 @@
|
||||
// CHECK:STDOUT: {node_index: 5, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/with_identifier_as_param.carbon:[[@LINE+1]]:8: Expected parameter declaration.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_with_identifier_as_param.carbon:[[@LINE+1]]:8: Expected parameter declaration.
|
||||
fn foo(bar);
|
||||
+3
-3
@@ -2,13 +2,13 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclarationEnd', text: ';'}]},
|
||||
// CHECK:STDOUT: {node_index: 2, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/without_name_and_many_tokens_in_params.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+1]]:4: Expected function name after `fn` keyword.
|
||||
fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z);
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 11, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 12, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 7, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 5, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 6, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 7, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
@@ -19,5 +19,5 @@ fn F() {
|
||||
// Note: this might become valid depending on the expression syntax. This test
|
||||
// shouldn't be taken as a sign it should remain invalid.
|
||||
bar
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/definition/identifier_in_statements.carbon:[[@LINE+1]]:1: Expected `;` after expression.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/definition/fail_identifier_in_statements.carbon:[[@LINE+1]]:1: Expected `;` after expression.
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 21, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 22, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 10, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 11, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'foo'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 25, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 26, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 60, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 61, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 52, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 53, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
Vendored
+7
-7
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 24, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 25, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
@@ -34,13 +34,13 @@
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/errors.carbon:[[@LINE+1]]:6: Expected `(` after `if`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:6: Expected `(` after `if`.
|
||||
if a {}
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/errors.carbon:[[@LINE+1]]:7: Expected expression.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:7: Expected expression.
|
||||
if () {}
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/errors.carbon:[[@LINE+1]]:9: Unexpected tokens before `)`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:9: Unexpected tokens before `)`.
|
||||
if (b c) {}
|
||||
if (d)
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/errors.carbon:[[@LINE+2]]:1: Expected braced code block.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/errors.carbon:[[@LINE+1]]:1: Expected expression.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+2]]:1: Expected braced code block.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:1: Expected expression.
|
||||
}
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: This should have an error.
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 19, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 20, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 11, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 12, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 11, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 12, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
@@ -21,6 +21,6 @@
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/missing_precedence_and_or.carbon:[[@LINE+1]]:11: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/fail_missing_precedence_and_or.carbon:[[@LINE+1]]:11: Parentheses are required to disambiguate operator precedence.
|
||||
a and b or c;
|
||||
}
|
||||
+3
-3
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 11, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 12, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
@@ -21,6 +21,6 @@
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/missing_precedence_or_and.carbon:[[@LINE+1]]:10: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/fail_missing_precedence_or_and.carbon:[[@LINE+1]]:10: Parentheses are required to disambiguate operator precedence.
|
||||
a or b and c;
|
||||
}
|
||||
+6
-6
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 26, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 27, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
@@ -36,9 +36,9 @@
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/variety.carbon:[[@LINE+4]]:29: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/variety.carbon:[[@LINE+3]]:34: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/variety.carbon:[[@LINE+2]]:38: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/variety.carbon:[[@LINE+1]]:40: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/fail_variety.carbon:[[@LINE+4]]:29: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/fail_variety.carbon:[[@LINE+3]]:34: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/fail_variety.carbon:[[@LINE+2]]:38: Parentheses are required to disambiguate operator precedence.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/operators/fail_variety.carbon:[[@LINE+1]]:40: Parentheses are required to disambiguate operator precedence.
|
||||
n = a * b + c * d = d * d << e & f - not g;
|
||||
}
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 64, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 65, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 14, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 15, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 9, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 10, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 9, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 10, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 27, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 28, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: This should have an error.
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 11, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 12, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
Reference in New Issue
Block a user