fix broken tests

escape-analysis
ychenfo 2021-12-28 01:38:16 +08:00
parent 88f0da7bdd
commit 9b3b47ce50
31 changed files with 659 additions and 47 deletions

View File

@ -127,7 +127,7 @@ mod tests {
use crate::fold::Fold;
use crate::*;
let location = Location::new(0, 0);
let location = Location::new(0, 0, Default::default());
let custom = ();
let ast = Located {
location,

View File

@ -74,7 +74,7 @@ fn test_primitives() {
d = a if c == 1 else 0
return d
"};
let statements = parse_program(source).unwrap();
let statements = parse_program(source, Default::default()).unwrap();
let composer: TopLevelComposer = Default::default();
let mut unifier = composer.unifier.clone();
@ -193,12 +193,12 @@ fn test_simple_call() {
a = foo(a)
return a * 2
"};
let statements_1 = parse_program(source_1).unwrap();
let statements_1 = parse_program(source_1, Default::default()).unwrap();
let source_2 = indoc! { "
return a + 1
"};
let statements_2 = parse_program(source_2).unwrap();
let statements_2 = parse_program(source_2, Default::default()).unwrap();
let composer: TopLevelComposer = Default::default();
let mut unifier = composer.unifier.clone();

View File

@ -103,7 +103,7 @@ fn test_simple_register(source: Vec<&str>) {
let mut composer: TopLevelComposer = Default::default();
for s in source {
let ast = parse_program(s).unwrap();
let ast = parse_program(s, Default::default()).unwrap();
let ast = ast[0].clone();
composer.register_top_level(ast, None, "".into()).unwrap();
@ -149,7 +149,7 @@ fn test_simple_function_analyze(source: Vec<&str>, tys: Vec<&str>, names: Vec<&s
Arc::new(Resolver(internal_resolver.clone())) as Arc<dyn SymbolResolver + Send + Sync>;
for s in source {
let ast = parse_program(s).unwrap();
let ast = parse_program(s, Default::default()).unwrap();
let ast = ast[0].clone();
let (id, def_id, ty) =
@ -333,7 +333,7 @@ fn test_simple_function_analyze(source: Vec<&str>, tys: Vec<&str>, names: Vec<&s
pass
"}
],
vec!["application of type vars to generic class is not currently supported (at line 4 column 24)"];
vec!["application of type vars to generic class is not currently supported (at unknown: line 4 column 24)"];
"err no type var in generic app"
)]
#[test_case(
@ -389,7 +389,7 @@ fn test_simple_function_analyze(source: Vec<&str>, tys: Vec<&str>, names: Vec<&s
def __init__():
pass
"}],
vec!["__init__ method must have a `self` parameter (at line 2 column 5)"];
vec!["__init__ method must have a `self` parameter (at unknown: line 2 column 5)"];
"err no self_1"
)]
#[test_case(
@ -411,7 +411,7 @@ fn test_simple_function_analyze(source: Vec<&str>, tys: Vec<&str>, names: Vec<&s
"}
],
vec!["a class definition can only have at most one base class declaration and one generic declaration (at line 1 column 24)"];
vec!["a class definition can only have at most one base class declaration and one generic declaration (at unknown: line 1 column 24)"];
"err multiple inheritance"
)]
#[test_case(
@ -479,7 +479,7 @@ fn test_simple_function_analyze(source: Vec<&str>, tys: Vec<&str>, names: Vec<&s
pass
"}
],
vec!["duplicate definition of class `A` ( at line 1 column 1)"];
vec!["duplicate definition of class `A` (at unknown: line 1 column 1)"];
"class same name"
)]
fn test_analyze(source: Vec<&str>, res: Vec<&str>) {
@ -499,7 +499,7 @@ fn test_analyze(source: Vec<&str>, res: Vec<&str>) {
Arc::new(Resolver(internal_resolver.clone())) as Arc<dyn SymbolResolver + Send + Sync>;
for s in source {
let ast = parse_program(s).unwrap();
let ast = parse_program(s, Default::default()).unwrap();
let ast = ast[0].clone();
let (id, def_id, ty) = {
@ -683,7 +683,7 @@ fn test_inference(source: Vec<&str>, res: Vec<&str>) {
Arc::new(Resolver(internal_resolver.clone())) as Arc<dyn SymbolResolver + Send + Sync>;
for s in source {
let ast = parse_program(s).unwrap();
let ast = parse_program(s, Default::default()).unwrap();
let ast = ast[0].clone();
let (id, def_id, ty) = {

View File

@ -461,7 +461,7 @@ fn test_basic(source: &str, mapping: HashMap<&str, &str>, virtuals: &[(&str, &st
defined_identifiers.insert("virtual".into());
let mut inferencer = env.get_inferencer();
inferencer.defined_identifiers = defined_identifiers.clone();
let statements = parse_program(source).unwrap();
let statements = parse_program(source, Default::default()).unwrap();
let statements = statements
.into_iter()
.map(|v| inferencer.fold_stmt(v))
@ -603,7 +603,7 @@ fn test_primitive_magic_methods(source: &str, mapping: HashMap<&str, &str>) {
defined_identifiers.insert("virtual".into());
let mut inferencer = env.get_inferencer();
inferencer.defined_identifiers = defined_identifiers.clone();
let statements = parse_program(source).unwrap();
let statements = parse_program(source, Default::default()).unwrap();
let statements = statements
.into_iter()
.map(|v| inferencer.fold_stmt(v))

View File

@ -1339,7 +1339,7 @@ mod tests {
const UNIX_EOL: &str = "\n";
pub fn lex_source(source: &str) -> Vec<Tok> {
let lexer = make_tokenizer(source);
let lexer = make_tokenizer(source, Default::default());
lexer.map(|x| x.unwrap().1).collect()
}

View File

@ -37,11 +37,11 @@ pub fn parse_program(source: &str, file: FileName) -> Result<ast::Suite, ParseEr
/// assert_eq!(
/// expr,
/// ast::Expr {
/// location: ast::Location::new(1, 3),
/// location: ast::Location::new(1, 3, Default::default()),
/// custom: (),
/// node: ast::ExprKind::BinOp {
/// left: Box::new(ast::Expr {
/// location: ast::Location::new(1, 1),
/// location: ast::Location::new(1, 1, Default::default()),
/// custom: (),
/// node: ast::ExprKind::Constant {
/// value: ast::Constant::Int(1.into()),
@ -50,7 +50,7 @@ pub fn parse_program(source: &str, file: FileName) -> Result<ast::Suite, ParseEr
/// }),
/// op: ast::Operator::Add,
/// right: Box::new(ast::Expr {
/// location: ast::Location::new(1, 5),
/// location: ast::Location::new(1, 5, Default::default()),
/// custom: (),
/// node: ast::ExprKind::Constant {
/// value: ast::Constant::Int(2.into()),
@ -86,42 +86,42 @@ mod tests {
#[test]
fn test_parse_empty() {
let parse_ast = parse_program("").unwrap();
let parse_ast = parse_program("", Default::default()).unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_parse_print_hello() {
let source = String::from("print('Hello world')");
let parse_ast = parse_program(&source).unwrap();
let parse_ast = parse_program(&source, Default::default()).unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_parse_print_2() {
let source = String::from("print('Hello world', 2)");
let parse_ast = parse_program(&source).unwrap();
let parse_ast = parse_program(&source, Default::default()).unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_parse_kwargs() {
let source = String::from("my_func('positional', keyword=2)");
let parse_ast = parse_program(&source).unwrap();
let parse_ast = parse_program(&source, Default::default()).unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_parse_if_elif_else() {
let source = String::from("if 1: 10\nelif 2: 20\nelse: 30");
let parse_ast = parse_program(&source).unwrap();
let parse_ast = parse_program(&source, Default::default()).unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_parse_lambda() {
let source = "lambda x, y: x * y"; // lambda(x, y): x * y";
let parse_ast = parse_program(&source).unwrap();
let parse_ast = parse_program(&source, Default::default()).unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
@ -129,7 +129,7 @@ mod tests {
fn test_parse_tuples() {
let source = "a, b = 4, 5";
insta::assert_debug_snapshot!(parse_program(&source).unwrap());
insta::assert_debug_snapshot!(parse_program(&source, Default::default()).unwrap());
}
#[test]
@ -140,7 +140,7 @@ class Foo(A, B):
pass
def method_with_default(self, arg='default'):
pass";
insta::assert_debug_snapshot!(parse_program(&source).unwrap());
insta::assert_debug_snapshot!(parse_program(&source, Default::default()).unwrap());
}
#[test]
@ -183,7 +183,7 @@ while i < 2: # nac3: 4
# nac3: if1
if 1: # nac3: if2
3";
insta::assert_debug_snapshot!(parse_program(&source).unwrap());
insta::assert_debug_snapshot!(parse_program(&source, Default::default()).unwrap());
}
#[test]
@ -196,7 +196,7 @@ while test: # nac3: while3
# nac3: simple assign0
a = 3 # nac3: simple assign1
";
insta::assert_debug_snapshot!(parse_program(&source).unwrap());
insta::assert_debug_snapshot!(parse_program(&source, Default::default()).unwrap());
}
#[test]
@ -215,7 +215,7 @@ if a: # nac3: small2
for i in a: # nac3: for1
pass
";
insta::assert_debug_snapshot!(parse_program(&source).unwrap());
insta::assert_debug_snapshot!(parse_program(&source, Default::default()).unwrap());
}
#[test]
@ -224,6 +224,6 @@ for i in a: # nac3: for1
if a: # nac3: something
a = 3
";
assert!(parse_program(&source).is_err());
assert!(parse_program(&source, Default::default()).is_err());
}
}

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 327
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: JoinedStr {
@ -14,6 +19,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -27,6 +35,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -40,6 +51,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -47,6 +61,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 335
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: JoinedStr {
@ -14,6 +19,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -27,6 +35,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -40,6 +51,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -53,6 +67,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -60,6 +77,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -75,6 +95,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -88,6 +111,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -101,6 +127,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -114,6 +143,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -121,6 +153,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 343
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: JoinedStr {
@ -14,6 +19,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -27,6 +35,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -40,6 +51,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -47,6 +61,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -60,6 +77,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 319
expression: "parse_fstring(\"\").unwrap()"
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 298
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: JoinedStr {
@ -14,6 +19,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -21,6 +29,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -36,6 +47,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -43,6 +57,9 @@ Located {
location: Location {
row: 1,
column: 3,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -58,6 +75,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -8,6 +8,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -15,6 +18,9 @@ Located {
location: Location {
row: 1,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Compare {
@ -22,6 +28,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -41,6 +50,9 @@ Located {
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 306
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -13,6 +18,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -26,6 +34,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -33,6 +44,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {

View File

@ -8,6 +8,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -15,6 +18,9 @@ Located {
location: Location {
row: 1,
column: 4,
file: FileName(
"unknown",
),
},
custom: (),
node: Compare {
@ -22,6 +28,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -41,6 +50,9 @@ Located {
location: Location {
row: 1,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 314
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -13,6 +18,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -26,6 +34,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 389
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: JoinedStr {
@ -14,6 +19,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -27,6 +35,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -40,6 +51,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -47,6 +61,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 396
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: JoinedStr {
@ -14,6 +19,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -27,6 +35,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -40,6 +51,9 @@ Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -47,6 +61,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {

View File

@ -1,11 +1,16 @@
---
source: parser/src/fstring.rs
source: nac3parser/src/fstring.rs
assertion_line: 403
expression: parse_ast
---
Located {
location: Location {
row: 0,
column: 0,
file: FileName(
"unknown",
),
},
custom: (),
node: FormattedValue {
@ -13,6 +18,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Yield {

View File

@ -1,7 +1,7 @@
---
source: nac3parser/src/parser.rs
assertion_line: 218
expression: parse_program(&source).unwrap()
expression: "parse_program(&source, Default::default()).unwrap()"
---
[
@ -9,6 +9,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: If {
@ -16,6 +19,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 4,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -28,6 +34,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -35,6 +44,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -56,6 +68,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 2,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: If {
@ -63,6 +78,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 2,
column: 4,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -75,6 +93,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 2,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -82,6 +103,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 2,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -103,6 +127,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 3,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: If {
@ -110,6 +137,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 3,
column: 4,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -122,6 +152,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -129,6 +162,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -143,6 +179,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -150,6 +189,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 10,
file: FileName(
"unknown",
),
},
custom: (),
node: BinOp {
@ -157,6 +199,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -169,6 +214,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 12,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -198,6 +246,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Assign {
@ -206,6 +257,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -218,6 +272,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -237,6 +294,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -244,6 +304,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 10,
file: FileName(
"unknown",
),
},
custom: (),
node: BinOp {
@ -251,6 +314,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -263,6 +329,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 12,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -283,6 +352,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 15,
file: FileName(
"unknown",
),
},
custom: (),
node: Assign {
@ -291,6 +363,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 15,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -303,6 +378,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 19,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -320,6 +398,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 8,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Assign {
@ -328,6 +409,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 8,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -340,6 +424,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 8,
column: 6,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -363,6 +450,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 9,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: If {
@ -370,6 +460,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 9,
column: 4,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -382,6 +475,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 10,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -389,6 +485,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 10,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -410,6 +509,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 11,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: For {
@ -417,6 +519,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 11,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -428,6 +533,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 11,
column: 10,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -440,6 +548,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 12,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Pass {

View File

@ -1,7 +1,7 @@
---
source: nac3parser/src/parser.rs
assertion_line: 186
expression: parse_program(&source).unwrap()
expression: "parse_program(&source, Default::default()).unwrap()"
---
[
@ -9,6 +9,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: AnnAssign {
@ -16,6 +19,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -27,6 +33,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 4,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -45,6 +54,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 2,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: For {
@ -52,6 +64,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 3,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -63,6 +78,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 3,
column: 11,
file: FileName(
"unknown",
),
},
custom: (),
node: Tuple {
@ -71,6 +89,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 3,
column: 11,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -86,6 +107,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 3,
column: 15,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -104,6 +128,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: AnnAssign {
@ -111,6 +138,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -122,6 +152,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -147,6 +180,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: While {
@ -154,6 +190,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 7,
column: 9,
file: FileName(
"unknown",
),
},
custom: (),
node: Compare {
@ -161,6 +200,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 7,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -176,6 +218,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 7,
column: 11,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -195,6 +240,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 9,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Pass {
@ -207,6 +255,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 12,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -214,6 +265,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 12,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: BinOp {
@ -221,6 +275,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 12,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -237,6 +294,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 12,
column: 9,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -261,6 +321,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 13,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: If {
@ -268,6 +331,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 15,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -284,6 +350,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 16,
column: 9,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -291,6 +360,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 16,
column: 9,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,6 +1,7 @@
---
source: nac3parser/src/parser.rs
expression: parse_program(&source).unwrap()
assertion_line: 143
expression: "parse_program(&source, Default::default()).unwrap()"
---
[
@ -8,6 +9,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: ClassDef {
@ -17,6 +21,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 11,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -28,6 +35,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 14,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -42,6 +52,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 2,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: FunctionDef {
@ -53,6 +66,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 2,
column: 15,
file: FileName(
"unknown",
),
},
custom: (),
node: ArgData {
@ -73,6 +89,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 3,
column: 3,
file: FileName(
"unknown",
),
},
custom: (),
node: Pass {
@ -90,6 +109,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: FunctionDef {
@ -101,6 +123,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 26,
file: FileName(
"unknown",
),
},
custom: (),
node: ArgData {
@ -113,6 +138,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 32,
file: FileName(
"unknown",
),
},
custom: (),
node: ArgData {
@ -131,6 +159,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 37,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -147,6 +178,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 5,
column: 3,
file: FileName(
"unknown",
),
},
custom: (),
node: Pass {

View File

@ -1,11 +1,16 @@
---
source: parser/src/parser.rs
source: nac3parser/src/parser.rs
assertion_line: 150
expression: parse_ast
---
Located {
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: DictComp {
@ -13,6 +18,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -24,6 +32,9 @@ Located {
location: Location {
row: 1,
column: 6,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -37,6 +48,9 @@ Located {
location: Location {
row: 1,
column: 13,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -48,6 +62,9 @@ Located {
location: Location {
row: 1,
column: 18,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {

View File

@ -8,6 +8,9 @@ Located {
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: ListComp {
@ -15,6 +18,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -28,6 +34,9 @@ Located {
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Tuple {
@ -36,6 +45,9 @@ Located {
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -47,6 +59,9 @@ Located {
location: Location {
row: 1,
column: 11,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -62,6 +77,9 @@ Located {
location: Location {
row: 1,
column: 17,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -77,6 +95,9 @@ Located {
location: Location {
row: 1,
column: 23,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -88,6 +109,9 @@ Located {
location: Location {
row: 1,
column: 28,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -100,6 +124,9 @@ Located {
location: Location {
row: 1,
column: 35,
file: FileName(
"unknown",
),
},
custom: (),
node: Compare {
@ -107,6 +134,9 @@ Located {
location: Location {
row: 1,
column: 33,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -122,6 +152,9 @@ Located {
location: Location {
row: 1,
column: 37,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -140,6 +173,9 @@ Located {
location: Location {
row: 1,
column: 44,
file: FileName(
"unknown",
),
},
custom: (),
node: Compare {
@ -147,6 +183,9 @@ Located {
location: Location {
row: 1,
column: 42,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -162,6 +201,9 @@ Located {
location: Location {
row: 1,
column: 46,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -9,6 +9,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: If {
@ -16,6 +19,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 4,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -32,6 +38,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -39,6 +48,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -59,6 +71,9 @@ expression: parse_ast
location: Location {
row: 2,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: If {
@ -66,6 +81,9 @@ expression: parse_ast
location: Location {
row: 2,
column: 6,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -82,6 +100,9 @@ expression: parse_ast
location: Location {
row: 2,
column: 9,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -89,6 +110,9 @@ expression: parse_ast
location: Location {
row: 2,
column: 9,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -109,6 +133,9 @@ expression: parse_ast
location: Location {
row: 3,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -116,6 +143,9 @@ expression: parse_ast
location: Location {
row: 3,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -9,6 +9,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -16,6 +19,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Call {
@ -23,6 +29,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -35,6 +44,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 10,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -50,6 +62,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 23,
file: FileName(
"unknown",
),
},
custom: (),
node: KeywordData {
@ -60,6 +75,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 31,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,5 +1,6 @@
---
source: nac3parser/src/parser.rs
assertion_line: 125
expression: parse_ast
---
@ -8,6 +9,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -15,6 +19,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Lambda {
@ -25,6 +32,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: ArgData {
@ -37,6 +47,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 11,
file: FileName(
"unknown",
),
},
custom: (),
node: ArgData {
@ -56,6 +69,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 16,
file: FileName(
"unknown",
),
},
custom: (),
node: BinOp {
@ -63,6 +79,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 14,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -75,6 +94,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 18,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {

View File

@ -1,11 +1,16 @@
---
source: parser/src/parser.rs
source: nac3parser/src/parser.rs
assertion_line: 157
expression: parse_ast
---
Located {
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: ListComp {
@ -13,6 +18,9 @@ Located {
location: Location {
row: 1,
column: 2,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -26,6 +34,9 @@ Located {
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -37,6 +48,9 @@ Located {
location: Location {
row: 1,
column: 13,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {

View File

@ -9,6 +9,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -16,6 +19,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 6,
file: FileName(
"unknown",
),
},
custom: (),
node: Call {
@ -23,6 +29,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -35,6 +44,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -48,6 +60,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 22,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,5 +1,6 @@
---
source: nac3parser/src/parser.rs
assertion_line: 97
expression: parse_ast
---
@ -8,6 +9,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Expr {
@ -15,6 +19,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 6,
file: FileName(
"unknown",
),
},
custom: (),
node: Call {
@ -22,6 +29,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -34,6 +44,9 @@ expression: parse_ast
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,7 +1,7 @@
---
source: nac3parser/src/parser.rs
assertion_line: 132
expression: parse_program(&source).unwrap()
expression: "parse_program(&source, Default::default()).unwrap()"
---
[
@ -9,6 +9,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Assign {
@ -17,6 +20,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Tuple {
@ -25,6 +31,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -36,6 +45,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 4,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -52,6 +64,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Tuple {
@ -60,6 +75,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 8,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {
@ -75,6 +93,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 11,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {

View File

@ -1,7 +1,7 @@
---
source: nac3parser/src/parser.rs
assertion_line: 199
expression: parse_program(&source).unwrap()
expression: "parse_program(&source, Default::default()).unwrap()"
---
[
@ -9,6 +9,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 1,
column: 1,
file: FileName(
"unknown",
),
},
custom: (),
node: While {
@ -16,6 +19,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 4,
column: 7,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -28,6 +34,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 6,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Assign {
@ -36,6 +45,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 6,
column: 5,
file: FileName(
"unknown",
),
},
custom: (),
node: Name {
@ -48,6 +60,9 @@ expression: parse_program(&source).unwrap()
location: Location {
row: 6,
column: 9,
file: FileName(
"unknown",
),
},
custom: (),
node: Constant {