[SCM] Lisaac compiler branch, mildred-projects, updated. lisaac-0.12-421-g00631ef
Mildred Ki'Lya
silkensedai at online.fr
Wed Aug 5 21:05:53 UTC 2009
The following commit has been merged in the mildred-projects branch:
commit 664e5e04b549a3a2202fb8475cfaa4960106fbf5
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date: Wed Aug 5 15:23:37 2009 +0200
added prototypes that will serve as a base for importing PRJ_ITEMs from other projects
diff --git a/src/item/itm_type_generic.li b/src/item/itm_type_generic.li
index 107db64..5d574fe 100644
--- a/src/item/itm_type_generic.li
+++ b/src/item/itm_type_generic.li
@@ -35,7 +35,7 @@ Section Private
- dico:FAST_ARRAY[ITM_TYPE_GENERIC] := FAST_ARRAY[ITM_TYPE_GENERIC].create_with_capacity 32;
- - create n:STRING_CONSTANT source p:PRJ_ITM_PROTOTYPE style s:STRING_CONSTANT with lt:FAST_ARRAY[ITM_TYPE_MONO] :SELF <-
+ - create n:STRING_CONSTANT source p:PRJ_ITEM style s:STRING_CONSTANT with lt:FAST_ARRAY[ITM_TYPE_MONO] :SELF <-
( + result:SELF;
result := clone;
@@ -43,7 +43,7 @@ Section Private
result
);
- - make n:STRING_CONSTANT source p:PRJ_ITM_PROTOTYPE style s:STRING_CONSTANT with lt:FAST_ARRAY[ITM_TYPE_MONO] <-
+ - make n:STRING_CONSTANT source p:PRJ_ITEM style s:STRING_CONSTANT with lt:FAST_ARRAY[ITM_TYPE_MONO] <-
(
name := n;
source := p;
@@ -61,7 +61,7 @@ Section Public
with lt:FAST_ARRAY[ITM_TYPE_MONO] :ITM_TYPE_SIMPLE <-
get n from (p.find_item_or_fail n) style s with lt;
- - get n:STRING_CONSTANT from src:PRJ_ITM_PROTOTYPE style s:STRING_CONSTANT
+ - get n:STRING_CONSTANT from src:PRJ_ITEM style s:STRING_CONSTANT
with lt:FAST_ARRAY[ITM_TYPE_MONO] :SELF <-
( + result:SELF;
+ idx:INTEGER;
diff --git a/src/item/itm_type_simple.li b/src/item/itm_type_simple.li
index 2f38244..3f5d1fc 100644
--- a/src/item/itm_type_simple.li
+++ b/src/item/itm_type_simple.li
@@ -50,7 +50,7 @@ Section ITM_TYPE_SIMPLE, ITM_TYPE_SELF
Section Private
- - create n:STRING_CONSTANT source s:PRJ_ITM_PROTOTYPE :SELF <-
+ - create n:STRING_CONSTANT source s:PRJ_ITEM :SELF <-
( + result:SELF;
result := clone;
@@ -58,7 +58,7 @@ Section Private
result
);
- - make n:STRING_CONSTANT source s:PRJ_ITM_PROTOTYPE <-
+ - make n:STRING_CONSTANT source s:PRJ_ITEM <-
[
-? { n != NULL };
]
@@ -89,14 +89,14 @@ Section Public
+ name:STRING_CONSTANT <- source.protopath;
- + source:PRJ_ITM_PROTOTYPE;
+ + source:PRJ_ITEM;
- style:STRING_CONSTANT; // NULL
- get n:STRING_CONSTANT project p:LIP_PROJECT :ITM_TYPE_SIMPLE <-
get n from (p.find_item_or_fail n);
- - get n:STRING_CONSTANT from src:PRJ_ITM_PROTOTYPE :ITM_TYPE_SIMPLE <-
+ - get n:STRING_CONSTANT from src:PRJ_ITEM :ITM_TYPE_SIMPLE <-
[
-? {n != NULL};
]
@@ -135,11 +135,11 @@ Section Public
/*Section SELF
- - get_source n:STRING_CONSTANT from proto:PROTOTYPE or prj:LIP_PROJECT :PRJ_ITM_PROTOTYPE <-
+ - get_source n:STRING_CONSTANT from proto:PROTOTYPE or prj:LIP_PROJECT :PRJ_ITEM <-
[
-? { (proto != NULL) | (prj != NULL) };
]
- ( + res :PRJ_ITM_PROTOTYPE;
+ ( + res :PRJ_ITEM;
(proto = NULL).if {
res := proto.itm_source.find_item_prototype n;
diff --git a/src/item/itm_type_style.li b/src/item/itm_type_style.li
index 62b15b7..d6818a0 100644
--- a/src/item/itm_type_style.li
+++ b/src/item/itm_type_style.li
@@ -36,7 +36,7 @@ Section Private
- dico:FAST_ARRAY[ITM_TYPE_STYLE] := FAST_ARRAY[ITM_TYPE_STYLE].create_with_capacity 32;
- - create n:STRING_CONSTANT source p:PRJ_ITM_PROTOTYPE style s:STRING_CONSTANT :SELF <-
+ - create n:STRING_CONSTANT source p:PRJ_ITEM style s:STRING_CONSTANT :SELF <-
[
-? { n != NULL };
]
@@ -50,7 +50,7 @@ Section Private
? { Result.name != NULL };
];
- - make n:STRING_CONSTANT source p:PRJ_ITM_PROTOTYPE style s:STRING_CONSTANT <-
+ - make n:STRING_CONSTANT source p:PRJ_ITEM style s:STRING_CONSTANT <-
(
name := n;
source := p;
@@ -64,7 +64,7 @@ Section Public
- get n:STRING_CONSTANT project p:LIP_PROJECT style s:STRING_CONSTANT :ITM_TYPE_SIMPLE <-
get n from (p.find_item_or_fail n) style s;
- - get n:STRING_CONSTANT from src:PRJ_ITM_PROTOTYPE
+ - get n:STRING_CONSTANT from src:PRJ_ITEM
style s:STRING_CONSTANT :SELF <-
( + result:SELF;
+ idx:INTEGER;
diff --git a/src/lip/lip_project.li b/src/lip/lip_project.li
index 359c71b..1da6840 100644
--- a/src/lip/lip_project.li
+++ b/src/lip/lip_project.li
@@ -38,7 +38,7 @@ Section Public
// Path directory and command front end.
//
- + items :FAST_ARRAY[PRJ_ITM_PROTOTYPE];
+ + items :FAST_ARRAY[PRJ_ITEM];
+ path :STRING_CONSTANT := ALIAS_STR.path_current;
+ file :STRING_CONSTANT;
@@ -58,7 +58,7 @@ Section Public
- make :SELF <-
(
// TODO: Mildred: capacity 3000, isn't it a bit much ?
- items := FAST_ARRAY[PRJ_ITM_PROTOTYPE].create_with_capacity 3000;
+ items := FAST_ARRAY[PRJ_ITEM].create_with_capacity 3000;
list_parent := FAST_ARRAY[STRING_CONSTANT].create_with_capacity 1;
list_method := FAST_ARRAY[LIP_SLOT_CODE].create_with_capacity 32;
list_data := HASHED_DICTIONARY[LIP_SLOT_DATA,STRING_CONSTANT].create;
@@ -68,10 +68,10 @@ Section Public
- add_source filename:STRING_CONSTANT <-
add_item (PRJ_ITM_PROTOTYPE.clone.make filename in Self);
- - add_item itm:PRJ_ITM_PROTOTYPE <-
+ - add_item itm:PRJ_ITEM <-
[
/*(items.lower).to (items.upper) do { i:INTEGER;
- + item :PRJ_ITM_PROTOTYPE;
+ + item :PRJ_ITEM;
item := items.item i;
(item.protopath = itm.protopath).if {
("The Item "+(itm.protopath)+" already exists\n").print;
@@ -83,14 +83,14 @@ Section Public
items.add_last itm;
);
- - find_item search:ABSTRACT_STRING :PRJ_ITM_PROTOTYPE <-
+ - find_item search:ABSTRACT_STRING :PRJ_ITEM <-
find_item search from NULL at POSITION;
- - find_item_or_fail search:ABSTRACT_STRING :PRJ_ITM_PROTOTYPE <-
+ - find_item_or_fail search:ABSTRACT_STRING :PRJ_ITEM <-
find_item search from NULL or_fail POSITION;
- - find_item search:ABSTRACT_STRING from other:PRJ_ITM_PROTOTYPE or_fail pos:POSITION :PRJ_ITM_PROTOTYPE <-
- ( + item:PRJ_ITM_PROTOTYPE;
+ - find_item search:ABSTRACT_STRING from other:PRJ_ITEM or_fail pos:POSITION :PRJ_ITEM <-
+ ( + item:PRJ_ITEM;
item := find_item search from other at pos;
(item = NULL).if {
string_tmp.copy search;
@@ -102,7 +102,7 @@ Section Public
string_tmp.append " - ";
string_tmp.append (item.protopath);
//string_tmp.append ": `";
- //string_tmp.append (item.filename);
+ //string_tmp.append (item.filepath);
//string_tmp.append "'";
string_tmp.append "\n";
};
@@ -115,8 +115,8 @@ Section Public
item
);
- - find_item search:ABSTRACT_STRING from other:PRJ_ITM_PROTOTYPE at pos:POSITION :PRJ_ITM_PROTOTYPE <-
- ( + itm_found :PRJ_ITM_PROTOTYPE;
+ - find_item search:ABSTRACT_STRING from other:PRJ_ITEM at pos:POSITION :PRJ_ITEM <-
+ ( + itm_found :PRJ_ITEM;
+ same_project :BOOLEAN;
+ similarity :INTEGER;
+ prefix, suffix :ABSTRACT_STRING;
@@ -134,7 +134,7 @@ Section Public
similarity := -1;
(items.lower).to (items.upper) do { i:INTEGER;
- + item :PRJ_ITM_PROTOTYPE;
+ + item :PRJ_ITEM;
item := items.item i;
(!same_project || {item.project = Self}).if {
item.match suffix prefix prefix.if {
@@ -228,6 +228,10 @@ Section Public
path_lip := file_lip;
+ //
+ // Load lip
+ //
+
(file = NULL).if {
file := path_lip;
string_tmp.copy path_lip;
@@ -245,8 +249,12 @@ Section Public
path := ALIAS_STR.get string_tmp;
};
+
+ //
+ // Load parents
+ //
+
(success := PARSER.read_lip path_lip on Self).if {
- // Load parents
{list_parent.is_empty}.until_do {
path_lip := list_parent.first;
list_parent.remove_first;
@@ -437,7 +445,7 @@ Section Public
]
( + entry:ENTRY;
+ dir:DIRECTORY;
- + item,it:PRJ_ITM_PROTOTYPE;
+ + item,it:PRJ_ITEM;
+ skip :BOOLEAN;
+ i :INTEGER;
+ joined_path,fullpath:STRING_CONSTANT;
@@ -480,20 +488,20 @@ Section Public
//
// Create the item for the .li file
- item := PRJ_ITM_PROTOTYPE.clone.make (entry.path) protopath (PRJ_ITM_PROTOTYPE.static_protopath_from_path fullpath) in Self;
+ item := PRJ_ITM_PROTOTYPE.clone.make (entry.path) protopath (PRJ_ITEM.static_protopath_from_path fullpath) in Self;
// Search for similar items
skip := FALSE;
i := items.lower;
{(!skip) && {i < items.upper}}.while_do {
it := items.item i;
(item.protopath = it.protopath).if {
- (weak || {item.filename = it.filename}).if_false {
+ (weak || {item.filepath = it.filepath}).if_false {
string_tmp.copy "Double definition of prototype `";
string_tmp.append (item.protopath);
string_tmp.append "'\n Already defined: ";
- string_tmp.append (it.filename);
+ string_tmp.append (it.filepath);
string_tmp.append "'\n New definition: ";
- string_tmp.append (item.filename);
+ string_tmp.append (item.filepath);
semantic_error (position, string_tmp);
};
skip := TRUE;
diff --git a/src/lip/prj_itm_prototype.li b/src/lip/prj_item.li
similarity index 78%
copy from src/lip/prj_itm_prototype.li
copy to src/lip/prj_item.li
index c9cad77..f7c36ee 100644
--- a/src/lip/prj_itm_prototype.li
+++ b/src/lip/prj_item.li
@@ -21,7 +21,7 @@
Section Header
- + name := PRJ_ITM_PROTOTYPE;
+ + name := PRJ_ITEM;
- copyright := "2009 Mildred Ki'Lya";
@@ -32,62 +32,56 @@ Section Inherit
+ parent_any:Expanded ANY;
-Section Private
+Section SELF
- + prototype :PROTOTYPE;
+ - prototype :PROTOTYPE <- (deferred; NULL);
+
+ - set_prototype p:PROTOTYPE <- deferred [ +? { prototype = p }; ];
Section Public
+ project :LIP_PROJECT;
- + filename :STRING_CONSTANT;
+ projectprotopath :STRING_CONSTANT <- protopath;
+ protopath:STRING_CONSTANT;
- + protoname:STRING_CONSTANT <-
- ( + i :INTEGER;
+ - set_projectprotopath ppp:STRING_CONSTANT <- deferred;
+
+ - protoname:STRING_CONSTANT <-
+ ( + res:STRING_CONSTANT;
i := protopath.last_index_of '.';
(i == 0).if {
- protoname := protopath;
+ res := protopath;
} else {
- protoname := ALIAS_STR.get (protopath.substring (i+1)
- to (string_tmp.upper));
+ res := ALIAS_STR.get (protopath.substring (i+1)
+ to (protopath.upper));
};
-
- protoname
+ res
);
- - make fn:STRING_CONSTANT protopath pp:STRING_CONSTANT in prj:LIP_PROJECT :SELF <-
- (
- project := prj;
- filename := fn;
- protopath:= pp;
+ - filepath :STRING_CONSTANT <- (deferred; NULL);
- Self
- );
-
- - find_item_prototype search:ABSTRACT_STRING :PRJ_ITM_PROTOTYPE <-
+ - find_item_prototype search:ABSTRACT_STRING :PRJ_ITEM <-
project.find_item search from Self;
- load_prototype_generic_count gen_count:INTEGER :PROTOTYPE <-
( + entry :POINTER;
+ + path:STRING_CONSTANT;
+ + p:PROTOTYPE;
+
(prototype = NULL).if {
- string_tmp.clear;
- (filename.first != '/').if {
- string_tmp.append (project.path);
- string_tmp.add_last '/';
- };
- string_tmp.append filename;
- entry := FS_MIN.open_read string_tmp;
+ path := filepath;
+ entry := FS_MIN.open_read path;
((entry != NULL) /*&& {entry.is_file}*/).if {
// Load prototype.
FS_MIN.close entry;
- prototype := PROTOTYPE.create (ALIAS_STR.get string_tmp)
- name projectprotopath
- source Self
- generic_count gen_count;
- PARSER.go_on prototype;
+ p := PROTOTYPE.create path
+ name projectprotopath
+ source Self
+ generic_count gen_count;
+ set_prototype p;
+ PARSER.go_on p;
} else {
string_tmp.copy "Cannot open `";
string_tmp.append string_tmp;
@@ -174,11 +168,11 @@ Section LIP_PROJECT
(name.valid_index i).if_false {
"i: ".print; name.lower.print; "<=".print; i.print; "<=".print; name.count.print; ", ".print; name.upper.print;
- crash_with_message "\n***** INTERNAL ERROR in PRJ_ITM_PROTOTYPE *****\n";
+ crash_with_message "\n***** INTERNAL ERROR in PRJ_ITEM *****\n";
};
(protopath.valid_index j).if_false {
"j: ".print; protopath.lower.print; "<=".print; j.print; "<=".print; protopath.count.print; ", ".print; protopath.upper.print;
- crash_with_message "\n***** INTERNAL ERROR in PRJ_ITM_PROTOTYPE *****\n";
+ crash_with_message "\n***** INTERNAL ERROR in PRJ_ITEM *****\n";
};
match := (name.item i == protopath.item j);
@@ -186,20 +180,6 @@ Section LIP_PROJECT
j := j + 1;
};
-// string_tmp3.copy protopath;
-// match.if {
-// string_tmp3.append " match ";
-// } else {
-// string_tmp3.append " doesn't match ";
-// };
-// (prefix != NULL).if {
-// string_tmp3.append prefix;
-// string_tmp3.append "...";
-// };
-// string_tmp3.append name;
-// string_tmp3.append "\n";
-// string_tmp3.print;
-
match
);
diff --git a/src/task.li b/src/lip/prj_itm_alias.li
similarity index 70%
copy from src/task.li
copy to src/lip/prj_itm_alias.li
index eed54fe..9728424 100644
--- a/src/task.li
+++ b/src/lip/prj_itm_alias.li
@@ -18,59 +18,45 @@
// //
// http://isaacproject.u-strasbg.fr/ //
///////////////////////////////////////////////////////////////////////////////
+
Section Header
-
- - name := TASK;
- - copyright := "2003-2008 Sonntag Benoit";
+ + name := PRJ_ITM_ALIAS;
+
+ - copyright := "2009 Mildred Ki'Lya";
- - author := "Sonntag Benoit (sonntag at icps.u-strasbg.fr)";
- - comment := "The main prototype";
+ - author := "Mildred Ki'Lya <http://ki.lya.online.fr>";
+ - comment := "Project Item (prototype filename)";
Section Inherit
- - parent_object:OBJECT := OBJECT;
+ + parent_prj_item:Expanded PRJ_ITEM;
+
+Section SELF
+
+ - prototype :PROTOTYPE <- source_item.prototype;
+
+ - set_prototype p:PROTOTYPE <- source_item.set_prototype p;
Section Public
-
- + message:ABSTRACT_STRING;
-
- //
- // Creation.
- //
-
- - create msg:ABSTRACT_STRING :SELF <-
- ( + result:SELF;
- result := clone;
- result.make msg
- );
- - make msg:ABSTRACT_STRING :SELF <-
- (
- message := msg;
- Self
- );
-
- //
- // run.
- //
-
- + value:INTEGER;
-
- - set_value v:INTEGER <-
+ + source_item :PRJ_ITEM;
+
+ - filepath :STRING_CONSTANT <- source_item.filepath;
+
+ - set_projectprotopath ppp:STRING_CONSTANT <-
(
- value := v;
+ projectprotopath := ppp;
+ source_item.set_projectprotopath ppp;
);
-
- - wait:BOOLEAN;
-
- - run t:INTEGER <-
- (
- 1.to 5 do { i:INTEGER;
- message.print;
- t.print;
- '\n'.print;
- `usleep(100+rand()%1000)`;
- };
+
+ - make src:PRJ_ITEM protopath pp:STRING_CONSTANT in prj:LIP_PROJECT :SELF <-
+ (
+ project := prj;
+ source_item := src;
+ protopath := pp;
+
+ Self
);
-
+
+
diff --git a/src/lip/prj_itm_prototype.li b/src/lip/prj_itm_prototype.li
index c9cad77..5ba1f0b 100644
--- a/src/lip/prj_itm_prototype.li
+++ b/src/lip/prj_itm_prototype.li
@@ -30,32 +30,38 @@ Section Header
Section Inherit
- + parent_any:Expanded ANY;
+ + parent_prj_item:Expanded PRJ_ITEM;
-Section Private
+Section SELF
+ prototype :PROTOTYPE;
+ - set_prototype p:PROTOTYPE <-
+ (
+ prototype := p;
+ );
+
Section Public
- + project :LIP_PROJECT;
+ filename :STRING_CONSTANT;
- + projectprotopath :STRING_CONSTANT <- protopath;
-
- + protopath:STRING_CONSTANT;
-
- + protoname:STRING_CONSTANT <-
- ( + i :INTEGER;
- i := protopath.last_index_of '.';
- (i == 0).if {
- protoname := protopath;
- } else {
- protoname := ALIAS_STR.get (protopath.substring (i+1)
- to (string_tmp.upper));
+ - filepath :STRING_CONSTANT <-
+ // Absolute path (join relative item path and project path)
+ (
+ string_tmp.clear;
+ (filename.first != '/').if {
+ string_tmp.append (project.path);
+ ((string_tmp.last != '/') || {string_tmp.last != '\\'}).if {
+ string_tmp.add_last '/';
+ };
};
+ string_tmp.append filename;
+ ALIAS_STR.get string_tmp
+ );
- protoname
+ - set_projectprotopath ppp:STRING_CONSTANT <-
+ (
+ projectprotopath := ppp;
);
- make fn:STRING_CONSTANT protopath pp:STRING_CONSTANT in prj:LIP_PROJECT :SELF <-
@@ -67,173 +73,3 @@ Section Public
Self
);
- - find_item_prototype search:ABSTRACT_STRING :PRJ_ITM_PROTOTYPE <-
- project.find_item search from Self;
-
- - load_prototype_generic_count gen_count:INTEGER :PROTOTYPE <-
- ( + entry :POINTER;
- (prototype = NULL).if {
- string_tmp.clear;
- (filename.first != '/').if {
- string_tmp.append (project.path);
- string_tmp.add_last '/';
- };
- string_tmp.append filename;
- entry := FS_MIN.open_read string_tmp;
- ((entry != NULL) /*&& {entry.is_file}*/).if {
- // Load prototype.
- FS_MIN.close entry;
- prototype := PROTOTYPE.create (ALIAS_STR.get string_tmp)
- name projectprotopath
- source Self
- generic_count gen_count;
- PARSER.go_on prototype;
- } else {
- string_tmp.copy "Cannot open `";
- string_tmp.append string_tmp;
- string_tmp.append "'.";
- semantic_error (last_position, string_tmp);
- };
- };
- prototype
- );
-
- - match search:ABSTRACT_STRING :BOOLEAN <-
- ( + prefix, suffix :ABSTRACT_STRING;
- + idx :INTEGER;
-
- idx := search.first_substring_index "...";
- (idx = 0).if {
- prefix := NULL;
- suffix := search;
- } else {
- prefix := search.substring (search.lower) to (idx-1);
- suffix := search.substring (idx+3) to (search.upper);
- };
-
- match suffix prefix prefix
- );
-
- - static_protopath_from_path filename:ABSTRACT_STRING :STRING_CONSTANT <-
- (
- string_tmp2.clear;
- (filename.lower).to (filename.count - 3) do { i:INTEGER;
- + c:CHARACTER;
- c := filename.item i.to_upper;
- c.is_upper.if {
- string_tmp2.add_last c;
- }.elseif {c.is_digit} then {
- string_tmp2.add_last c;
- }.elseif {c = '/'} then {
- ((i > 1) && {string_tmp2.last != '.'}).if {
- string_tmp2.add_last '.';
- };
- } else {
- ((string_tmp2.last != '_') && {i > 1} && {string_tmp2.last != '.'}).if {
- string_tmp2.add_last '_';
- };
- };
- };
- ALIAS_STR.get string_tmp2
- );
-
-Section LIP_PROJECT
-
- - match name:ABSTRACT_STRING prefix prefix:ABSTRACT_STRING :BOOLEAN <-
- // Return true if the item match the prefix and suffix
- ( + i, j :INTEGER;
- + match:BOOLEAN;
-
- i := protopath.lower;
- j := protopath.count - name.count;
-
- (prefix = NULL).if {
-
- match := (name.count <= protopath.count);
-
- } else {
-
- match := (name.count + prefix.count < protopath.count);
-
- {(match) && {i <= prefix.count}}.while_do {
- match := (prefix.item i == protopath.item i);
- i := i + 1;
- };
-
- match.if { match := (i <= 1) || {protopath.item i == '.'} };
- match.if { match := (i <= j) };
-
- };
-
- match.if { match := (j < 1) || {protopath.item j == '.'}; };
-
- i := name.lower;
- j := j + 1;
-
- {(match) && {i <= name.count}}.while_do {
-
- (name.valid_index i).if_false {
- "i: ".print; name.lower.print; "<=".print; i.print; "<=".print; name.count.print; ", ".print; name.upper.print;
- crash_with_message "\n***** INTERNAL ERROR in PRJ_ITM_PROTOTYPE *****\n";
- };
- (protopath.valid_index j).if_false {
- "j: ".print; protopath.lower.print; "<=".print; j.print; "<=".print; protopath.count.print; ", ".print; protopath.upper.print;
- crash_with_message "\n***** INTERNAL ERROR in PRJ_ITM_PROTOTYPE *****\n";
- };
-
- match := (name.item i == protopath.item j);
- i := i + 1;
- j := j + 1;
- };
-
-// string_tmp3.copy protopath;
-// match.if {
-// string_tmp3.append " match ";
-// } else {
-// string_tmp3.append " doesn't match ";
-// };
-// (prefix != NULL).if {
-// string_tmp3.append prefix;
-// string_tmp3.append "...";
-// };
-// string_tmp3.append name;
-// string_tmp3.append "\n";
-// string_tmp3.print;
-
- match
- );
-
- - similarity other:ABSTRACT_STRING :INTEGER <-
- static_similarity (protopath, other);
-
- - static_similarity (a, b :ABSTRACT_STRING) :INTEGER <-
- // Cound how many similar segments the two prototypenames a and b have.
- // segments are strings separated by '.'
- ( + s, i, min :INTEGER;
- + c1, c2 :CHARACTER;
- s := 0;
- i := 1;
-
- (a.count < b.count).if {
- min := a.count;
- } else {
- min := b.count;
- };
-
- // While i is in range (1, max) and the two strings are equals: increment i
- // If we find a separator '.', increment s (we found a similar segment)
- {(i <= min) && {
- c1 := a.item i;
- c2 := b.item i;
- c1 = c2
- }}.while_do {
- (c1 = '.').if {
- s := s + 1;
- };
- i := i + 1;
- };
-
- s
- );
-
-
diff --git a/src/lisaac.li b/src/lisaac.li
index 710c1f3..e8a332b 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -251,7 +251,7 @@ Section Private
(is_path_list).if {
string_tmp.clear;
(project.items.lower).to (project.items.upper) do { n:INTEGER;
- string_tmp.append (project.items.item n.filename);
+ string_tmp.append (project.items.item n.filepath);
string_tmp.add_last '\n';
};
(! FS_MIN.make_file "current_path.txt").if {
@@ -657,7 +657,7 @@ Section Public
string_tmp.append "\npath directory :\n";
project.items.lower.to (project.items.upper) do { j:INTEGER;
string_tmp.append " ";
- string_tmp.append (project.items.item j.filename);
+ string_tmp.append (project.items.item j.filepath);
string_tmp.add_last '\n';
};
string_tmp.print;
diff --git a/src/parser.li b/src/parser.li
index b2c0061..978bfa0 100644
--- a/src/parser.li
+++ b/src/parser.li
@@ -186,7 +186,7 @@ Section Private
//
// This is here because it might require current_position to raise an error
- - find_prototype n:STRING_CONSTANT :PRJ_ITM_PROTOTYPE <-
+ - find_prototype n:STRING_CONSTANT :PRJ_ITEM <-
object.itm_source.project.find_item n from (object.itm_source) or_fail current_position;
//
@@ -3304,7 +3304,7 @@ Section Public
object := PROTOTYPE.create fmt_name
name (ALIAS_STR.short_format)
- generic_count 0;
+ generic_count 0;
source := object.source;
position := source.lower;
diff --git a/src/type/prototype.li b/src/type/prototype.li
index 1624f79..9a1da4c 100644
--- a/src/type/prototype.li
+++ b/src/type/prototype.li
@@ -45,7 +45,7 @@ Section Public
+ index:INTEGER; // in `prototype_list', for POSITION.
- + itm_source :PRJ_ITM_PROTOTYPE;
+ + itm_source :PRJ_ITEM;
+ shortname:STRING_CONSTANT;
@@ -171,14 +171,14 @@ Section Public
// Creation.
//
- - create f:STRING_CONSTANT name n:STRING_CONSTANT source s:PRJ_ITM_PROTOTYPE generic_count c:INTEGER :SELF <-
+ - create f:STRING_CONSTANT name n:STRING_CONSTANT source s:PRJ_ITEM generic_count c:INTEGER :SELF <-
( + result:SELF;
result := clone;
result.make f name n source s generic_count c;
result
);
- - make f:STRING_CONSTANT name n:STRING_CONSTANT source s:PRJ_ITM_PROTOTYPE generic_count c:INTEGER <-
+ - make f:STRING_CONSTANT name n:STRING_CONSTANT source s:PRJ_ITEM generic_count c:INTEGER <-
( //+ file:STD_FILE;
//+ entry:ENTRY;
+ file:POINTER;
--
Lisaac compiler
More information about the Lisaac-commits
mailing list