|
@@ -479,6 +479,25 @@ module Instruction = struct
|
|
Helper.compare_args ~strict:true ~level:Report.Warn pos expected
|
|
Helper.compare_args ~strict:true ~level:Report.Warn pos expected
|
|
[ op1; op2 ] report
|
|
[ op1; op2 ] report
|
|
| reports -> reports @ report)
|
|
| reports -> reports @ report)
|
|
|
|
+
|
|
|
|
+ let for_ :
|
|
|
|
+ S.pos ->
|
|
|
|
+ (S.pos, Expression.t') S.variable ->
|
|
|
|
+ start:Expression.t' ->
|
|
|
|
+ to_:Expression.t' ->
|
|
|
|
+ step:Expression.t' option ->
|
|
|
|
+ t list ->
|
|
|
|
+ t =
|
|
|
|
+ fun _loc variable ~start ~to_ ~step statements ->
|
|
|
|
+ ignore variable;
|
|
|
|
+ ignore start;
|
|
|
|
+ ignore to_;
|
|
|
|
+ ignore step;
|
|
|
|
+ (* TODO ensure all the variable are INT *)
|
|
|
|
+ let report = [] in
|
|
|
|
+ List.fold_left statements ~init:report ~f:(fun acc a ->
|
|
|
|
+ let report = a in
|
|
|
|
+ (List.rev_append report) acc)
|
|
end
|
|
end
|
|
|
|
|
|
module Location = struct
|
|
module Location = struct
|