소스 검색

Clarified example code in interface file

Taddeus Kroes 12 년 전
부모
커밋
2c7c770755
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      phases/desug.mli

+ 9 - 2
phases/desug.mli

@@ -44,8 +44,8 @@ void foo() \{
     This is transformed into:
 
 {v void foo() \{
-    int[] a;
-    int[] b;
+    int[3] a;
+    int[2, 2] b;
     a = __allocate(3);
     for (int i = 0, 3) \{
         a[i] = 4;
@@ -57,6 +57,13 @@ void foo() \{
     b[1, 1] = 4;
 \} v}
 
+    Actually, the dimensions of [a] and [b] should have been replaced by new
+    variables earlier for reasons described below, but this is not done in the
+    example to maintain readability.
+
+    Note that array constants in bracket expressions must have a nesting level
+    that is equal to the number of array dimensions, or an error will occur.
+
     {2 Prevent incorrect double evaluation}
 
     In the following code: