Wrapper around `do_ok_test` to parse an expression. Given that expressions alone are not valid statements, we have to put them in a statement to parse them. In doing so, we can also put an extra statement after them to ensure we detect their end properly.
(input: &str, expr: Expr)
| 2956 | /// valid statements, we have to put them in a statement to parse them. In doing so, we can |
| 2957 | /// also put an extra statement after them to ensure we detect their end properly. |
| 2958 | fn do_expr_ok_test(input: &str, expr: Expr) { |
| 2959 | do_ok_test( |
| 2960 | &format!("PRINT {}, 1", input), |
| 2961 | &[Statement::Call(CallSpan { |
| 2962 | vref: VarRef::new("PRINT", None), |
| 2963 | vref_pos: lc(1, 1), |
| 2964 | args: vec![ |
| 2965 | ArgSpan { |
| 2966 | expr: Some(expr), |
| 2967 | sep: ArgSep::Long, |
| 2968 | sep_pos: lc(1, 7 + input.len()), |
| 2969 | }, |
| 2970 | ArgSpan { |
| 2971 | expr: Some(expr_integer(1, 1, 6 + input.len() + 3)), |
| 2972 | sep: ArgSep::End, |
| 2973 | sep_pos: lc(1, 10 + input.len()), |
| 2974 | }, |
| 2975 | ], |
| 2976 | })], |
| 2977 | ); |
| 2978 | } |
| 2979 | |
| 2980 | /// Wrapper around `do_error_test` to parse an expression. Given that expressions alone are not |
| 2981 | /// valid statements, we have to put them in a statement to parse them. In doing so, we can |