[SCM] Lisaac compiler branch, master+stable, updated. lisaac-0.12-606-gf445725

Mildred Ki'Lya silkensedai at online.fr
Mon Mar 1 00:35:39 UTC 2010


The following commit has been merged in the master+stable branch:
commit 2fe59fa6cf28e7b3f8187ee2cb107bf1fd73b9a0
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Sat Feb 20 00:54:39 2010 +0100

    Add lisaac internals to get more information for -version

diff --git a/lib/standard/kernel/object.li b/lib/standard/kernel/object.li
index 2966524..9a560f9 100644
--- a/lib/standard/kernel/object.li
+++ b/lib/standard/kernel/object.li
@@ -47,6 +47,9 @@ Section Public
   - compiler_inlining_level:INTEGER   <- `18`;
   - compiler_optimization:BOOLEAN     <- `19`;
   - compiler_built_on:STRING_CONSTANT <- `20`;
+  - compiler_debug_with_code:BOOLEAN  <- `21`;
+  - compile_time:TIME                 <- TIME.create_csecond `22`;
+  - compile_date:DATE                 <- DATE.decode `23`;
 
   - is_ansi:BOOLEAN := SYSTEM.is_ansi;
 
@@ -200,7 +203,7 @@ Section Public
   // Reflexivity.
   //
 
-  - type_name:STRING_CONSTANT <- `21`;
+  - type_name:STRING_CONSTANT <- `24`;
 
   - foreach_data action:{ (STRING_CONSTANT,INTEGER,INTEGER); } <-
   (
@@ -244,8 +247,8 @@ Section Public
   // BSBS: a simplifier qd les types parameters ds les blocks seront good.
 
 //  - foreach_intern_data_action (sec,nam:STRING_CONSTANT,typ:T,val:V)
-//  with action:{ (STRING_CONSTANT,STRING_CONSTANT,T,E); } <- `22`;
+//  with action:{ (STRING_CONSTANT,STRING_CONSTANT,T,E); } <- `25`;
 
-  - foreach_intern_data action:{ (STRING_CONSTANT,STRING_CONSTANT,INTEGER,INTEGER); } <- `22`;
+  - foreach_intern_data action:{ (STRING_CONSTANT,STRING_CONSTANT,INTEGER,INTEGER); } <- `25`;
 
-  - foreach_set_intern_data action:{ (STRING_CONSTANT,STRING_CONSTANT,T); T} <- `23`;
+  - foreach_set_intern_data action:{ (STRING_CONSTANT,STRING_CONSTANT,T); T} <- `26`;
diff --git a/lib/standard/time/date.li b/lib/standard/time/date.li
index d4aea1a..85bed69 100644
--- a/lib/standard/time/date.li
+++ b/lib/standard/time/date.li
@@ -41,8 +41,13 @@ Section Private
     CONVERT(SELF,UINTEGER_32).on Self
   );
 
+  - from_raw i:UINTEGER_32 :SELF <-
+  (
+    CONVERT(UINTEGER_32,SELF).on i
+  );
+  
 Section Public
-
+  
   - Self:SELF '>' Right 60 other:SELF :BOOLEAN <- to_raw > other.to_raw;
 
   - Self:SELF '<' Right 60 other:SELF :BOOLEAN <- to_raw < other.to_raw;
@@ -149,3 +154,7 @@ Section Public
   (
     to_string.print;
   );
+
+  - encode :UINTEGER_32 <- to_raw;
+
+  - decode i:UINTEGER_32 :SELF <- from_raw i;
diff --git a/src/any.li b/src/any.li
index 3b524a2..26f0cd5 100644
--- a/src/any.li
+++ b/src/any.li
@@ -392,6 +392,7 @@ Section Public
   - type_false            :TYPE;
   - type_boolean          :TYPE;
   - type_integer_32       :TYPE;
+  - type_uinteger_32      :TYPE;
   - type_pointer          :TYPE;
   - type_string_constant  :TYPE;
   - type_n_a_character    :TYPE;
diff --git a/src/item/itm_external.li b/src/item/itm_external.li
index bc1b012..defcee1 100644
--- a/src/item/itm_external.li
+++ b/src/item/itm_external.li
@@ -172,21 +172,33 @@ Section Public
         SYSTEM.get_current_date.append_in string_tmp;
         string_tmp.add_last ' ';
         SYSTEM.get_current_time.append_in string_tmp;
-	result := STRING_CST.create position text (ALIAS_STR.get string_tmp)
-        length (string_tmp.count);
+        result := STRING_CST.create position text (ALIAS_STR.get string_tmp) length (string_tmp.count);
+      }
+      .when 21 then { // debug_with_code -> BOOLEAN.
+        (debug_with_code).if {
+          result := PROTOTYPE_CST.create position type (type_true.default);
+        } else {
+          result := PROTOTYPE_CST.create position type (type_false.default);
+        };
+      }
+      .when 22 then { // compile_time -> INTEGER.
+        result := INTEGER_CST.create position value (SYSTEM.get_current_time.to_csecond) type (type_integer.default);
+      }
+      .when 23 then { // compile_date -> UINTEGER_32.
+        result := INTEGER_CST.create position value (SYSTEM.get_current_date.encode) type (type_uinteger_32.default);
       }
-      .when 21 then { // OBJECT.type_name -> STRING_CONSTANT
+      .when 24 then { // OBJECT.type_name -> STRING_CONSTANT
         type := profil_slot.argument_list.first.type;
         string_tmp.clear;
         type.raw.append_name_in string_tmp;
-	result := STRING_CST.create position text (ALIAS_STR.get string_tmp)
+        result := STRING_CST.create position text (ALIAS_STR.get string_tmp)
         length (string_tmp.count);
       }
-      .when 22 then { // OBJECT.foreach_intern_data action:{ (STRING_CONSTANT,STRING_CONSTANT,T,E); }
+      .when 25 then { // OBJECT.foreach_intern_data action:{ (STRING_CONSTANT,STRING_CONSTANT,T,E); }
         forall_data_product;
         result := PROTOTYPE_CST.create position type (TYPE_VOID.default);
       }
-      .when 23 to 31 then { // FREE
+      .when 26 to 31 then { // FREE
         syntax_error (position,"Free external lisaac code.");
       };
     } else {
diff --git a/src/lisaac.li b/src/lisaac.li
index d165443..115bd52 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -532,6 +532,8 @@ Section Private
     style (ALIAS_STR.keyword_expanded).to_run_for NULL.raw;
     type_integer_32 := ITM_TYPE_STYLE.get (ALIAS_STR.prototype_integer_32)
     style (ALIAS_STR.keyword_expanded).to_run_for NULL.raw;
+    type_uinteger_32 := ITM_TYPE_STYLE.get (ALIAS_STR.prototype_uinteger_32)
+    style (ALIAS_STR.keyword_expanded).to_run_for NULL.raw;
     type_string_constant := ITM_TYPE_SIMPLE.get (ALIAS_STR.prototype_string_constant)
     .to_run_for NULL.raw;
     itm_type_character   := ITM_TYPE_STYLE.get (ALIAS_STR.prototype_character)

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list