mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
This leaves a single state for each in the expr loop. I was trying to think through ways to have per-token states, but they felt sort of bulky. Note this is more verbose: but I think the long-term is going to be that when we start wanting to add handlers, we're going to need to switch to different names based on the token found. As a consequence, the parse state logic will end up diverging a little, and we'll just want to align towards boilerplate handlers. Short-term, this opens up a path for saying that each parse node corresponds to precisely one token in success states, and separates out what were becoming big handler functions in check.
24 lines
826 B
Plaintext
24 lines
826 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
|
|
var a: (i32, i32) = (12, 6);
|
|
// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: ERROR: Semantics TODO: `HandlePrefixOperatorMinus`.
|
|
// CHECK:STDERR: var b: i32 = a[-10];
|
|
// CHECK:STDERR: ^~~
|
|
var b: i32 = a[-10];
|
|
|
|
// CHECK:STDOUT: --- fail_negative_indexing.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %.loc7_17.1: type = tuple_type (type, type)
|
|
// CHECK:STDOUT: %.loc7_17.2: type = tuple_type (i32, i32)
|
|
// CHECK:STDOUT: %.loc7_17.3: type = ptr_type (i32, i32)
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|