fail_require_close_bracket.carbon 1.2 KB

1234567891011121314151617181920212223242526
  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. // TODO: It should emit only one error message.
  7. // CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+6]]:8: ERROR: Opening symbol without a corresponding closing symbol.
  8. // CHECK:STDERR: var x: [i32;;
  9. // CHECK:STDERR: ^
  10. // CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:8: ERROR: Expected expression.
  11. // CHECK:STDERR: var x: [i32;;
  12. // CHECK:STDERR: ^
  13. var x: [i32;;
  14. // CHECK:STDOUT: - filename: fail_require_close_bracket.carbon
  15. // CHECK:STDOUT: parse_tree: [
  16. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  17. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  18. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'x'},
  19. // CHECK:STDOUT: {kind: 'InvalidParse', text: '[', has_error: yes},
  20. // CHECK:STDOUT: {kind: 'BindingPattern', text: ':', has_error: yes, subtree_size: 3},
  21. // CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5},
  22. // CHECK:STDOUT: {kind: 'EmptyDecl', text: ';'},
  23. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  24. // CHECK:STDOUT: ]