Skip to content

Commit

Permalink
Modify lex yaml output to elide FileStart/End in tests. (#4433)
Browse files Browse the repository at this point in the history
Trying to make split file tests of lex functionality shorter and easier
to read. numeric_literals.carbon in particular has an example of why I'm
interested in this (at the bottom). This also switches from `[]` list
format to `-` list format so that the trailing `]` is removed.

Trimming comments in tokenized_buffer.h because (1) it feels like it's
giving too much detail about what's printed, which has drifted slightly
and (2) it also feels like it's trying to justify YAML output, when
that's just what we're doing in general.

---------

Co-authored-by: Geoff Romer <[email protected]>
  • Loading branch information
jonmeow and geoffromer authored Oct 23, 2024
1 parent d1c6f01 commit 06f4eec
Show file tree
Hide file tree
Showing 23 changed files with 233 additions and 311 deletions.
13 changes: 12 additions & 1 deletion toolchain/driver/compile_subcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ Dump the tokens to stdout when lexed.
)""",
},
[&](auto& arg_b) { arg_b.Set(&dump_tokens); });

b.AddFlag(
{
.name = "omit-file-boundary-tokens",
.help = R"""(
For `--dump-tokens`, omit file start and end boundary tokens.
)""",
},
[&](auto& arg_b) { arg_b.Set(&omit_file_boundary_tokens); });

b.AddFlag(
{
.name = "dump-parse-tree",
Expand Down Expand Up @@ -356,7 +366,8 @@ class CompilationUnit {
[&] { tokens_ = Lex::Lex(value_stores_, *source_, *consumer_); });
if (options_.dump_tokens && IncludeInDumps()) {
consumer_->Flush();
driver_env_->output_stream << tokens_;
tokens_->Print(driver_env_->output_stream,
options_.omit_file_boundary_tokens);
}
if (mem_usage_) {
mem_usage_->Collect("tokens_", *tokens_);
Expand Down
1 change: 1 addition & 0 deletions toolchain/driver/compile_subcommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct CompileOptions {
bool force_obj_output = false;
bool dump_shared_values = false;
bool dump_tokens = false;
bool omit_file_boundary_tokens = false;
bool dump_parse_tree = false;
bool dump_raw_sem_ir = false;
bool dump_sem_ir = false;
Expand Down
32 changes: 17 additions & 15 deletions toolchain/lex/testdata/basic_syntax.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Dump all tokens so that we include the file start and end.
// ARGS: compile --phase=lex --dump-tokens %s
//
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/basic_syntax.carbon
// TIP: To dump output, run:
// 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: tokens:
// 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+1]], column: {{ *\d+}}, indent: 1, spelling: '', has_leading_space: true },
// CHECK:STDOUT: ]
// CHECK:STDOUT: - { index: 12, kind: 'FileEnd', line: {{ *}}[[@LINE+0]], column: {{ *\d+}}, indent: 1, spelling: '', has_leading_space: true }
7 changes: 2 additions & 5 deletions toolchain/lex/testdata/fail_bad_comment_introducers.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_bad_comment_introducers.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_bad_comment_introducers.carbon
// CHECK:STDOUT: - filename: fail_bad_comment_introducers.carbon
// CHECK:STDOUT: tokens: [
// CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' },
//

// Comments have to have whitespace after `//` currently.
Expand Down Expand Up @@ -58,5 +55,5 @@

// An extra un-indented comment line to anchor the end of the file checks.

// CHECK:STDOUT: { index: 1, kind: 'FileEnd', line: {{ *}}[[@LINE+1]], column: {{ *\d+}}, indent: 1, spelling: '', has_leading_space: true },
// CHECK:STDOUT: ]
// CHECK:STDOUT: - filename: fail_bad_comment_introducers.carbon
// CHECK:STDOUT: tokens:
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-19]]:3: error: whitespace is required after '//' [NoWhitespaceAfterCommentIntroducer]
// CHECK:STDERR: //abc
// CHECK:STDERR: ^
// CHECK:STDOUT: - filename: fail_bad_comment_introducers_mid_block_indent_change.carbon
// CHECK:STDOUT: tokens: [
// CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' },

// CHECK:STDOUT: { index: 1, kind: 'FileEnd', line: {{ *}}[[@LINE+1]], column: {{ *\d+}}, indent: 1, spelling: '', has_leading_space: true },
// CHECK:STDOUT: ]
// CHECK:STDOUT: - filename: fail_bad_comment_introducers_mid_block_indent_change.carbon
// CHECK:STDOUT: tokens:
57 changes: 25 additions & 32 deletions toolchain/lex/testdata/fail_bad_raw_identifier.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

// --- fail_bad_raw_identifier.carbon
// CHECK:STDOUT: - filename: fail_bad_raw_identifier.carbon
// CHECK:STDOUT: tokens: [
// CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' },
// CHECK:STDOUT: tokens:


// Missing the character after `#`.
Expand All @@ -20,87 +19,81 @@
// 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: '#á' }

// 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` }

// CHECK:STDOUT: { index: 22, kind: 'FileEnd', line: {{ *}}[[@LINE+1]], column: {{ *\d+}}, indent: 1, spelling: '', has_leading_space: true },
// CHECK:STDOUT: ]
// --- fail_hash_at_start_of_file.carbon
// CHECK:STDOUT: - filename: fail_hash_at_start_of_file.carbon
// CHECK:STDOUT: tokens: [
// CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' },
// CHECK:STDOUT: tokens:

// Ensure that we correctly handle a `#` as the first token in the file.
// CHECK:STDERR: fail_hash_at_start_of_file.carbon:[[@LINE+3]]:1: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
// CHECK:STDERR: #foo
// 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: 3, kind: 'FileEnd', line: {{ *}}[[@LINE+1]], column: {{ *\d+}}, indent: 1, spelling: '', has_leading_space: true },
// CHECK:STDOUT: ]
// 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 }
20 changes: 8 additions & 12 deletions toolchain/lex/testdata/fail_block_string_second_line.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ var s: String = '''
// CHECK:STDERR: error here: '''
// CHECK:STDERR: ^
// CHECK:STDOUT: - filename: fail_block_string_second_line.carbon
// CHECK:STDOUT: tokens: [
// CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' },
// 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: 7, kind: 'FileEnd', line: {{ *}}[[@LINE+1]], column: {{ *\d+}}, indent: 1, spelling: '', has_leading_space: true },
// CHECK:STDOUT: ]
// CHECK:STDOUT: tokens:
// CHECK:STDOUT: - { index: 1, kind: 'Var', line: {{ *}}[[@LINE-16]], column: 1, indent: 1, spelling: 'var', has_leading_space: true }
// CHECK:STDOUT: - { index: 2, kind: 'Identifier', line: {{ *}}[[@LINE-17]], column: 5, indent: 1, spelling: 's', identifier: 0, has_leading_space: true }
// CHECK:STDOUT: - { index: 3, kind: 'Colon', line: {{ *}}[[@LINE-18]], column: 6, indent: 1, spelling: ':' }
// CHECK:STDOUT: - { index: 4, kind: 'StringTypeLiteral', line: {{ *}}[[@LINE-19]], column: 8, indent: 1, spelling: 'String', has_leading_space: true }
// CHECK:STDOUT: - { index: 5, kind: 'Equal', line: {{ *}}[[@LINE-20]], column: 15, indent: 1, spelling: '=', has_leading_space: true }
// CHECK:STDOUT: - { index: 6, kind: 'StringLiteral', line: {{ *}}[[@LINE-21]], column: 17, indent: 1, spelling: ''''
// CHECK:STDOUT: error here: '''', value: `error here: `, has_leading_space: true }
Loading

0 comments on commit 06f4eec

Please sign in to comment.