diff --git a/nac3ast/src/constant.rs b/nac3ast/src/constant.rs index b3a7ed586..af8a85175 100644 --- a/nac3ast/src/constant.rs +++ b/nac3ast/src/constant.rs @@ -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, diff --git a/nac3core/src/codegen/test.rs b/nac3core/src/codegen/test.rs index 34fcf3f48..4e63fd300 100644 --- a/nac3core/src/codegen/test.rs +++ b/nac3core/src/codegen/test.rs @@ -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(); diff --git a/nac3core/src/toplevel/test.rs b/nac3core/src/toplevel/test.rs index aa8545791..1aef5771b 100644 --- a/nac3core/src/toplevel/test.rs +++ b/nac3core/src/toplevel/test.rs @@ -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; 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; 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; 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) = { diff --git a/nac3core/src/typecheck/type_inferencer/test.rs b/nac3core/src/typecheck/type_inferencer/test.rs index cc209bba2..0d1492ca5 100644 --- a/nac3core/src/typecheck/type_inferencer/test.rs +++ b/nac3core/src/typecheck/type_inferencer/test.rs @@ -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)) diff --git a/nac3parser/src/lexer.rs b/nac3parser/src/lexer.rs index 73e18788e..7b04891df 100644 --- a/nac3parser/src/lexer.rs +++ b/nac3parser/src/lexer.rs @@ -1339,7 +1339,7 @@ mod tests { const UNIX_EOL: &str = "\n"; pub fn lex_source(source: &str) -> Vec { - let lexer = make_tokenizer(source); + let lexer = make_tokenizer(source, Default::default()); lexer.map(|x| x.unwrap().1).collect() } diff --git a/nac3parser/src/parser.rs b/nac3parser/src/parser.rs index 4eae0c65e..55da3fad7 100644 --- a/nac3parser/src/parser.rs +++ b/nac3parser/src/parser.rs @@ -37,11 +37,11 @@ pub fn parse_program(source: &str, file: FileName) -> Result Result