|
|
@@ -1,5 +1,5 @@
|
|
|
-(** Desugaring: split variable initialisations, prevent incorrect double
|
|
|
- evaluation, and transform for-loops to while-loops. *)
|
|
|
+(** Desugaring: split variable initialisations, generate array dimension
|
|
|
+ variables, and transform for-loops to while-loops. *)
|
|
|
|
|
|
(** {2 Split variable initialisations}
|
|
|
|
|
|
@@ -120,9 +120,9 @@ resulting in:
|
|
|
The transformation described above is applied to all array definitions,
|
|
|
including extern arrays. Although dimensions of extern arrays are not
|
|
|
expressions (but identifiers), the transformation is necessary in order to
|
|
|
- generate consistent names to be imported/exported. E.g. in [int[n] a], [n]
|
|
|
- is just a name given locally to the first dimension of [a]. Therefore it is
|
|
|
- transformed into:
|
|
|
+ generate consistent names to be imported/exported. E.g. in [extern int[n]
|
|
|
+ a], [n] is just a name given locally to the first dimension of [a].
|
|
|
+ Therefore it is transformed into:
|
|
|
{v extern int _a_0_;
|
|
|
int[_a_0_] a; v}
|
|
|
Also, all occurrences of [n] in the rest of the module are replaced by
|