[SCM] Lisaac compiler branch, stable, updated. lisaac-0.12-563-g31b1d18
Mildred Ki'Lya
silkensedai at online.fr
Wed Nov 11 11:30:09 UTC 2009
The following commit has been merged in the stable branch:
commit 8952c41f9eb245859c88656a21da782debfd4895
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date: Wed Nov 11 12:14:45 2009 +0100
Added new externals
diff --git a/lib/kernel/object.li b/lib/kernel/object.li
index a1fd8d7..7edab43 100644
--- a/lib/kernel/object.li
+++ b/lib/kernel/object.li
@@ -43,8 +43,14 @@ Section Public
- is_debug_mode:BOOLEAN <- debug_level != 0;
- - debug_level:INTEGER <- `11`;
-
+ - debug_level:INTEGER <- `11`;
+ - 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;
//
diff --git a/lib/time/date.li b/lib/time/date.li
index a40961d..9204727 100644
--- a/lib/time/date.li
+++ b/lib/time/date.li
@@ -35,11 +35,16 @@ Section Insert
- parent_object:OBJECT := OBJECT;
Section Private
-
+
- to_raw:UINTEGER_32 <-
(
CONVERT(SELF,UINTEGER_32).on Self
);
+
+ - from_raw i:UINTEGER_32 :SELF <-
+ (
+ CONVERT(UINTEGER_32,SELF).on i
+ );
Section Public
@@ -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 21ac0a9..eb8ed4c 100644
--- a/src/any.li
+++ b/src/any.li
@@ -336,6 +336,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 7437cbc..6baf47b 100644
--- a/src/item/itm_external.li
+++ b/src/item/itm_external.li
@@ -157,7 +157,37 @@ Section Public
.when 17 then { // LIST.item index:INTEGER :E
not_yet_implemented;
}
- .when 18 to 31 then { // FREE
+ .when 18 then { // compiler_inlining_level -> INTEGER.
+ result := INTEGER_CST.create position value inline_level type (type_integer.default);
+ }
+ .when 19 then { // compiler_optimization -> BOOLEAN.
+ (is_optimization).if {
+ result := PROTOTYPE_CST.create position type (type_true.default);
+ } else {
+ result := PROTOTYPE_CST.create position type (type_false.default);
+ };
+ }
+ .when 20 then { // compiler_built_on -> STRING_CONSTANT.
+ string_tmp.clear;
+ CLOCK.date.append_in string_tmp;
+ string_tmp.add_last ' ';
+ CLOCK.time.append_in string_tmp;
+ 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 (CLOCK.time.to_csecond) type (type_integer.default);
+ }
+ .when 23 then { // compile_date -> UINTEGER_32.
+ result := INTEGER_CST.create position value (CLOCK.date.encode) type (type_uinteger_32.default);
+ }
+ .when 24 to 31 then { // FREE
syntax_error (position,"Free external lisaac code.");
};
} else {
diff --git a/src/lisaac.li b/src/lisaac.li
index 27658fe..7f7da2c 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -579,7 +579,9 @@ Section Private
style (ALIAS_STR.keyword_expanded).to_run_for NULL.raw;
type_real := ITM_TYPE_STYLE.get (ALIAS_STR.prototype_real)
style (ALIAS_STR.keyword_expanded).to_run_for NULL.raw;
- type_integer_32 := ITM_TYPE_STYLE.get (ALIAS_STR.prototype_integer_32)
+ 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;
--
Lisaac compiler
More information about the Lisaac-commits
mailing list