1919// CHECK:STDERR: ^
2020// CHECK:STDERR:
2121r#
22- // CHECK:STDOUT: - { index: 1, kind: ' Identifier' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r' , identifier: 0, has_leading_space: true }
23- // CHECK:STDOUT: - { index: 2, kind: ' Error' , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#' }
22+ // CHECK:STDOUT: - { index: 1, kind: " Identifier" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r" , identifier: 0, has_leading_space: true }
23+ // CHECK:STDOUT: - { index: 2, kind: " Error" , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#" }
2424
2525// Not a valid identifier.
2626// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
2727// CHECK:STDERR: r#3
2828// CHECK:STDERR: ^
2929// CHECK:STDERR:
3030r#3
31- // CHECK:STDOUT: - { index: 3, kind: ' Identifier' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r' , identifier: 0, has_leading_space: true }
32- // CHECK:STDOUT: - { index: 4, kind: ' Error' , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#' }
33- // CHECK:STDOUT: - { index: 5, kind: ' IntLiteral' , line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: '3' , value: `3` }
31+ // CHECK:STDOUT: - { index: 3, kind: " Identifier" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r" , identifier: 0, has_leading_space: true }
32+ // CHECK:STDOUT: - { index: 4, kind: " Error" , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#" }
33+ // CHECK:STDOUT: - { index: 5, kind: " IntLiteral" , line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: "3" , value: "3" }
3434
3535// Non ascii start to identifier.
3636// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
3737// CHECK:STDERR: r#á
3838// CHECK:STDERR: ^
3939// CHECK:STDERR:
4040r#á
41- // CHECK:STDOUT: - { index: 6, kind: ' Identifier' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r' , identifier: 0, has_leading_space: true }
42- // CHECK:STDOUT: - { index: 7, kind: ' Error' , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#á' }
41+ // CHECK:STDOUT: - { index: 6, kind: " Identifier" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r" , identifier: 0, has_leading_space: true }
42+ // CHECK:STDOUT: - { index: 7, kind: " Error" , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#\xC3\xA1" }
4343
4444// Raw `r` identifier doesn't start a second raw identifier.
4545// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
4646// CHECK:STDERR: r#r#foo
4747// CHECK:STDERR: ^
4848// CHECK:STDERR:
4949r#r#foo
50- // CHECK:STDOUT: - { index: 8, kind: ' Identifier' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r' , identifier: 0, has_leading_space: true }
51- // CHECK:STDOUT: - { index: 9, kind: ' Error' , line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: '#' }
52- // CHECK:STDOUT: - { index: 10, kind: ' Identifier' , line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: ' foo' , identifier: 1 }
50+ // CHECK:STDOUT: - { index: 8, kind: " Identifier" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r" , identifier: 0, has_leading_space: true }
51+ // CHECK:STDOUT: - { index: 9, kind: " Error" , line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: "#" }
52+ // CHECK:STDOUT: - { index: 10, kind: " Identifier" , line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: " foo" , identifier: 1 }
5353
5454// Other identifier characters don't start a raw identifier.
5555// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
5656// CHECK:STDERR: s#foo
5757// CHECK:STDERR: ^
5858// CHECK:STDERR:
5959s#foo
60- // CHECK:STDOUT: - { index: 11, kind: ' Identifier' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 's' , identifier: 2, has_leading_space: true }
61- // CHECK:STDOUT: - { index: 12, kind: ' Error' , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#' }
62- // CHECK:STDOUT: - { index: 13, kind: ' Identifier' , line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: ' foo' , identifier: 1 }
60+ // CHECK:STDOUT: - { index: 11, kind: " Identifier" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "s" , identifier: 2, has_leading_space: true }
61+ // CHECK:STDOUT: - { index: 12, kind: " Error" , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#" }
62+ // CHECK:STDOUT: - { index: 13, kind: " Identifier" , line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: " foo" , identifier: 1 }
6363
6464// Identifier ending in `r` doesn't start a raw identifier.
6565// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
6666// CHECK:STDERR: arr#foo
6767// CHECK:STDERR: ^
6868// CHECK:STDERR:
6969arr#foo
70- // CHECK:STDOUT: - { index: 14, kind: ' Identifier' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: ' arr' , identifier: 3, has_leading_space: true }
71- // CHECK:STDOUT: - { index: 15, kind: ' Error' , line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: '#' }
72- // CHECK:STDOUT: - { index: 16, kind: ' Identifier' , line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: ' foo' , identifier: 1 }
70+ // CHECK:STDOUT: - { index: 14, kind: " Identifier" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: " arr" , identifier: 3, has_leading_space: true }
71+ // CHECK:STDOUT: - { index: 15, kind: " Error" , line: {{ *}}[[@LINE-2]], column: 4, indent: 1, spelling: "#" }
72+ // CHECK:STDOUT: - { index: 16, kind: " Identifier" , line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: " foo" , identifier: 1 }
7373
7474// Whitespace between `r` and `#` isn't allowed.
7575// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:3: error: encountered unrecognized characters while parsing [UnrecognizedCharacters]
7676// CHECK:STDERR: r #foo
7777// CHECK:STDERR: ^
7878// CHECK:STDERR:
7979r #foo
80- // CHECK:STDOUT: - { index: 17, kind: ' Identifier' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r' , identifier: 0, has_leading_space: true }
81- // CHECK:STDOUT: - { index: 18, kind: ' Error' , line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: '#' , has_leading_space: true }
82- // CHECK:STDOUT: - { index: 19, kind: ' Identifier' , line: {{ *}}[[@LINE-3]], column: 4, indent: 1, spelling: ' foo' , identifier: 1 }
80+ // CHECK:STDOUT: - { index: 17, kind: " Identifier" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r" , identifier: 0, has_leading_space: true }
81+ // CHECK:STDOUT: - { index: 18, kind: " Error" , line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: "#" , has_leading_space: true }
82+ // CHECK:STDOUT: - { index: 19, kind: " Identifier" , line: {{ *}}[[@LINE-3]], column: 4, indent: 1, spelling: " foo" , identifier: 1 }
8383
8484// This is an `r` identifier followed by a string literal.
8585r#"hello" #
86- // CHECK:STDOUT: - { index: 20, kind: ' Identifier' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: 'r' , identifier: 0, has_leading_space: true }
87- // CHECK:STDOUT: - { index: 21, kind: ' StringLiteral' , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '# "hello"#' , value: ` hello` }
86+ // CHECK:STDOUT: - { index: 20, kind: " Identifier" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "r" , identifier: 0, has_leading_space: true }
87+ // CHECK:STDOUT: - { index: 21, kind: " StringLiteral" , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: "#\ "hello\"#" , value: " hello" }
8888
8989// --- fail_hash_at_start_of_file.carbon
9090// CHECK:STDOUT: - filename: fail_hash_at_start_of_file.carbon
@@ -96,5 +96,5 @@ r#"hello"#
9696// CHECK:STDERR: ^
9797// CHECK:STDERR:
9898#foo
99- // CHECK:STDOUT: - { index: 1, kind: ' Error' , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '#' , has_leading_space: true }
100- // CHECK:STDOUT: - { index: 2, kind: ' Identifier' , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: ' foo' , identifier: 0 }
99+ // CHECK:STDOUT: - { index: 1, kind: " Error" , line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: "#" , has_leading_space: true }
100+ // CHECK:STDOUT: - { index: 2, kind: " Identifier" , line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: " foo" , identifier: 0 }
0 commit comments