mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 19:55:11 +00:00
Switching from RE2 to StrReplaceAll because it seems a fair fit for what actually needs to be done here. Also pick up \t for visibility reasons. This came up because clangd's LSP-related APIs print carriage returns.
99 lines
4.7 KiB
Plaintext
99 lines
4.7 KiB
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/lex/testdata/string_literals.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/string_literals.carbon
|
|
|
|
// --- fail_decimal_escape.carbon
|
|
// CHECK:STDOUT: - filename: fail_decimal_escape.carbon
|
|
// CHECK:STDOUT: tokens:
|
|
|
|
// CHECK:STDERR: fail_decimal_escape.carbon:[[@LINE+4]]:4: error: decimal digit follows `\0` escape sequence. Use `\x00` instead of `\0` if the next character is a digit [DecimalEscapeSequence]
|
|
// CHECK:STDERR: "\01"
|
|
// CHECK:STDERR: ^
|
|
// CHECK:STDERR:
|
|
"\01"
|
|
// CHECK:STDOUT: - { index: 1, kind: 'StringLiteral', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '"\01"', value: ` |