Skip to content

Commit

Permalink
Clean up a few details of lex yaml printing (#4845)
Browse files Browse the repository at this point in the history
- Escape dumped token strings (what got me here)
- Change the quoting from backticks to quotes
- Also add a `FormatEscaped` helper function for this, updating other
`.write_escaped` uses
  • Loading branch information
jonmeow authored Jan 24, 2025
1 parent 22c0198 commit b06fcc9
Show file tree
Hide file tree
Showing 24 changed files with 255 additions and 247 deletions.
20 changes: 20 additions & 0 deletions common/ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ class Printable {
}
};

// Helper class for printing strings with escapes.
//
// For example:
// stream << FormatEscaped(str);
// Is equivalent to:
// stream.write_escaped(str);
class FormatEscaped : public Printable<FormatEscaped> {
public:
explicit FormatEscaped(llvm::StringRef str, bool use_hex_escapes = false)
: str_(str), use_hex_escapes_(use_hex_escapes) {}

auto Print(llvm::raw_ostream& out) const -> void {
out.write_escaped(str_, use_hex_escapes_);
}

private:
llvm::StringRef str_;
bool use_hex_escapes_;
};

// Returns the result of printing the value.
template <typename T>
requires std::derived_from<T, Printable<T>>
Expand Down
5 changes: 2 additions & 3 deletions testing/file_test/file_test_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ class FileTestBase : public testing::Test {
friend void PrintTo(const TestFile& f, std::ostream* os) {
// Print content escaped.
llvm::raw_os_ostream os_wrap(*os);
os_wrap << "TestFile(" << f.filename << ", \"";
os_wrap.write_escaped(f.content);
os_wrap << "\")";
os_wrap << "TestFile(" << f.filename << ", \"" << FormatEscaped(f.content)
<< "\")";
}

std::string filename;
Expand Down
10 changes: 4 additions & 6 deletions toolchain/check/dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ static auto DumpNoNewline(const Context& context, SemIR::LocId loc_id) -> void {
auto line = context.tokens().GetLineNumber(token);
auto col = context.tokens().GetColumnNumber(token);
const char* implicit = loc_id.is_implicit() ? " implicit" : "";
llvm::errs() << "LocId(";
llvm::errs().write_escaped(context.sem_ir().filename());
llvm::errs() << ":" << line << ":" << col << implicit << ")";
llvm::errs() << "LocId(" << FormatEscaped(context.sem_ir().filename())
<< ":" << line << ":" << col << implicit << ")";
} else {
CARBON_CHECK(loc_id.is_import_ir_inst_id());

Expand All @@ -52,9 +51,8 @@ static auto DumpNoNewline(const Context& context, SemIR::LocId loc_id) -> void {
.ir_id;
const auto* import_file =
context.sem_ir().import_irs().Get(import_ir_id).sem_ir;
llvm::errs() << "LocId(import from \"";
llvm::errs().write_escaped(import_file->filename());
llvm::errs() << "\")";
llvm::errs() << "LocId(import from \""
<< FormatEscaped(import_file->filename()) << "\")";
}
}

Expand Down
4 changes: 1 addition & 3 deletions toolchain/check/import_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ static auto GenerateCppIncludesHeaderCode(
std::string code;
llvm::raw_string_ostream code_stream(code);
for (const auto& [path, _] : imports) {
code_stream << "#include \"";
code_stream.write_escaped(path);
code_stream << "\"\n";
code_stream << "#include \"" << FormatEscaped(path) << "\"\n";
}
return code;
}
Expand Down
26 changes: 13 additions & 13 deletions toolchain/lex/testdata/basic_syntax.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/basic_syntax.carbon
// CHECK:STDOUT: - filename: basic_syntax.carbon
// CHECK:STDOUT: tokens:
// CHECK:STDOUT: - { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }
// CHECK:STDOUT: - { index: 0, kind: "FileStart", line: {{ *\d+}}, column: 1, indent: 1, spelling: "" }

fn run(String program) {
// CHECK:STDOUT: - { index: 1, kind: 'Fn', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'fn', has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: 'run', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 3, kind: 'OpenParen', line: {{ *}}[[@LINE-3]], column: 7, indent: 1, spelling: '(', closing_token: 6 }
// CHECK:STDOUT: - { index: 4, kind: 'StringTypeLiteral', line: {{ *}}[[@LINE-4]], column: 8, indent: 1, spelling: 'String' }
// CHECK:STDOUT: - { index: 5, kind: 'Identifier', line: {{ *}}[[@LINE-5]], column: 15, indent: 1, spelling: 'program', identifier: 1, has_leading_space: true }
// CHECK:STDOUT: - { index: 6, kind: 'CloseParen', line: {{ *}}[[@LINE-6]], column: 22, indent: 1, spelling: ')', opening_token: 3 }
// CHECK:STDOUT: - { index: 7, kind: 'OpenCurlyBrace', line: {{ *}}[[@LINE-7]], column: 24, indent: 1, spelling: '{', closing_token: 11, has_leading_space: true }
// CHECK:STDOUT: - { index: 1, kind: "Fn", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "fn", has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: "Identifier", line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: "run", identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 3, kind: "OpenParen", line: {{ *}}[[@LINE-3]], column: 7, indent: 1, spelling: "(", closing_token: 6 }
// CHECK:STDOUT: - { index: 4, kind: "StringTypeLiteral", line: {{ *}}[[@LINE-4]], column: 8, indent: 1, spelling: "String" }
// CHECK:STDOUT: - { index: 5, kind: "Identifier", line: {{ *}}[[@LINE-5]], column: 15, indent: 1, spelling: "program", identifier: 1, has_leading_space: true }
// CHECK:STDOUT: - { index: 6, kind: "CloseParen", line: {{ *}}[[@LINE-6]], column: 22, indent: 1, spelling: ")", opening_token: 3 }
// CHECK:STDOUT: - { index: 7, kind: "OpenCurlyBrace", line: {{ *}}[[@LINE-7]], column: 24, indent: 1, spelling: "{", closing_token: 11, has_leading_space: true }
return True;
// CHECK:STDOUT: - { index: 8, kind: 'Return', line: {{ *}}[[@LINE-1]], column: 3, indent: 3, spelling: 'return', has_leading_space: true }
// CHECK:STDOUT: - { index: 9, kind: 'Identifier', line: {{ *}}[[@LINE-2]], column: 10, indent: 3, spelling: 'True', identifier: 2, has_leading_space: true }
// CHECK:STDOUT: - { index: 10, kind: 'Semi', line: {{ *}}[[@LINE-3]], column: 14, indent: 3, spelling: ';' }
// CHECK:STDOUT: - { index: 8, kind: "Return", line: {{ *}}[[@LINE-1]], column: 3, indent: 3, spelling: "return", has_leading_space: true }
// CHECK:STDOUT: - { index: 9, kind: "Identifier", line: {{ *}}[[@LINE-2]], column: 10, indent: 3, spelling: "True", identifier: 2, has_leading_space: true }
// CHECK:STDOUT: - { index: 10, kind: "Semi", line: {{ *}}[[@LINE-3]], column: 14, indent: 3, spelling: ";" }
}
// CHECK:STDOUT: - { index: 11, kind: 'CloseCurlyBrace', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '}', opening_token: 7, has_leading_space: true }
// CHECK:STDOUT: - { index: 11, kind: "CloseCurlyBrace", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "}", opening_token: 7, has_leading_space: true }

// CHECK:STDOUT: - { index: 12, kind: 'FileEnd', line: {{ *}}[[@LINE+0]], column: {{ *\d+}}, indent: 1, spelling: '', has_leading_space: true }
// CHECK:STDOUT: - { index: 12, kind: "FileEnd", line: {{ *}}[[@LINE+0]], column: {{ *\d+}}, indent: 1, spelling: "", has_leading_space: true }
46 changes: 23 additions & 23 deletions toolchain/lex/testdata/fail_bad_raw_identifier.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -19,72 +19,72 @@
// CHECK:STDERR: ^
// CHECK:STDERR:
r#
// CHECK:STDOUT: - { index: 1, kind: 'Identifier', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#' }
// CHECK:STDOUT: - { index: 1, kind: "Identifier", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r", identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: "Error", line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#" }

// Not a valid identifier.
// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
// CHECK:STDERR: r#3
// CHECK:STDERR: ^
// CHECK:STDERR:
r#3
// CHECK:STDOUT: - { index: 3, kind: 'Identifier', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 4, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#' }
// CHECK:STDOUT: - { index: 5, kind: 'IntLiteral', line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: '3', value: `3` }
// CHECK:STDOUT: - { index: 3, kind: "Identifier", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r", identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 4, kind: "Error", line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#" }
// CHECK:STDOUT: - { index: 5, kind: "IntLiteral", line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: "3", value: "3" }

// Non ascii start to identifier.
// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
// CHECK:STDERR: r#á
// CHECK:STDERR: ^
// CHECK:STDERR:
r#á
// CHECK:STDOUT: - { index: 6, kind: 'Identifier', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 7, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#á' }
// CHECK:STDOUT: - { index: 6, kind: "Identifier", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r", identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 7, kind: "Error", line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#\xC3\xA1" }

// Raw `r` identifier doesn't start a second raw identifier.
// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
// CHECK:STDERR: r#r#foo
// CHECK:STDERR: ^
// CHECK:STDERR:
r#r#foo
// CHECK:STDOUT: - { index: 8, kind: 'Identifier', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 9, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: '#' }
// CHECK:STDOUT: - { index: 10, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: 'foo', identifier: 1 }
// CHECK:STDOUT: - { index: 8, kind: "Identifier", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r", identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 9, kind: "Error", line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: "#" }
// CHECK:STDOUT: - { index: 10, kind: "Identifier", line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: "foo", identifier: 1 }

// Other identifier characters don't start a raw identifier.
// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
// CHECK:STDERR: s#foo
// CHECK:STDERR: ^
// CHECK:STDERR:
s#foo
// CHECK:STDOUT: - { index: 11, kind: 'Identifier', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 's', identifier: 2, has_leading_space: true }
// CHECK:STDOUT: - { index: 12, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#' }
// CHECK:STDOUT: - { index: 13, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: 'foo', identifier: 1 }
// CHECK:STDOUT: - { index: 11, kind: "Identifier", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "s", identifier: 2, has_leading_space: true }
// CHECK:STDOUT: - { index: 12, kind: "Error", line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#" }
// CHECK:STDOUT: - { index: 13, kind: "Identifier", line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: "foo", identifier: 1 }

// Identifier ending in `r` doesn't start a raw identifier.
// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
// CHECK:STDERR: arr#foo
// CHECK:STDERR: ^
// CHECK:STDERR:
arr#foo
// CHECK:STDOUT: - { index: 14, kind: 'Identifier', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'arr', identifier: 3, has_leading_space: true }
// CHECK:STDOUT: - { index: 15, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: '#' }
// CHECK:STDOUT: - { index: 16, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: 'foo', identifier: 1 }
// CHECK:STDOUT: - { index: 14, kind: "Identifier", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "arr", identifier: 3, has_leading_space: true }
// CHECK:STDOUT: - { index: 15, kind: "Error", line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: "#" }
// CHECK:STDOUT: - { index: 16, kind: "Identifier", line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: "foo", identifier: 1 }

// Whitespace between `r` and `#` isn't allowed.
// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:3: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
// CHECK:STDERR: r #foo
// CHECK:STDERR: ^
// CHECK:STDERR:
r #foo
// CHECK:STDOUT: - { index: 17, kind: 'Identifier', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 18, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: '#', has_leading_space: true }
// CHECK:STDOUT: - { index: 19, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 4, indent: 1, spelling: 'foo', identifier: 1 }
// CHECK:STDOUT: - { index: 17, kind: "Identifier", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r", identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 18, kind: "Error", line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: "#", has_leading_space: true }
// CHECK:STDOUT: - { index: 19, kind: "Identifier", line: {{ *}}[[@LINE-3]], column: 4, indent: 1, spelling: "foo", identifier: 1 }

// This is an `r` identifier followed by a string literal.
r#"hello"#
// CHECK:STDOUT: - { index: 20, kind: 'Identifier', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 21, kind: 'StringLiteral', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#"hello"#', value: `hello` }
// CHECK:STDOUT: - { index: 20, kind: "Identifier", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r", identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 21, kind: "StringLiteral", line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#\"hello\"#", value: "hello" }

// --- fail_hash_at_start_of_file.carbon
// CHECK:STDOUT: - filename: fail_hash_at_start_of_file.carbon
Expand All @@ -96,5 +96,5 @@ r#"hello"#
// CHECK:STDERR: ^
// CHECK:STDERR:
#foo
// CHECK:STDOUT: - { index: 1, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '#', has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: 'foo', identifier: 0 }
// CHECK:STDOUT: - { index: 1, kind: "Error", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "#", has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: "Identifier", line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "foo", identifier: 0 }
13 changes: 6 additions & 7 deletions toolchain/lex/testdata/fail_block_string_second_line.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ var s: String = '''
// CHECK:STDERR:
// CHECK:STDOUT: - filename: fail_block_string_second_line.carbon
// CHECK:STDOUT: tokens:
// CHECK:STDOUT: - { index: 1, kind: 'Var', line: {{ *}}[[@LINE-17]], column: 1, indent: 1, spelling: 'var', has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-18]], column: 5, indent: 1, spelling: 's', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 3, kind: 'Colon', line: {{ *}}[[@LINE-19]], column: 6, indent: 1, spelling: ':' }
// CHECK:STDOUT: - { index: 4, kind: 'StringTypeLiteral', line: {{ *}}[[@LINE-20]], column: 8, indent: 1, spelling: 'String', has_leading_space: true }
// CHECK:STDOUT: - { index: 5, kind: 'Equal', line: {{ *}}[[@LINE-21]], column: 15, indent: 1, spelling: '=', has_leading_space: true }
// CHECK:STDOUT: - { index: 6, kind: 'StringLiteral', line: {{ *}}[[@LINE-22]], column: 17, indent: 1, spelling: ''''
// CHECK:STDOUT: error here: '''', value: `error here: `, has_leading_space: true }
// CHECK:STDOUT: - { index: 1, kind: "Var", line: {{ *}}[[@LINE-17]], column: 1, indent: 1, spelling: "var", has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: "Identifier", line: {{ *}}[[@LINE-18]], column: 5, indent: 1, spelling: "s", identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 3, kind: "Colon", line: {{ *}}[[@LINE-19]], column: 6, indent: 1, spelling: ":" }
// CHECK:STDOUT: - { index: 4, kind: "StringTypeLiteral", line: {{ *}}[[@LINE-20]], column: 8, indent: 1, spelling: "String", has_leading_space: true }
// CHECK:STDOUT: - { index: 5, kind: "Equal", line: {{ *}}[[@LINE-21]], column: 15, indent: 1, spelling: "=", has_leading_space: true }
// CHECK:STDOUT: - { index: 6, kind: "StringLiteral", line: {{ *}}[[@LINE-22]], column: 17, indent: 1, spelling: "'''\n error here: '''", value: "error here: ", has_leading_space: true }
10 changes: 5 additions & 5 deletions toolchain/lex/testdata/fail_mismatched_brackets.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
// CHECK:STDERR: ^
// CHECK:STDERR:
}
// CHECK:STDOUT: - { index: 1, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '}', has_leading_space: true }
// CHECK:STDOUT: - { index: 1, kind: "Error", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "}", has_leading_space: true }

// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:3: error: closing symbol without a corresponding opening symbol [UnmatchedClosing]
// CHECK:STDERR: ( } )
// CHECK:STDERR: ^
// CHECK:STDERR:
( } )
// CHECK:STDOUT: - { index: 2, kind: 'OpenParen', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '(', closing_token: 4, has_leading_space: true }
// CHECK:STDOUT: - { index: 3, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: '}', has_leading_space: true }
// CHECK:STDOUT: - { index: 4, kind: 'CloseParen', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: ')', opening_token: 2, has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: "OpenParen", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "(", closing_token: 4, has_leading_space: true }
// CHECK:STDOUT: - { index: 3, kind: "Error", line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: "}", has_leading_space: true }
// CHECK:STDOUT: - { index: 4, kind: "CloseParen", line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: ")", opening_token: 2, has_leading_space: true }

// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:1: error: opening symbol without a corresponding closing symbol [UnmatchedOpening]
// CHECK:STDERR: [
// CHECK:STDERR: ^
// CHECK:STDERR:
[
// CHECK:STDOUT: - { index: 5, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '[', has_leading_space: true }
// CHECK:STDOUT: - { index: 5, kind: "Error", line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "[", has_leading_space: true }
Loading

0 comments on commit b06fcc9

Please sign in to comment.