[SCM] Lisaac compiler branch, stable, updated. lisaac-0.12-482-gbec6f21

Mildred Ki'Lya silkensedai at online.fr
Sun Sep 6 12:07:11 UTC 2009


The following commit has been merged in the stable branch:
commit bec6f2119869fb59112acf980e655cba17903f2b
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Sun Sep 6 13:16:20 2009 +0200

    Load .lip file looking first in li directory
    
    If a .li file is specified, look at make.lip in the directory of this li file
    first instead of the current directory. When the .lip file is not specified on
    the command line, its location is displayed by the compiler.

diff --git a/src/lisaac.li b/src/lisaac.li
index 922dfdc..996aee2 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -212,7 +212,7 @@ Section Private
           };
         } else {
           (lip_ok).if_false {
-            load_lip "make.lip";
+            load_lip "make.lip" in NULL;
             lip_ok := TRUE;
           };
           string_tmp.copy cmd;
@@ -274,14 +274,10 @@ Section Private
             "'.".print;
             display_usage;
           };
-          load_lip cmd;
+          load_lip cmd in NULL;
           lip_ok := TRUE;
         } else {
           // .li
-          (lip_ok).if_false {
-            load_lip "make.lip";
-            lip_ok := TRUE;
-          };
           (input_name != NULL).if {
             display_usage;
           };
@@ -299,7 +295,11 @@ Section Private
           (i > string_tmp2.lower).if {
             string_tmp2.remove_last (string_tmp2.upper-i+1);
           };
-          LIP_CALL.load_directory (ALIAS_STR.get string_tmp) base_path NULL is_recursive FALSE;
+          (lip_ok).if_false {
+            load_lip "make.lip" in (ALIAS_STR.get string_tmp);
+            lip_ok := TRUE;
+          };
+          //LIP_CALL.load_directory (ALIAS_STR.get string_tmp) base_path NULL is_recursive FALSE;
           input_name := ALIAS_STR.get string_tmp2;
           LIP_CODE.put_string input_name to (ALIAS_STR.slot_input_file);
           LIP_CODE.put_string input_name to (ALIAS_STR.slot_output_file);
@@ -308,7 +308,7 @@ Section Private
       j := j+1;
     };            
     (lip_ok).if_false {
-      load_lip "make.lip";
+      load_lip "make.lip" in NULL;
     };
     
     // Executing `front_end':
@@ -374,13 +374,30 @@ Section Private
     result
   );
   
-  - load_lip file_lip:ABSTRACT_STRING <-
+  - load_lip file_lip:ABSTRACT_STRING in lip_dir:STRING_CONSTANT <-
   ( + path_lip:STRING_CONSTANT;
     + is_good:BOOLEAN;
     + count:INTEGER;
 
+    //
+    // Search in lip_dir
+    //
     string_tmp.clear;
-    {      
+    (lip_dir != NULL).if {
+      string_tmp.append lip_dir;
+      string_tmp.append file_lip;
+      path_lip := ALIAS_STR.get string_tmp;
+      (is_good := PARSER.read_lip path_lip).if_false {
+        LIP_CALL.load_directory lip_dir base_path NULL is_recursive FALSE;
+        string_tmp.remove_last (file_lip.count);
+      } else {
+        "Load lip file: ".print; path_lip.println;
+      };
+    };
+    //
+    // Search in 5 parent directories
+    //
+    {(count < 5) && {! is_good}}.while_do {      
       string_tmp.append file_lip;
       path_lip := ALIAS_STR.get string_tmp;      
       (is_good := PARSER.read_lip path_lip).if_false {      
@@ -388,8 +405,15 @@ Section Private
         string_tmp.remove_last (file_lip.count);
         string_tmp.append "../";
         count := count + 1;
+      } else {
+        (count > 0).if {
+          "Load lip file: ".print; path_lip.println;
+        };
       };
-    }.do_while {(count < 5) && {! is_good}};
+    };
+    //
+    // Load default make.lip in LISAAC_DIRECTORY
+    //
     (is_good).if_false {
       string_tmp.copy path_lisaac;
       string_tmp.append "make.lip";
@@ -399,8 +423,13 @@ Section Private
         path_lip.print;
         "' not found !\nIncorrect installation.\n".print;
         die_with_code exit_failure_code;
+      } else {
+        "Load lip file: ".print; path_lip.println;
       };      
     };            
+    //
+    // Load parent .lip (inheritance)
+    //
     {LIP_CODE.list_parent.is_empty}.until_do {
       path_lip := LIP_CODE.list_parent.first;
       LIP_CODE.list_parent.remove_first;      
@@ -414,6 +443,8 @@ Section Private
         path_lip.print;
         "' not found ! (see `*.lip')\n".print;          
         die_with_code exit_failure_code;
+      } else {
+        //"Load inherited lip file: ".print; path_lip.println;
       };
     };
     // Auto-load 'lisaac' variable.

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list