fail_infix_uneven_space_after.carbon 1.3 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: We could figure out that this first Failed example is infix
  7. // with one-token lookahead.
  8. // CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+3]]:16: ERROR: `var` declarations must end with a `;`.
  9. // CHECK:STDERR: var n: i8 = n* n;
  10. // CHECK:STDERR: ^
  11. var n: i8 = n* n;
  12. // CHECK:STDOUT: - filename: fail_infix_uneven_space_after.carbon
  13. // CHECK:STDOUT: parse_tree: [
  14. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  15. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  16. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'n'},
  17. // CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i8'},
  18. // CHECK:STDOUT: {kind: 'BindingPattern', text: ':', subtree_size: 3},
  19. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  20. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'n'},
  21. // CHECK:STDOUT: {kind: 'PostfixOperatorStar', text: '*', subtree_size: 2},
  22. // CHECK:STDOUT: {kind: 'VariableDecl', text: ';', has_error: yes, subtree_size: 8},
  23. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  24. // CHECK:STDOUT: ]