Jelajahi Sumber

Documented Load phase

Taddeus Kroes 12 tahun lalu
induk
melakukan
3957fefea4
2 mengubah file dengan 16 tambahan dan 4 penghapusan
  1. 4 4
      phases/load.ml
  2. 12 0
      phases/load.mli

+ 4 - 4
phases/load.ml

@@ -2,10 +2,10 @@ open Types
 open Util
 
 (* Unix command to call for C preprocessor:
- * -nostdinc    : don't include from C stdlib
- * -C         : don't remove comments
- * -traditional-cpp : don't remove excessive whitespaces, so that error
- *          messages preserve correct character locations *)
+ * -nostdinc        : Don't include from C stdlib
+ * -C               : Don't remove comments
+ * -traditional-cpp : Don't remove excessive whitespaces, so that error
+ *                    messages preserve correct character locations *)
 let cpp_cmd = "cpp -nostdinc -C -traditional-cpp"
 
 let input_all ic =

+ 12 - 0
phases/load.mli

@@ -1 +1,13 @@
+(** Load phase. Loads CiviC code from file or [stdin], and runs the C
+    preprocessor. *)
+
+(** The load phase checks if an input file argument was specified, and loads the
+    file content into a buffer. When no input file is specified, CiviC code is
+    read from [stdin]. If the [-nocpp] command-line argument is not specified,
+    the C preprocessor is called by calling the command [cpp -nostdinc -C
+    -traditional-cpp] (see source code for comments on [cpp] arguments). The
+    preprocessed code is passed to the next phase in a [FileContent]
+    constructor. *)
+
+(** Main phase function, called by {!Main}. *)
 val phase : Main.phase_func