[SCM] Lisaac compiler branch, living-external, updated. lisaac-0.12-548-gf6e3b14
Mildred Ki'Lya
silkensedai at online.fr
Thu Oct 8 17:06:17 UTC 2009
The following commit has been merged in the living-external branch:
commit f21faa9e9e0d980ea82423addaff4164e1f9395d
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date: Thu Oct 8 16:22:51 2009 +0200
Create possibility to have immortal PROFILs in PROFIL_LIST
diff --git a/src/profil_list.li b/src/profil_list.li
index 6d5342b..c07917c 100644
--- a/src/profil_list.li
+++ b/src/profil_list.li
@@ -37,6 +37,10 @@ Section Private
- profil_list:FAST_ARRAY(PROFIL) := FAST_ARRAY(PROFIL).create_with_capacity 65536;
- life_limit:INTEGER;
+ // Living prototypes are below this limit
+
+ - immortal_limit :INTEGER;
+ // Immortal prototypes are below this limit
- current:INTEGER;
@@ -88,6 +92,58 @@ Section Public
p.set_life_index (profil_list.upper);
debug_life p message "Add profil: ";
);
+
+ - set_immortal p:PROFIL <-
+ [
+ -? { p.life_index != -1 };
+ -? { profil_list.item (p.life_index) = p };
+ ]
+ ( + idx:INTEGER;
+
+ debug_life p message "Set profil immortal: ";
+ idx := p.life_index;
+ (idx = immortal_limit).if {
+ immortal_limit := immortal_limit + 1;
+ life_limit := life_limit + 1;
+ }.elseif {idx > life_limit} then {
+ swap idx with life_limit;
+ swap life_limit with immortal_limit;
+ immortal_limit := immortal_limit + 1;
+ life_limit := life_limit + 1;
+ }.elseif {idx > immortal_limit} then {
+ swap idx with immortal_limit;
+ immortal_limit := immortal_limit + 1;
+ life_limit := life_limit + 1;
+ };
+ debug_life p message " ";
+ )
+ [
+ +? { profil_list.item (p.life_index) = p };
+ +? { p.life_index < immortal_limit };
+ ];
+
+ - unset_immortal p:PROFIL <-
+ [
+ -? { p.life_index != -1 };
+ ]
+ ( + idx:INTEGER;
+
+ debug_life p message "Unset profil immortal: ";
+ idx := p.life_index;
+ (idx < immortal_limit).if {
+ immortal_limit := immortal_limit - 1;
+ (idx < immortal_limit).if {
+ (idx > current).if {
+ swap idx with immortal_limit;
+ } else {
+ swap idx with current;
+ swap current with immortal_limit;
+ current := current - 1;
+ };
+ };
+ };
+ debug_life p message " ";
+ );
- set_life p:PROFIL <-
[
@@ -157,7 +213,7 @@ Section Public
profil_list.item i.reset_recursive;
};
VARIABLE.update;
- life_limit := 0;
+ life_limit := immortal_limit;
PROFIL.set_mode_recursive TRUE;
profil_current := profil_slot := NULL;
list_current := NULL;
@@ -172,7 +228,7 @@ Section Public
- execute_pass <-
(
VARIABLE.update;
- life_limit := 0;
+ life_limit := immortal_limit;
profil_slot := NULL;
list_current := NULL;
list_main.execute;
--
Lisaac compiler
More information about the Lisaac-commits
mailing list