fail_star_star_no_space.carbon 1.5 KB

1234567891011121314151617181920212223242526272829
  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: We try to form (n*)*p and reject due to missing parentheses
  7. // before we notice the missing whitespace around the second `*`.
  8. // It'd be better to (somehow) form n*(*p) and reject due to the missing
  9. // whitespace around the first `*`.
  10. // CHECK:STDERR: fail_star_star_no_space.carbon:[[@LINE+3]]:16: ERROR: `var` declarations must end with a `;`.
  11. // CHECK:STDERR: var n: i8 = n**p;
  12. // CHECK:STDERR: ^
  13. var n: i8 = n**p;
  14. // CHECK:STDOUT: - filename: fail_star_star_no_space.carbon
  15. // CHECK:STDOUT: parse_tree: [
  16. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  17. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  18. // CHECK:STDOUT: {kind: 'Name', text: 'n'},
  19. // CHECK:STDOUT: {kind: 'IntegerTypeLiteral', text: 'i8'},
  20. // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3},
  21. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  22. // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'},
  23. // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2},
  24. // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 3},
  25. // CHECK:STDOUT: {kind: 'VariableDecl', text: ';', has_error: yes, subtree_size: 9},
  26. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  27. // CHECK:STDOUT: ]