mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-14 16:45:25 +00:00
Start simple string at quote mark
This commit is contained in:
parent
15e2ac3fd7
commit
ca62bd1593
11 changed files with 31 additions and 33 deletions
|
@ -492,9 +492,9 @@ where
|
|||
is_unicode: bool,
|
||||
is_fstring: bool,
|
||||
) -> LexResult {
|
||||
let start_pos = self.get_pos();
|
||||
let quote_char = self.next_char().unwrap();
|
||||
let mut string_content = String::new();
|
||||
let start_pos = self.get_pos();
|
||||
|
||||
// If the next two characters are also the quote character, then we have a triple-quoted
|
||||
// string; consume those two characters and ensure that we require a triple-quote to close
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_program(&source).unwrap()
|
||||
source: compiler/parser/src/parser.rs
|
||||
expression: "parse_program(source, \"<test>\").unwrap()"
|
||||
---
|
||||
[
|
||||
Located {
|
||||
|
@ -126,7 +126,7 @@ expression: parse_program(&source).unwrap()
|
|||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 37,
|
||||
column: 36,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
source: compiler/parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
|
||||
---
|
||||
[
|
||||
Located {
|
||||
|
@ -33,7 +32,7 @@ expression: parse_ast
|
|||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
column: 9,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
source: compiler/parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
|
||||
---
|
||||
[
|
||||
Located {
|
||||
|
@ -33,7 +32,7 @@ expression: parse_ast
|
|||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
source: compiler/parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -32,7 +32,7 @@ expression: parse_ast
|
|||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
source: compiler/parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
source: compiler/parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
|
@ -21,7 +21,7 @@ expression: parse_ast
|
|||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
source: compiler/parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
|
@ -21,7 +21,7 @@ expression: parse_ast
|
|||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -6,14 +6,14 @@ expression: parse_ast
|
|||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
|
@ -21,7 +21,7 @@ expression: parse_ast
|
|||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
@ -41,7 +41,7 @@ expression: parse_ast
|
|||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
source: compiler/parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
source: compiler/parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue