Selaa lähdekoodia

Fixed some typeos in documentation, changed <allocate> to __allocate for consistency with language spec

Taddeus Kroes 11 vuotta sitten
vanhempi
sitoutus
cbeae1d982
4 muutettua tiedostoa jossa 8 lisäystä ja 8 poistoa
  1. 2 2
      phases/constprop.mli
  2. 3 3
      phases/desug.mli
  3. 2 2
      phases/unroll.mli
  4. 1 1
      stringify.ml

+ 2 - 2
phases/constprop.mli

@@ -45,7 +45,7 @@ After desugaring and array dimension reduction this becomes:
     _arr_0_ = 2;
     _arr_1_ = 2;
     _scalar_1_ = 3;
-    arr := <allocate>((_arr_0_ * _arr_1_));
+    arr = __allocate((_arr_0_ * _arr_1_));
     _i_4 = 0;
     _stop_5_ = _arr_0_;
     _step_6_ = 1;
@@ -67,7 +67,7 @@ Constant propagation reduces this to:
     int _i_4;
     int _i_7;
     int[] arr;
-    arr := <allocate>(4);
+    arr = __allocate(4);
     _i_4 = 0;
     while ((_i_4 < 2)) \{
         _i_7 = 0;

+ 3 - 3
phases/desug.mli

@@ -33,13 +33,13 @@ void foo() \{
     A more complex class of initialisations is that of array initialisations.
     Arrays can be initialised to a scalar value or to an array literal in
     bracket notation. A scalar value is rewritten to a nested for-loop over all
-    array dmensions, with an assignment in the most nested loop. An array
+    array dimensions, with an assignment in the most nested loop. An array
     constant is rewritten to a series of separate assign statements to the
     corresponding array indices. The following example shows both
     transformations:
 {v void foo() \{
     int[3] a = 4;
-    int[2, 2] b = [[3, 4], [5, 6]];
+    int[2, 2] b = [[1, 2], [3, 4]];
 \} v}
 
     This is transformed into:
@@ -109,7 +109,7 @@ resulting in:
     _a_0_ = 2;
     _a_1_ = two();
     _scalar_1_ = two();
-    a := <allocate>(_a_0_, _a_1_);
+    a = __allocate(_a_0_, _a_1_);
     for (int _i_2 = 0, _a_0_) \{
         for (int _i_3 = 0, _a_1_) \{
             a[_i_2, _i_3] = _scalar_1_;

+ 2 - 2
phases/unroll.mli

@@ -23,7 +23,7 @@
     int _i_6;
     int _i_9;
     int[] arr;
-    arr := <allocate>(6);
+    arr = __allocate(6);
     _i_6 = 0;
     while ((_i_6 < 2)) \{
         _i_9 = 0;
@@ -41,7 +41,7 @@
 
 {v void foo() \{
     int[] arr;
-    arr := <allocate>(6);
+    arr = __allocate(6);
     arr[0] = 1;
     arr[1] = 1;
     arr[2] = 1;

+ 1 - 1
stringify.ml

@@ -114,7 +114,7 @@ and node2str node =
     let range = str start ^ ", " ^ str stop ^ step in
     "for (int " ^ counter ^ " = " ^ range ^ ") " ^ str body
   | Allocate (dec, dims, _) ->
-    nameof dec ^ " := <allocate>(" ^ concat ", " dims ^ ");"
+    nameof dec ^ " = __allocate(" ^ concat ", " dims ^ ");"
   | Block body ->
     let rec append = function
       | [] -> ""