瀏覽代碼

Added item to TODO list & comment cleanup

Taddeus Kroes 12 年之前
父節點
當前提交
478237b452
共有 3 個文件被更改,包括 5 次插入5 次删除
  1. 1 1
      README.md
  2. 3 3
      phases/context_analysis.ml
  3. 1 1
      phases/desug.ml

+ 1 - 1
README.md

@@ -7,4 +7,4 @@ CiviCaml is a compiler for the CiviC language, written in OCaml.
 Issues & TODO
 -------------
 
-- Load file content and run C preprocessor in load phase
+- Check for illegal assigments of loop counter in for-loop body.

+ 3 - 3
phases/context_analysis.ml

@@ -13,7 +13,7 @@ let analyse_context node =
             scope := StrMap.add name (decl, depth) !scope
     in
     let rec analyse depth = function
-        (* add node reference for this varname to vars map *)
+        (* Add node reference for this varname to vars map *)
         | VarDec (ctype, name, init, loc) as node ->
             let node = match init with
                 | Some value ->
@@ -24,7 +24,7 @@ let analyse_context node =
             add_to_scope name (ref node) depth "variable";
             node
 
-        (* for a variable, look for its declaration in the current scope and
+        (* For a variable, look for its declaration in the current scope and
          * save a reference with the relative nesting depth *)
         | Var (name, _) as node ->
             if StrMap.mem name !scope then
@@ -34,7 +34,7 @@ let analyse_context node =
                 raise (NodeError (node, (sprintf "undefined variable \"%s\"" name)))
 
         (*
-        (* increase nesting level when entering function *)
+        (* Increase nesting level when entering function *)
         | FunDef (export, ret_type, name, params, body, loc) as node ->
             let vars = StrMap.add name (ref node) vars in
             let inctrav vars = function

+ 1 - 1
phases/desug.ml

@@ -41,7 +41,7 @@ let for_to_while node =
                 Assign (_stop, stop, locof stop);
                 Assign (_step, step, locof step);
                 While (cond, traverse (Block (
-                    (* TODO: check for illegal assigments of counter in body*)
+                    (* TODO: check for illegal assigments of counter in body *)
                     block_body (replace_var counter _i body) @
                     [Assign (_i, Binop (Add, vi, vstep, noloc), noloc)]
                 )), loc);