mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 07:04:37 +00:00
Add range to lexer test snapshots (#7265)
## Summary This PR updates the lexer test snapshots to include the range value as well. This is mainly a mechanical refactor. ### Motivation The main motivation is so that we can verify that the ranges are valid and do not overlap. ## Test Plan `cargo test`
This commit is contained in:
parent
24b848a4ea
commit
a41bb2733f
44 changed files with 2197 additions and 871 deletions
|
@ -1273,17 +1273,20 @@ mod tests {
|
||||||
const MAC_EOL: &str = "\r";
|
const MAC_EOL: &str = "\r";
|
||||||
const UNIX_EOL: &str = "\n";
|
const UNIX_EOL: &str = "\n";
|
||||||
|
|
||||||
fn lex_source(source: &str) -> Vec<Tok> {
|
fn lex_source_with_mode(source: &str, mode: Mode) -> Vec<Spanned> {
|
||||||
let lexer = lex(source, Mode::Module);
|
let lexer = lex(source, mode);
|
||||||
lexer.map(|result| result.unwrap().0).collect()
|
lexer.map(std::result::Result::unwrap).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lex_jupyter_source(source: &str) -> Vec<Tok> {
|
fn lex_source(source: &str) -> Vec<Spanned> {
|
||||||
let lexer = lex(source, Mode::Ipython);
|
lex_source_with_mode(source, Mode::Module)
|
||||||
lexer.map(|x| x.unwrap().0).collect()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ipython_escape_command_line_continuation_eol(eol: &str) -> Vec<Tok> {
|
fn lex_jupyter_source(source: &str) -> Vec<Spanned> {
|
||||||
|
lex_source_with_mode(source, Mode::Ipython)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn ipython_escape_command_line_continuation_eol(eol: &str) -> Vec<Spanned> {
|
||||||
let source = format!("%matplotlib \\{eol} --inline");
|
let source = format!("%matplotlib \\{eol} --inline");
|
||||||
lex_jupyter_source(&source)
|
lex_jupyter_source(&source)
|
||||||
}
|
}
|
||||||
|
@ -1303,7 +1306,7 @@ mod tests {
|
||||||
assert_debug_snapshot!(ipython_escape_command_line_continuation_eol(WINDOWS_EOL));
|
assert_debug_snapshot!(ipython_escape_command_line_continuation_eol(WINDOWS_EOL));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ipython_escape_command_line_continuation_with_eol_and_eof(eol: &str) -> Vec<Tok> {
|
fn ipython_escape_command_line_continuation_with_eol_and_eof(eol: &str) -> Vec<Spanned> {
|
||||||
let source = format!("%matplotlib \\{eol}");
|
let source = format!("%matplotlib \\{eol}");
|
||||||
lex_jupyter_source(&source)
|
lex_jupyter_source(&source)
|
||||||
}
|
}
|
||||||
|
@ -1403,8 +1406,8 @@ baz = %matplotlib \
|
||||||
assert_debug_snapshot!(lex_jupyter_source(source));
|
assert_debug_snapshot!(lex_jupyter_source(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn assert_no_ipython_escape_command(tokens: &[Tok]) {
|
fn assert_no_ipython_escape_command(tokens: &[Spanned]) {
|
||||||
for tok in tokens {
|
for (tok, _) in tokens {
|
||||||
if let Tok::IpyEscapeCommand { .. } = tok {
|
if let Tok::IpyEscapeCommand { .. } = tok {
|
||||||
panic!("Unexpected escape command token: {tok:?}")
|
panic!("Unexpected escape command token: {tok:?}")
|
||||||
}
|
}
|
||||||
|
@ -1458,7 +1461,7 @@ def f(arg=%timeit a = b):
|
||||||
assert_debug_snapshot!(lex_source(&source));
|
assert_debug_snapshot!(lex_source(&source));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn comment_until_eol(eol: &str) -> Vec<Tok> {
|
fn comment_until_eol(eol: &str) -> Vec<Spanned> {
|
||||||
let source = format!("123 # Foo{eol}456");
|
let source = format!("123 # Foo{eol}456");
|
||||||
lex_source(&source)
|
lex_source(&source)
|
||||||
}
|
}
|
||||||
|
@ -1484,7 +1487,7 @@ def f(arg=%timeit a = b):
|
||||||
assert_debug_snapshot!(lex_source(source));
|
assert_debug_snapshot!(lex_source(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn indentation_with_eol(eol: &str) -> Vec<Tok> {
|
fn indentation_with_eol(eol: &str) -> Vec<Spanned> {
|
||||||
let source = format!("def foo():{eol} return 99{eol}{eol}");
|
let source = format!("def foo():{eol} return 99{eol}{eol}");
|
||||||
lex_source(&source)
|
lex_source(&source)
|
||||||
}
|
}
|
||||||
|
@ -1504,7 +1507,7 @@ def f(arg=%timeit a = b):
|
||||||
assert_debug_snapshot!(indentation_with_eol(WINDOWS_EOL));
|
assert_debug_snapshot!(indentation_with_eol(WINDOWS_EOL));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn double_dedent_with_eol(eol: &str) -> Vec<Tok> {
|
fn double_dedent_with_eol(eol: &str) -> Vec<Spanned> {
|
||||||
let source = format!("def foo():{eol} if x:{eol}{eol} return 99{eol}{eol}");
|
let source = format!("def foo():{eol} if x:{eol}{eol} return 99{eol}{eol}");
|
||||||
lex_source(&source)
|
lex_source(&source)
|
||||||
}
|
}
|
||||||
|
@ -1524,7 +1527,7 @@ def f(arg=%timeit a = b):
|
||||||
assert_debug_snapshot!(double_dedent_with_eol(WINDOWS_EOL));
|
assert_debug_snapshot!(double_dedent_with_eol(WINDOWS_EOL));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn double_dedent_with_tabs_eol(eol: &str) -> Vec<Tok> {
|
fn double_dedent_with_tabs_eol(eol: &str) -> Vec<Spanned> {
|
||||||
let source = format!("def foo():{eol}\tif x:{eol}{eol}\t\t return 99{eol}{eol}");
|
let source = format!("def foo():{eol}\tif x:{eol}{eol}\t\t return 99{eol}{eol}");
|
||||||
lex_source(&source)
|
lex_source(&source)
|
||||||
}
|
}
|
||||||
|
@ -1544,7 +1547,7 @@ def f(arg=%timeit a = b):
|
||||||
assert_debug_snapshot!(double_dedent_with_tabs_eol(WINDOWS_EOL));
|
assert_debug_snapshot!(double_dedent_with_tabs_eol(WINDOWS_EOL));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn newline_in_brackets_eol(eol: &str) -> Vec<Tok> {
|
fn newline_in_brackets_eol(eol: &str) -> Vec<Spanned> {
|
||||||
let source = r"x = [
|
let source = r"x = [
|
||||||
|
|
||||||
1,2
|
1,2
|
||||||
|
@ -1604,7 +1607,7 @@ def f(arg=%timeit a = b):
|
||||||
assert_debug_snapshot!(lex_source(source));
|
assert_debug_snapshot!(lex_source(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn string_continuation_with_eol(eol: &str) -> Vec<Tok> {
|
fn string_continuation_with_eol(eol: &str) -> Vec<Spanned> {
|
||||||
let source = format!("\"abc\\{eol}def\"");
|
let source = format!("\"abc\\{eol}def\"");
|
||||||
lex_source(&source)
|
lex_source(&source)
|
||||||
}
|
}
|
||||||
|
@ -1630,7 +1633,7 @@ def f(arg=%timeit a = b):
|
||||||
assert_debug_snapshot!(lex_source(source));
|
assert_debug_snapshot!(lex_source(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn triple_quoted_eol(eol: &str) -> Vec<Tok> {
|
fn triple_quoted_eol(eol: &str) -> Vec<Spanned> {
|
||||||
let source = format!("\"\"\"{eol} test string{eol} \"\"\"");
|
let source = format!("\"\"\"{eol} test string{eol} \"\"\"");
|
||||||
lex_source(&source)
|
lex_source(&source)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,20 +3,44 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(source)
|
expression: lex_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "a_variable",
|
name: "a_variable",
|
||||||
},
|
},
|
||||||
|
0..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Equal,
|
Equal,
|
||||||
|
11..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
13..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Plus,
|
Plus,
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
Minus,
|
Minus,
|
||||||
|
19..20,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 0,
|
value: 0,
|
||||||
},
|
},
|
||||||
|
20..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
21..21,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,17 +1,32 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: comment_until_eol(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 123,
|
value: 123,
|
||||||
},
|
},
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"# Foo",
|
"# Foo",
|
||||||
),
|
),
|
||||||
|
5..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 456,
|
value: 456,
|
||||||
},
|
},
|
||||||
|
11..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
14..14,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,17 +1,32 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: comment_until_eol(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 123,
|
value: 123,
|
||||||
},
|
},
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"# Foo",
|
"# Foo",
|
||||||
),
|
),
|
||||||
|
5..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 456,
|
value: 456,
|
||||||
},
|
},
|
||||||
|
11..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
14..14,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,17 +1,32 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: comment_until_eol(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 123,
|
value: 123,
|
||||||
},
|
},
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"# Foo",
|
"# Foo",
|
||||||
),
|
),
|
||||||
|
5..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 456,
|
value: 456,
|
||||||
},
|
},
|
||||||
|
12..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
15..15,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,31 +1,88 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: double_dedent_with_eol(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
11..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
If,
|
If,
|
||||||
|
12..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
19..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
21..27,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
28..30,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
30..31,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
31..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
32..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
32..32,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,31 +1,88 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: double_dedent_with_tabs_eol(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
11..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
If,
|
If,
|
||||||
|
12..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
19..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
22..28,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
29..31,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
31..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
32..33,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
33..33,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
33..33,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,31 +1,88 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: double_dedent_with_tabs_eol(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
11..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
If,
|
If,
|
||||||
|
12..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
19..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
22..28,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
29..31,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
31..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
32..33,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
33..33,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
33..33,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,31 +1,88 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: double_dedent_with_tabs_eol(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
12..13,
|
||||||
|
),
|
||||||
|
(
|
||||||
If,
|
If,
|
||||||
|
13..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
18..20,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
20..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
22..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
25..31,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
32..34,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
34..36,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
36..38,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
38..38,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
38..38,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,31 +1,88 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: double_dedent_with_eol(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
11..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
If,
|
If,
|
||||||
|
12..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
19..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
21..27,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
28..30,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
30..31,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
31..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
32..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
32..32,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,31 +1,88 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: double_dedent_with_eol(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
12..13,
|
||||||
|
),
|
||||||
|
(
|
||||||
If,
|
If,
|
||||||
|
13..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
18..20,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
20..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
22..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
24..30,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
31..33,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
33..35,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
35..37,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
37..37,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
37..37,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,49 +3,103 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(source)
|
expression: lex_jupyter_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
0..1,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
1..2,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: Magic2,
|
kind: Magic2,
|
||||||
},
|
},
|
||||||
|
2..4,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
4..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: Shell,
|
kind: Shell,
|
||||||
},
|
},
|
||||||
|
5..6,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
6..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: ShCap,
|
kind: ShCap,
|
||||||
},
|
},
|
||||||
|
7..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: Help,
|
kind: Help,
|
||||||
},
|
},
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
11..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
12..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
14..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: Paren,
|
kind: Paren,
|
||||||
},
|
},
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: Quote,
|
kind: Quote,
|
||||||
},
|
},
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "",
|
value: "",
|
||||||
kind: Quote2,
|
kind: Quote2,
|
||||||
},
|
},
|
||||||
|
19..20,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
20..20,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,10 +3,16 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(source)
|
expression: lex_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\\N{EN SPACE}",
|
value: "\\N{EN SPACE}",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
0..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
14..14,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,22 +1,58 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: indentation_with_eol(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
11..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
15..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
22..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
24..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
25..26,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
26..26,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,22 +1,58 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: indentation_with_eol(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
11..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
15..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
22..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
24..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
25..26,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
26..26,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,22 +1,58 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: indentation_with_eol(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Def,
|
Def,
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
12..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Return,
|
Return,
|
||||||
|
16..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99,
|
value: 99,
|
||||||
},
|
},
|
||||||
|
23..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
25..27,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
27..29,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
29..29,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,59 +3,125 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(source)
|
expression: lex_jupyter_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help,
|
kind: Help,
|
||||||
},
|
},
|
||||||
|
0..4,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
4..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
5..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "timeit a = b",
|
value: "timeit a = b",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
11..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
24..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "timeit a % 3",
|
value: "timeit a % 3",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
25..38,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
38..39,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib --inline",
|
value: "matplotlib --inline",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
39..65,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
65..66,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "pwd && ls -a | sed 's/^/\\\\ /'",
|
value: "pwd && ls -a | sed 's/^/\\\\ /'",
|
||||||
kind: Shell,
|
kind: Shell,
|
||||||
},
|
},
|
||||||
|
66..103,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
103..104,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "cd /Users/foo/Library/Application\\ Support/",
|
value: "cd /Users/foo/Library/Application\\ Support/",
|
||||||
kind: ShCap,
|
kind: ShCap,
|
||||||
},
|
},
|
||||||
|
104..149,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
149..150,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo 1 2",
|
value: "foo 1 2",
|
||||||
kind: Paren,
|
kind: Paren,
|
||||||
},
|
},
|
||||||
|
150..158,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
158..159,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo 1 2",
|
value: "foo 1 2",
|
||||||
kind: Quote,
|
kind: Quote,
|
||||||
},
|
},
|
||||||
|
159..167,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
167..168,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo 1 2",
|
value: "foo 1 2",
|
||||||
kind: Quote2,
|
kind: Quote2,
|
||||||
},
|
},
|
||||||
|
168..176,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
176..177,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "ls",
|
value: "ls",
|
||||||
kind: Shell,
|
kind: Shell,
|
||||||
},
|
},
|
||||||
|
177..180,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
180..180,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,40 +3,88 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(source)
|
expression: lex_jupyter_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "pwd",
|
name: "pwd",
|
||||||
},
|
},
|
||||||
|
0..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Equal,
|
Equal,
|
||||||
|
4..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "pwd",
|
value: "pwd",
|
||||||
kind: Shell,
|
kind: Shell,
|
||||||
},
|
},
|
||||||
|
6..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
},
|
},
|
||||||
|
11..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Equal,
|
Equal,
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "timeit a = b",
|
value: "timeit a = b",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
17..30,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
30..31,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "bar",
|
name: "bar",
|
||||||
},
|
},
|
||||||
|
31..34,
|
||||||
|
),
|
||||||
|
(
|
||||||
Equal,
|
Equal,
|
||||||
|
35..36,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "timeit a % 3",
|
value: "timeit a % 3",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
37..50,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
50..51,
|
||||||
|
),
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "baz",
|
name: "baz",
|
||||||
},
|
},
|
||||||
|
51..54,
|
||||||
|
),
|
||||||
|
(
|
||||||
Equal,
|
Equal,
|
||||||
|
55..56,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib inline",
|
value: "matplotlib inline",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
57..85,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
85..85,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,15 +3,39 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(source)
|
expression: lex_jupyter_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
If,
|
If,
|
||||||
|
0..2,
|
||||||
|
),
|
||||||
|
(
|
||||||
True,
|
True,
|
||||||
|
3..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Colon,
|
Colon,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
8..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Indent,
|
Indent,
|
||||||
|
9..13,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib --inline",
|
value: "matplotlib --inline",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
13..43,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
43..43,
|
||||||
|
),
|
||||||
|
(
|
||||||
Dedent,
|
Dedent,
|
||||||
|
43..43,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(&source)
|
expression: ipython_escape_command_line_continuation_eol(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib --inline",
|
value: "matplotlib --inline",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
0..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
24..24,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(&source)
|
expression: ipython_escape_command_line_continuation_eol(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib --inline",
|
value: "matplotlib --inline",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
0..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
24..24,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(&source)
|
expression: ipython_escape_command_line_continuation_eol(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib --inline",
|
value: "matplotlib --inline",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
0..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
25..25,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(&source)
|
expression: ipython_escape_command_line_continuation_with_eol_and_eof(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib ",
|
value: "matplotlib ",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
0..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
14..14,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(&source)
|
expression: ipython_escape_command_line_continuation_with_eol_and_eof(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib ",
|
value: "matplotlib ",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
0..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
14..14,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(&source)
|
expression: ipython_escape_command_line_continuation_with_eol_and_eof(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "matplotlib ",
|
value: "matplotlib ",
|
||||||
kind: Magic,
|
kind: Magic,
|
||||||
},
|
},
|
||||||
|
0..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
15..15,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,84 +3,180 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_jupyter_source(source)
|
expression: lex_jupyter_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help,
|
kind: Help,
|
||||||
},
|
},
|
||||||
|
0..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
5..6,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help,
|
kind: Help,
|
||||||
},
|
},
|
||||||
|
6..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: " foo ?",
|
value: " foo ?",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
16..27,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
27..28,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
28..34,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
34..35,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
35..42,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
42..43,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help,
|
kind: Help,
|
||||||
},
|
},
|
||||||
|
43..50,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
50..51,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
51..59,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
59..60,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo???",
|
value: "foo???",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
60..68,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
68..69,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "?foo???",
|
value: "?foo???",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
69..78,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
78..79,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo",
|
value: "foo",
|
||||||
kind: Help,
|
kind: Help,
|
||||||
},
|
},
|
||||||
|
79..92,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
92..93,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: " ?",
|
value: " ?",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
93..99,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
99..100,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "??",
|
value: "??",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
100..104,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
104..105,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "%foo",
|
value: "%foo",
|
||||||
kind: Help,
|
kind: Help,
|
||||||
},
|
},
|
||||||
|
105..110,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
110..111,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "%foo",
|
value: "%foo",
|
||||||
kind: Help2,
|
kind: Help2,
|
||||||
},
|
},
|
||||||
|
111..117,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
117..118,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "foo???",
|
value: "foo???",
|
||||||
kind: Magic2,
|
kind: Magic2,
|
||||||
},
|
},
|
||||||
|
118..126,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
126..127,
|
||||||
|
),
|
||||||
|
(
|
||||||
IpyEscapeCommand {
|
IpyEscapeCommand {
|
||||||
value: "pwd",
|
value: "pwd",
|
||||||
kind: Help,
|
kind: Help,
|
||||||
},
|
},
|
||||||
|
127..132,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
132..132,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,11 +3,20 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: lex_source(&source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99232,
|
value: 99232,
|
||||||
},
|
},
|
||||||
|
0..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"#",
|
"#",
|
||||||
),
|
),
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
8..8,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,11 +3,20 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: lex_source(&source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99232,
|
value: 99232,
|
||||||
},
|
},
|
||||||
|
0..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"# foo",
|
"# foo",
|
||||||
),
|
),
|
||||||
|
7..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
12..12,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,11 +3,20 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: lex_source(&source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99232,
|
value: 99232,
|
||||||
},
|
},
|
||||||
|
0..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"# ",
|
"# ",
|
||||||
),
|
),
|
||||||
|
7..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
9..9,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,11 +3,20 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: lex_source(&source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 99232,
|
value: 99232,
|
||||||
},
|
},
|
||||||
|
0..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"# ",
|
"# ",
|
||||||
),
|
),
|
||||||
|
7..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..10,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,12 +3,24 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(source)
|
expression: lex_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"#Hello",
|
"#Hello",
|
||||||
),
|
),
|
||||||
|
0..6,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
6..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comment(
|
Comment(
|
||||||
"#World",
|
"#World",
|
||||||
),
|
),
|
||||||
|
7..13,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
13..14,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,52 +1,142 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: newline_in_brackets_eol(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
0..1,
|
||||||
|
),
|
||||||
|
(
|
||||||
Equal,
|
Equal,
|
||||||
|
2..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lsqb,
|
Lsqb,
|
||||||
|
4..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
5..6,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
6..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
|
11..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
12..13,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
|
13..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
14..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 3,
|
value: 3,
|
||||||
},
|
},
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
19..20,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 4,
|
value: 4,
|
||||||
},
|
},
|
||||||
|
20..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
21..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
22..23,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
23..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
24..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lbrace,
|
Lbrace,
|
||||||
|
26..27,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
27..28,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 5,
|
value: 5,
|
||||||
},
|
},
|
||||||
|
28..29,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
29..30,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
30..31,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 6,
|
value: 6,
|
||||||
},
|
},
|
||||||
|
31..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
32..33,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 7,
|
value: 7,
|
||||||
},
|
},
|
||||||
|
35..36,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rbrace,
|
Rbrace,
|
||||||
|
36..37,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rsqb,
|
Rsqb,
|
||||||
|
37..38,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
38..39,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,52 +1,142 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: newline_in_brackets_eol(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
0..1,
|
||||||
|
),
|
||||||
|
(
|
||||||
Equal,
|
Equal,
|
||||||
|
2..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lsqb,
|
Lsqb,
|
||||||
|
4..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
5..6,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
6..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
|
11..12,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
12..13,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
|
13..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
14..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
16..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 3,
|
value: 3,
|
||||||
},
|
},
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
19..20,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 4,
|
value: 4,
|
||||||
},
|
},
|
||||||
|
20..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
21..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
22..23,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
23..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
24..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lbrace,
|
Lbrace,
|
||||||
|
26..27,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
27..28,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 5,
|
value: 5,
|
||||||
},
|
},
|
||||||
|
28..29,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
29..30,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
30..31,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 6,
|
value: 6,
|
||||||
},
|
},
|
||||||
|
31..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
32..33,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 7,
|
value: 7,
|
||||||
},
|
},
|
||||||
|
35..36,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rbrace,
|
Rbrace,
|
||||||
|
36..37,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rsqb,
|
Rsqb,
|
||||||
|
37..38,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
38..39,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,52 +1,142 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: newline_in_brackets_eol(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Name {
|
Name {
|
||||||
name: "x",
|
name: "x",
|
||||||
},
|
},
|
||||||
|
0..1,
|
||||||
|
),
|
||||||
|
(
|
||||||
Equal,
|
Equal,
|
||||||
|
2..3,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lsqb,
|
Lsqb,
|
||||||
|
4..5,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
5..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
7..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
|
13..14,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
14..15,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
|
15..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
16..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
19..20,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 3,
|
value: 3,
|
||||||
},
|
},
|
||||||
|
20..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
21..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
22..24,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 4,
|
value: 4,
|
||||||
},
|
},
|
||||||
|
24..25,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
25..26,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
26..28,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
28..29,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
29..30,
|
||||||
|
),
|
||||||
|
(
|
||||||
Lbrace,
|
Lbrace,
|
||||||
|
31..32,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
32..34,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 5,
|
value: 5,
|
||||||
},
|
},
|
||||||
|
34..35,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
35..36,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
36..38,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 6,
|
value: 6,
|
||||||
},
|
},
|
||||||
|
38..39,
|
||||||
|
),
|
||||||
|
(
|
||||||
Comma,
|
Comma,
|
||||||
|
39..40,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 7,
|
value: 7,
|
||||||
},
|
},
|
||||||
|
43..44,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rbrace,
|
Rbrace,
|
||||||
|
44..45,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rsqb,
|
Rsqb,
|
||||||
|
45..46,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
46..48,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,32 +3,68 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(source)
|
expression: lex_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Lpar,
|
Lpar,
|
||||||
|
0..1,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
1..2,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "a",
|
value: "a",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
6..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "b",
|
value: "b",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
14..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
18..19,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "c",
|
value: "c",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
23..26,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "d",
|
value: "d",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
33..36,
|
||||||
|
),
|
||||||
|
(
|
||||||
NonLogicalNewline,
|
NonLogicalNewline,
|
||||||
|
36..37,
|
||||||
|
),
|
||||||
|
(
|
||||||
Rpar,
|
Rpar,
|
||||||
|
37..38,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
38..38,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,40 +3,76 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(source)
|
expression: lex_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 47,
|
value: 47,
|
||||||
},
|
},
|
||||||
|
0..4,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 10,
|
value: 10,
|
||||||
},
|
},
|
||||||
|
5..9,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 13,
|
value: 13,
|
||||||
},
|
},
|
||||||
|
10..16,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 0,
|
value: 0,
|
||||||
},
|
},
|
||||||
|
17..18,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 123,
|
value: 123,
|
||||||
},
|
},
|
||||||
|
19..22,
|
||||||
|
),
|
||||||
|
(
|
||||||
Int {
|
Int {
|
||||||
value: 1234567890,
|
value: 1234567890,
|
||||||
},
|
},
|
||||||
|
23..36,
|
||||||
|
),
|
||||||
|
(
|
||||||
Float {
|
Float {
|
||||||
value: 0.2,
|
value: 0.2,
|
||||||
},
|
},
|
||||||
|
37..40,
|
||||||
|
),
|
||||||
|
(
|
||||||
Float {
|
Float {
|
||||||
value: 100.0,
|
value: 100.0,
|
||||||
},
|
},
|
||||||
|
41..45,
|
||||||
|
),
|
||||||
|
(
|
||||||
Float {
|
Float {
|
||||||
value: 2100.0,
|
value: 2100.0,
|
||||||
},
|
},
|
||||||
|
46..51,
|
||||||
|
),
|
||||||
|
(
|
||||||
Complex {
|
Complex {
|
||||||
real: 0.0,
|
real: 0.0,
|
||||||
imag: 2.0,
|
imag: 2.0,
|
||||||
},
|
},
|
||||||
|
52..54,
|
||||||
|
),
|
||||||
|
(
|
||||||
Complex {
|
Complex {
|
||||||
real: 0.0,
|
real: 0.0,
|
||||||
imag: 2.2,
|
imag: 2.2,
|
||||||
},
|
},
|
||||||
|
55..59,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
59..59,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,10 +3,28 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(source)
|
expression: lex_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
DoubleSlash,
|
DoubleSlash,
|
||||||
|
0..2,
|
||||||
|
),
|
||||||
|
(
|
||||||
DoubleSlash,
|
DoubleSlash,
|
||||||
|
2..4,
|
||||||
|
),
|
||||||
|
(
|
||||||
DoubleSlashEqual,
|
DoubleSlashEqual,
|
||||||
|
4..7,
|
||||||
|
),
|
||||||
|
(
|
||||||
Slash,
|
Slash,
|
||||||
|
7..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
Slash,
|
Slash,
|
||||||
|
9..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..10,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,50 +3,80 @@ source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(source)
|
expression: lex_source(source)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "double",
|
value: "double",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
0..8,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "single",
|
value: "single",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
9..17,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "can\\'t",
|
value: "can\\'t",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
18..26,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\\\\\\\"",
|
value: "\\\\\\\"",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
27..33,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\\t\\r\\n",
|
value: "\\t\\r\\n",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
34..42,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\\g",
|
value: "\\g",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
43..47,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "raw\\'",
|
value: "raw\\'",
|
||||||
kind: RawString,
|
kind: RawString,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
48..56,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\\420",
|
value: "\\420",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
57..63,
|
||||||
|
),
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\\200\\0a",
|
value: "\\200\\0a",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
64..73,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
73..73,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: string_continuation_with_eol(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "abc\\\rdef",
|
value: "abc\\\rdef",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
0..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..10,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: string_continuation_with_eol(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "abc\\\ndef",
|
value: "abc\\\ndef",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
0..10,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
10..10,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: string_continuation_with_eol(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "abc\\\r\ndef",
|
value: "abc\\\r\ndef",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: false,
|
triple_quoted: false,
|
||||||
},
|
},
|
||||||
|
0..11,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
11..11,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: triple_quoted_eol(MAC_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\r test string\r ",
|
value: "\r test string\r ",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: true,
|
triple_quoted: true,
|
||||||
},
|
},
|
||||||
|
0..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
21..21,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: triple_quoted_eol(UNIX_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\n test string\n ",
|
value: "\n test string\n ",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: true,
|
triple_quoted: true,
|
||||||
},
|
},
|
||||||
|
0..21,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
21..21,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_parser/src/lexer.rs
|
source: crates/ruff_python_parser/src/lexer.rs
|
||||||
expression: lex_source(&source)
|
expression: triple_quoted_eol(WINDOWS_EOL)
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
|
(
|
||||||
String {
|
String {
|
||||||
value: "\r\n test string\r\n ",
|
value: "\r\n test string\r\n ",
|
||||||
kind: String,
|
kind: String,
|
||||||
triple_quoted: true,
|
triple_quoted: true,
|
||||||
},
|
},
|
||||||
|
0..23,
|
||||||
|
),
|
||||||
|
(
|
||||||
Newline,
|
Newline,
|
||||||
|
23..23,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue