fail_paren_match_regression.carbon 1.4 KB

1234567891011121314151617181920212223
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // RUN: %{not} %{carbon-run-parser}
  7. // CHECK:STDOUT: [
  8. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  9. // CHECK:STDOUT: {kind: 'DeclaredName', text: '=', has_error: yes},
  10. // CHECK:STDOUT: {kind: 'InvalidParse', text: '=', has_error: yes},
  11. // CHECK:STDOUT: {kind: 'PatternBinding', text: '=', has_error: yes, subtree_size: 3},
  12. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  13. // CHECK:STDOUT: {kind: 'ParenExpressionOrTupleLiteralStart', text: '('},
  14. // CHECK:STDOUT: {kind: 'NameReference', text: 'foo'},
  15. // CHECK:STDOUT: {kind: 'ParenExpression', text: ')', has_error: yes, subtree_size: 3},
  16. // CHECK:STDOUT: {kind: 'VariableDeclaration', text: 'var', has_error: yes, subtree_size: 9},
  17. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  18. // CHECK:STDOUT: ]
  19. // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+3]]:5: Expected pattern in `var` declaration.
  20. // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+2]]:12: Expected `,` or `)`.
  21. // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+1]]:15: Expected `;` after expression.
  22. var = (foo {})