mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-28 09:20:12 +01:00
In order to format comments, it's helpful if they're tracked. This tracks them separately from tokens in order to avoid interfering with parse; it'd be inconvenient if comment tokens could show up in arbitrary locations, albeit possible to support. This additionally extracts out the TokenIterator support into a template in order to generally have it available for IndexBase types. I'm only adding it for CommentInfo, not sure if we'll want it elsewhere, but this structure still felt like a good fit.
23 lines
786 B
Plaintext
23 lines
786 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
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/format/testdata/basics/fail_invalid_comment.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/format/testdata/basics/fail_invalid_comment.carbon
|
|
|
|
// --- fail_test.carbon
|
|
|
|
//f
|
|
|
|
// --- AUTOUPDATE-SPLIT
|
|
|
|
// CHECK:STDERR: fail_test.carbon:2:3: error: whitespace is required after '//'
|
|
// CHECK:STDERR: //f
|
|
// CHECK:STDERR: ^
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: //f
|
|
// CHECK:STDOUT:
|