@@ -5,7 +5,7 @@ use rusty_pc::*;
55
66use crate :: error:: ParseErrorPos ;
77use crate :: input:: RcStringView ;
8- use crate :: specific:: { create_file_tokenizer, create_string_tokenizer, program_parser_p, Program } ;
8+ use crate :: specific:: { Program , create_file_tokenizer, create_string_tokenizer, program_parser_p} ;
99
1010/// Parses a QBasic file.
1111///
@@ -53,9 +53,9 @@ pub fn parse_main_str(input: String) -> Result<Program, ParseErrorPos> {
5353mod tests {
5454 use rusty_common:: * ;
5555
56+ use crate :: BuiltInSub ;
5657 use crate :: specific:: * ;
5758 use crate :: test_utils:: * ;
58- use crate :: BuiltInSub ;
5959
6060 #[ test]
6161 fn test_parse_fixture_fib ( ) {
@@ -66,11 +66,13 @@ mod tests {
6666 // DECLARE FUNCTION Fib! (N!)
6767 GlobalStatement :: function_declaration(
6868 "Fib!" . as_name( 1 , 18 ) ,
69- vec![ Parameter :: new(
70- "N" . into( ) ,
71- ParamType :: BuiltIn ( TypeQualifier :: BangSingle , BuiltInStyle :: Compact )
72- )
73- . at_rc( 1 , 24 ) ] ,
69+ vec![
70+ Parameter :: new(
71+ "N" . into( ) ,
72+ ParamType :: BuiltIn ( TypeQualifier :: BangSingle , BuiltInStyle :: Compact )
73+ )
74+ . at_rc( 1 , 24 )
75+ ] ,
7476 ) ,
7577 // PRINT "Enter the number of fibonacci to calculate"
7678 GlobalStatement :: Statement ( Statement :: Print ( Print :: one(
@@ -148,26 +150,30 @@ mod tests {
148150 Box :: new(
149151 Expression :: func(
150152 "Fib" ,
151- vec![ Expression :: BinaryExpression (
152- Operator :: Minus ,
153- Box :: new( "N" . as_var_expr( 12 , 19 ) ) ,
154- Box :: new( 1 . as_lit_expr( 12 , 23 ) ) ,
155- ExpressionType :: Unresolved
156- )
157- . at_rc( 12 , 21 ) ]
153+ vec![
154+ Expression :: BinaryExpression (
155+ Operator :: Minus ,
156+ Box :: new( "N" . as_var_expr( 12 , 19 ) ) ,
157+ Box :: new( 1 . as_lit_expr( 12 , 23 ) ) ,
158+ ExpressionType :: Unresolved
159+ )
160+ . at_rc( 12 , 21 )
161+ ]
158162 )
159163 . at_rc( 12 , 15 )
160164 ) ,
161165 Box :: new(
162166 Expression :: func(
163167 "Fib" ,
164- vec![ Expression :: BinaryExpression (
165- Operator :: Minus ,
166- Box :: new( "N" . as_var_expr( 12 , 32 ) ) ,
167- Box :: new( 2 . as_lit_expr( 12 , 36 ) ) ,
168- ExpressionType :: Unresolved
169- )
170- . at_rc( 12 , 34 ) ]
168+ vec![
169+ Expression :: BinaryExpression (
170+ Operator :: Minus ,
171+ Box :: new( "N" . as_var_expr( 12 , 32 ) ) ,
172+ Box :: new( 2 . as_lit_expr( 12 , 36 ) ) ,
173+ ExpressionType :: Unresolved
174+ )
175+ . at_rc( 12 , 34 )
176+ ]
171177 )
172178 . at_rc( 12 , 28 )
173179 ) ,
0 commit comments