Skip to content

Commit 519718e

Browse files
committed
Start simple string at quote mark
1 parent 3397737 commit 519718e

11 files changed

Lines changed: 31 additions & 33 deletions

‎parser/src/lexer.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ where
492492
is_unicode: bool,
493493
is_fstring: bool,
494494
) -> LexResult {
495+
let start_pos = self.get_pos();
495496
let quote_char = self.next_char().unwrap();
496497
let mut string_content = String::new();
497-
let start_pos = self.get_pos();
498498

499499
// If the next two characters are also the quote character, then we have a triple-quoted
500500
// string; consume those two characters and ensure that we require a triple-quote to close

‎parser/src/snapshots/rustpython_parser__parser__tests__parse_class.snap‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
source: parser/src/parser.rs
3-
expression: parse_program(&source).unwrap()
2+
source: compiler/parser/src/parser.rs
3+
expression: "parse_program(source, \"<test>\").unwrap()"
44
---
55
[
66
Located {
@@ -126,7 +126,7 @@ expression: parse_program(&source).unwrap()
126126
Located {
127127
location: Location {
128128
row: 4,
129-
column: 37,
129+
column: 36,
130130
},
131131
custom: (),
132132
node: Constant {

‎parser/src/snapshots/rustpython_parser__parser__tests__parse_kwargs.snap‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
source: parser/src/parser.rs
2+
source: compiler/parser/src/parser.rs
33
expression: parse_ast
4-
54
---
65
[
76
Located {
@@ -33,7 +32,7 @@ expression: parse_ast
3332
Located {
3433
location: Location {
3534
row: 1,
36-
column: 10,
35+
column: 9,
3736
},
3837
custom: (),
3938
node: Constant {

‎parser/src/snapshots/rustpython_parser__parser__tests__parse_print_2.snap‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
source: parser/src/parser.rs
2+
source: compiler/parser/src/parser.rs
33
expression: parse_ast
4-
54
---
65
[
76
Located {
@@ -33,7 +32,7 @@ expression: parse_ast
3332
Located {
3433
location: Location {
3534
row: 1,
36-
column: 8,
35+
column: 7,
3736
},
3837
custom: (),
3938
node: Constant {

‎parser/src/snapshots/rustpython_parser__parser__tests__parse_print_hello.snap‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
source: parser/src/parser.rs
2+
source: compiler/parser/src/parser.rs
33
expression: parse_ast
44
---
55
[
@@ -32,7 +32,7 @@ expression: parse_ast
3232
Located {
3333
location: Location {
3434
row: 1,
35-
column: 8,
35+
column: 7,
3636
},
3737
custom: (),
3838
node: Constant {

‎parser/src/snapshots/rustpython_parser__parser__tests__parse_string.snap‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
source: parser/src/parser.rs
2+
source: compiler/parser/src/parser.rs
33
expression: parse_ast
44
---
55
[
66
Located {
77
location: Location {
88
row: 1,
9-
column: 2,
9+
column: 1,
1010
},
1111
custom: (),
1212
node: Expr {
1313
value: Located {
1414
location: Location {
1515
row: 1,
16-
column: 2,
16+
column: 1,
1717
},
1818
custom: (),
1919
node: Constant {

‎parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_1.snap‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
---
2-
source: parser/src/string.rs
2+
source: compiler/parser/src/string.rs
33
expression: parse_ast
44
---
55
[
66
Located {
77
location: Location {
88
row: 1,
9-
column: 2,
9+
column: 1,
1010
},
1111
custom: (),
1212
node: Expr {
1313
value: Located {
1414
location: Location {
1515
row: 1,
16-
column: 2,
16+
column: 1,
1717
},
1818
custom: (),
1919
node: JoinedStr {
2020
values: [
2121
Located {
2222
location: Location {
2323
row: 1,
24-
column: 2,
24+
column: 1,
2525
},
2626
custom: (),
2727
node: Constant {

‎parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_2.snap‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
---
2-
source: parser/src/string.rs
2+
source: compiler/parser/src/string.rs
33
expression: parse_ast
44
---
55
[
66
Located {
77
location: Location {
88
row: 1,
9-
column: 2,
9+
column: 1,
1010
},
1111
custom: (),
1212
node: Expr {
1313
value: Located {
1414
location: Location {
1515
row: 1,
16-
column: 2,
16+
column: 1,
1717
},
1818
custom: (),
1919
node: JoinedStr {
2020
values: [
2121
Located {
2222
location: Location {
2323
row: 1,
24-
column: 2,
24+
column: 1,
2525
},
2626
custom: (),
2727
node: Constant {

‎parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_3.snap‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ expression: parse_ast
66
Located {
77
location: Location {
88
row: 1,
9-
column: 2,
9+
column: 1,
1010
},
1111
custom: (),
1212
node: Expr {
1313
value: Located {
1414
location: Location {
1515
row: 1,
16-
column: 2,
16+
column: 1,
1717
},
1818
custom: (),
1919
node: JoinedStr {
2020
values: [
2121
Located {
2222
location: Location {
2323
row: 1,
24-
column: 2,
24+
column: 1,
2525
},
2626
custom: (),
2727
node: Constant {
@@ -41,7 +41,7 @@ expression: parse_ast
4141
value: Located {
4242
location: Location {
4343
row: 1,
44-
column: 3,
44+
column: 2,
4545
},
4646
custom: (),
4747
node: Constant {

‎parser/src/snapshots/rustpython_parser__string__tests__parse_string_concat.snap‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
source: parser/src/string.rs
2+
source: compiler/parser/src/string.rs
33
expression: parse_ast
44
---
55
[
66
Located {
77
location: Location {
88
row: 1,
9-
column: 2,
9+
column: 1,
1010
},
1111
custom: (),
1212
node: Expr {
1313
value: Located {
1414
location: Location {
1515
row: 1,
16-
column: 2,
16+
column: 1,
1717
},
1818
custom: (),
1919
node: Constant {

0 commit comments

Comments
 (0)