File tree Expand file tree Collapse file tree 4 files changed +14
-12
lines changed
Expand file tree Collapse file tree 4 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,12 @@ and interpret_test settings ctx str ~cond ~body ~else_body =
142142 let break_exists = has_notifier " break" rctx in
143143 let continue_exists = has_notifier " continue" rctx in
144144 let result_ctx = rewind rctx pre_state in
145- let result_ctx = if break_exists then notifier " break" result_ctx else result_ctx in
146- let result_ctx = if continue_exists then notifier " continue" result_ctx else result_ctx in
145+ let result_ctx =
146+ if break_exists then notifier " break" result_ctx else result_ctx
147+ in
148+ let result_ctx =
149+ if continue_exists then notifier " continue" result_ctx else result_ctx
150+ in
147151
148152 (result_ctx, rstr)
149153
@@ -173,7 +177,7 @@ and interpret_for settings ctx str ~alias ~iterable ~params ~body ~else_body =
173177 let nacc =
174178 Interpreter_objects. make_forloop_ctx inner_ctx index length
175179 in
176-
180+
177181 (* Remove the continue notifier for the next iteration *)
178182 let next_ctx = Ctx. remove (nlit " continue" ) nacc in
179183
Original file line number Diff line number Diff line change @@ -139,8 +139,7 @@ type ast =
139139[@@ deriving show ]
140140
141141let list_of_range = function
142- | LexRange (start , stop ) ->
143- List. range start (stop + 1 )
142+ | LexRange (start , stop ) -> List. range start (stop + 1 )
144143 | _ -> raise (Failure " This is not a range!" )
145144
146145let liq_list_of_range r =
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ let ( != ) = Stdlib.( != )
66let ( > ) = Stdlib. ( > )
77let ( < ) = Stdlib. ( < )
88let ( ~/ ) = Re2. create_exn
9-
109let range x = List. range 0 (x + 1 )
1110let sub_prefix text x = String. sub text ~pos: 0 ~len: x
1211let sub_suffix text x = String. sub text ~pos: x ~len: (String. length text - x)
Original file line number Diff line number Diff line change @@ -440,12 +440,12 @@ let suite =
440440 ; test_case " forloop.rindex" `Quick test_forloop_rindex
441441 ; test_case " forloop.rindex0" `Quick test_forloop_rindex0
442442 ; (* Break and continue - TODO: break/continue not implemented yet *)
443- test_case " for loop break" `Quick test_for_loop_break;
444- test_case " for loop continue" `Quick test_for_loop_continue;
445- test_case " for loop multiple breaks" `Quick test_for_loop_multiple_breaks;
446- test_case " for loop multiple continues" `Quick test_for_loop_multiple_continues;
447-
448- (* Nested loops *)
443+ test_case " for loop break" `Quick test_for_loop_break
444+ ; test_case " for loop continue" `Quick test_for_loop_continue
445+ ; test_case " for loop multiple breaks" `Quick test_for_loop_multiple_breaks
446+ ; test_case " for loop multiple continues" `Quick
447+ test_for_loop_multiple_continues
448+ ; (* Nested loops *)
449449 test_case " nested for loops" `Quick test_nested_for_loops
450450 ; test_case " nested loops with forloop" `Quick
451451 test_nested_for_loops_with_forloop
You can’t perform that action at this time.
0 commit comments