[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-524-g9d0708a
Benoit Sonntag
sonntag at icps.u-strasbg.fr
Tue Oct 27 19:35:48 UTC 2009
The following commit has been merged in the master branch:
commit 9d0708afc31f2ee5025cddfcc9a6725206a3ee84
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date: Tue Oct 27 20:35:44 2009 +0100
bug mildred 312024 begin
diff --git a/lib/base/character.li b/lib/base/character.li
index f4beaa6..754ef79 100644
--- a/lib/base/character.li
+++ b/lib/base/character.li
@@ -37,7 +37,7 @@ Section Insert
Section Public
- - in_range low:CHARACTER to up:CHARACTER :BOOLEAN <- ((Self >= low) && {Self<= up});
+ - in_range lower:SELF to upper:SELF :BOOLEAN <- ((Self >= lower) && {Self<= upper});
//
// General :
@@ -153,19 +153,19 @@ Section Public
- Self:SELF '!==' other:CHARACTER :BOOLEAN <- (code !== other.code);
// Comparison using `code'.
- - Self:SELF '==' Right 60 other:CHARACTER :BOOLEAN <- (code == other.code);
+ - Self:SELF '==' Right 60 other:SELF :BOOLEAN <- (code == other.code);
// Comparison using `code'.
- - Self:SELF '<' other:CHARACTER :BOOLEAN <- ( code < other.code );
+ - Self:SELF '<' other:SELF :BOOLEAN <- ( code < other.code );
// Comparison using `code'.
- - Self:SELF '<=' other:CHARACTER :BOOLEAN <- ( code <= other.code );
+ - Self:SELF '<=' other:SELF :BOOLEAN <- ( code <= other.code );
// Comparison using `code'.
- - Self:SELF '>' other:CHARACTER :BOOLEAN <- ( code > other.code );
+ - Self:SELF '>' other:SELF :BOOLEAN <- ( code > other.code );
// Comparison using `code'.
- - Self:SELF '>=' other:CHARACTER :BOOLEAN <- ( code >= other.code );
+ - Self:SELF '>=' other:SELF :BOOLEAN <- ( code >= other.code );
// Comparison using `code'.
- decimal_value:INTEGER <-
@@ -229,9 +229,9 @@ Section Public
result
);
- - to_upper:CHARACTER <-
+ - to_upper:SELF <-
// Conversion to the corresponding upper case.
- ( + result:CHARACTER;
+ ( + result:SELF;
((code < 97) || {code > 122}).if {
result := Self;
} else {
@@ -240,9 +240,9 @@ Section Public
result
);
- - to_lower:CHARACTER <-
+ - to_lower:SELF <-
// Conversion to the corresponding lower case.
- ( + result:CHARACTER;
+ ( + result:SELF;
((code < 65) || {code > 90}).if {
result := Self;
} else {
diff --git a/lib/base/low_level/character_ref.li b/lib/base/low_level/character_ref.li
index dcbf297..b973d00 100644
--- a/lib/base/low_level/character_ref.li
+++ b/lib/base/low_level/character_ref.li
@@ -47,7 +47,7 @@ Section Public
item < other.item
);
- - code:INTEGER <-
+ - code:INTEGER_8 <-
// ASCII code of Current
(
item.code
diff --git a/lib/collection/fast_array.li b/lib/collection/fast_array.li
index 0e075dd..4961b3f 100644
--- a/lib/collection/fast_array.li
+++ b/lib/collection/fast_array.li
@@ -313,7 +313,7 @@ Section Public
+? { capacity = Old capacity };
];
- - copy other:FAST_ARRAY(V) <-
+ - copy other:SELF <-
// Copy `other' onto Current.
( + other_upper, new_capacity:INTEGER;
@@ -387,16 +387,14 @@ Section Public
};
);
- - Self:SELF '==' Right 60 other:COLLECTION(V) :BOOLEAN <-
+ - Self:SELF '==' Right 60 other:SELF :BOOLEAN <-
( + result:BOOLEAN;
- + o:SELF;
-
+
( Self = other).if {
result := TRUE;
- } else {
- o ?= other;
- ((o != NULL) && { upper = o.upper }).if {
- result := storage.fast_memcmp (o.storage) until (upper + 1) ;
+ } else {
+ ((other != NULL) && { upper = other.upper }).if {
+ result := storage.fast_memcmp (other.storage) until (upper + 1) ;
};
};
diff --git a/lib/collection/low_level/collection.li b/lib/collection/low_level/collection.li
index 87984c5..9f973d8 100644
--- a/lib/collection/low_level/collection.li
+++ b/lib/collection/low_level/collection.li
@@ -510,7 +510,21 @@ Section Public
// Looking and comparison:
//
- - Self:SELF '==' Right 60 other:COLLECTION(V) :BOOLEAN <-
+ - Self:SELF '==' Right 60 other:SELF :BOOLEAN <-
+ // Do both collections have the same `lower', `upper', and
+ // items?
+ // The basic `=' is used for comparison of items.
+ //
+ // * See: `is_equal_map', `same_items'.
+ (
+ deferred;
+ FALSE
+ )
+ [
+ +? { Result ->> {(lower = other.lower) & (upper = other.upper)} };
+ ];
+
+ - Self:SELF '~=' Right 60 other:COLLECTION(V) :BOOLEAN <-
// Do both collections have the same `lower', `upper', and
// items?
// The basic `=' is used for comparison of items.
diff --git a/lib/io/input_stream.li b/lib/io/input_stream.li
index 9119fd8..cb57e9b 100644
--- a/lib/io/input_stream.li
+++ b/lib/io/input_stream.li
@@ -67,12 +67,13 @@ Section Public
// To read one character at a time:
- - read_character <-
+ - read_character:CHARACTER <-
// Read a character and assign it to `last_character'.
- (
+ ( + result:CHARACTER;
? {! end_of_input};
deferred;
? {! push_back_flag};
+ result
);
diff --git a/lib/io/std_input.li b/lib/io/std_input.li
index 7d756e4..3fa5cfc 100644
--- a/lib/io/std_input.li
+++ b/lib/io/std_input.li
@@ -75,17 +75,17 @@ Section Public
result
);
- - read_line_in str:STRING <-
+ - read_line_in buffer:STRING <-
// Real all character until \n (so read a line)
(
+ mem:CHARACTER;
read_character;
( (last_character != '\n') && { memory != basic_io_eof } ).if {
- str.extend memory;
+ buffer.extend memory;
mem := basic_io_getc;
{ (mem = basic_io_eof) || {mem = '\n'} }.until_do {
- str.extend mem;
+ buffer.extend mem;
mem := basic_io_getc;
};
memory := mem;
diff --git a/lib/kernel/pointer.li b/lib/kernel/pointer.li
index 5110850..3522db2 100644
--- a/lib/kernel/pointer.li
+++ b/lib/kernel/pointer.li
@@ -38,7 +38,7 @@ Section Insert
Section Public
- - in_range low:INTEGER_64 to up:UINTEGER_64 :BOOLEAN <- TRUE; // BSBS: A revoir.
+ - in_range low:SELF to up:SELF :BOOLEAN <- TRUE; // BSBS: A revoir.
- object_size:INTEGER <- `sizeof(void *)`:INTEGER;
diff --git a/lib/memory/memory.li b/lib/memory/memory.li
index b465dec..9dd540a 100644
--- a/lib/memory/memory.li
+++ b/lib/memory/memory.li
@@ -72,10 +72,13 @@ Section Private
- demark_object ptr:POINTER type t:INTEGER <- `demark_object(@ptr, at t)`;
*/
-Section MEMORY
+
+Section Public
- object_size:INTEGER <- POINTER.object_size + UINTEGER_CPU.object_size;
+Section MEMORY
+
- this:POINTER <- CONVERT(MEMORY,POINTER).on Self;
- begin:POINTER <- this + object_size;
diff --git a/lib/string/abstract_string.li b/lib/string/abstract_string.li
index 4038cc7..c4caf7a 100644
--- a/lib/string/abstract_string.li
+++ b/lib/string/abstract_string.li
@@ -79,14 +79,14 @@ Section Public
- when value:ABSTRACT_STRING then block:{} :ABSTRACT_STRING <-
// When `Self' equal `value', execute `block'
(
- (Self == value).if block;
+ (Self ~= value).if block;
Self
);
- when value1:ABSTRACT_STRING or value2:ABSTRACT_STRING then block:{} :ABSTRACT_STRING <-
// When `Self' equal `value1' or `value2', execute `block'
(
- ((Self == value1) || {Self == value2}).if block;
+ ((Self ~= value1) || {Self ~= value2}).if block;
Self
);
@@ -94,7 +94,7 @@ Section Public
// * See: `when_then'
( + result :ABSTRACT_STRING;
- ((Self != ABSTRACT_STRING) && {Self == value}).if {
+ ((Self != ABSTRACT_STRING) && {Self ~= value}).if {
block.value;
result := ABSTRACT_STRING;
} else {
@@ -220,7 +220,13 @@ Section Public
result
);
- - Self:SELF '==' Left 40 other:ABSTRACT_STRING :BOOLEAN <-
+ - Self:SELF '==' Left 40 other:SELF :BOOLEAN <-
+ // Has Current the same text as `other' ?
+ (
+ Self ~= other
+ );
+
+ - Self:SELF '~=' Left 40 other:ABSTRACT_STRING :BOOLEAN <-
// Has Current the same text as `other' ?
( + result:BOOLEAN;
? {other != NULL};
diff --git a/src/code_life/call_slot.li b/src/code_life/call_slot.li
index 43b561e..0dae3b9 100644
--- a/src/code_life/call_slot.li
+++ b/src/code_life/call_slot.li
@@ -187,8 +187,7 @@ Section Private
+ loc:LOCAL;
+ prof_block:PROFIL_BLOCK;
- (source = list_current).if {
- list_current.debug_display;
+ (source = list_current).if {
POSITION.put_error semantic text "Recursivity without end (call_slot).";
source.position.put_position;
position.put_position;
diff --git a/src/code_life/expr.li b/src/code_life/expr.li
index 0fc9d18..55df16c 100644
--- a/src/code_life/expr.li
+++ b/src/code_life/expr.li
@@ -40,9 +40,9 @@ Section Public
// Comparison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <- FALSE;
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <- FALSE;
- - Self:SELF '!==' Right 60 other:EXPR :BOOLEAN <- ! (Self == other);
+ - Self:SELF '!~=' Right 60 other:EXPR :BOOLEAN <- ! (Self ~= other);
//
// Type.
diff --git a/src/code_life/read.li b/src/code_life/read.li
index 9d07ad8..f3747f1 100644
--- a/src/code_life/read.li
+++ b/src/code_life/read.li
@@ -98,7 +98,7 @@ Section Public
j := req_list.lower;
{(j > req_list.upper) || {result = NULL}}.until_do {
val := req_list.item j.value;
- ((! val.is_constant) || {result !== val}).if {
+ ((! val.is_constant) || {result !~= val}).if {
result := NULL;
};
j := j + 1;
diff --git a/src/code_life/read_global.li b/src/code_life/read_global.li
index 61127da..0c35093 100644
--- a/src/code_life/read_global.li
+++ b/src/code_life/read_global.li
@@ -44,7 +44,7 @@ Section Public
// Comparison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + rd:READ_GLOBAL;
rd ?= other;
diff --git a/src/code_life/read_local.li b/src/code_life/read_local.li
index 259a258..3974221 100644
--- a/src/code_life/read_local.li
+++ b/src/code_life/read_local.li
@@ -44,7 +44,7 @@ Section Public
// Comparison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + rd:READ_LOCAL;
rd ?= other;
diff --git a/src/code_life/read_slot.li b/src/code_life/read_slot.li
index d425a36..b6eda5f 100644
--- a/src/code_life/read_slot.li
+++ b/src/code_life/read_slot.li
@@ -50,11 +50,11 @@ Section Public
// Comparison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + rd:READ_SLOT;
rd ?= other;
- ((rd != NULL) && {slot = rd.slot} && {receiver == rd.receiver})
+ ((rd != NULL) && {slot = rd.slot} && {receiver ~= rd.receiver})
);
//
diff --git a/src/constant/character_cst.li b/src/constant/character_cst.li
index cd811bb..da65801 100644
--- a/src/constant/character_cst.li
+++ b/src/constant/character_cst.li
@@ -64,7 +64,7 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + s:SELF;
s ?= other;
(s != NULL) && {text = s.text}
diff --git a/src/constant/integer_cst.li b/src/constant/integer_cst.li
index 84d6030..d782b6e 100644
--- a/src/constant/integer_cst.li
+++ b/src/constant/integer_cst.li
@@ -123,7 +123,7 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + p:INTEGER_CST;
p ?= other;
(p != NULL) && {value = p.value} && {static_type = p.static_type}
diff --git a/src/constant/native_array_character_cst.li b/src/constant/native_array_character_cst.li
index 8b8a87e..7a10894 100644
--- a/src/constant/native_array_character_cst.li
+++ b/src/constant/native_array_character_cst.li
@@ -64,7 +64,7 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + p:NATIVE_ARRAY_CHARACTER_CST;
p ?= other;
(p != NULL) && {string = p.string}
diff --git a/src/constant/prototype_cst.li b/src/constant/prototype_cst.li
index 3915a77..71185ff 100644
--- a/src/constant/prototype_cst.li
+++ b/src/constant/prototype_cst.li
@@ -63,7 +63,7 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + p:PROTOTYPE_CST;
p ?= other;
(p != NULL) && {static_type = p.static_type}
diff --git a/src/constant/real_cst.li b/src/constant/real_cst.li
index 4dcaf92..a5fc56d 100644
--- a/src/constant/real_cst.li
+++ b/src/constant/real_cst.li
@@ -64,7 +64,7 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + p:REAL_CST;
p ?= other;
(p != NULL) && {value = p.value} && {static_type = p.static_type}
diff --git a/src/constant/string_cst.li b/src/constant/string_cst.li
index e1c927d..4e05965 100644
--- a/src/constant/string_cst.li
+++ b/src/constant/string_cst.li
@@ -75,7 +75,7 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + p:STRING_CST;
p ?= other;
(p != NULL) && {string = p.string}
diff --git a/src/dispatcher/dta_rd_args.li b/src/dispatcher/dta_rd_args.li
index c6191bc..06450d1 100644
--- a/src/dispatcher/dta_rd_args.li
+++ b/src/dispatcher/dta_rd_args.li
@@ -30,7 +30,7 @@ Section Header
Section Inherit
- + parent_dta:Expanded DTA_RD;
+ + parent_dta_rd:Expanded DTA_RD;
Section Public
diff --git a/src/dispatcher/dta_wr_code.li b/src/dispatcher/dta_wr_code.li
index c7c30cf..87faa7e 100644
--- a/src/dispatcher/dta_wr_code.li
+++ b/src/dispatcher/dta_wr_code.li
@@ -78,7 +78,7 @@ Section Public
// Service
//
-Section DTA_RD
+Section DTA
- finalise typ:TYPE with (expr:EXPR,s:SLOT) in lst:LIST <-
( + id:PROTOTYPE_CST;
diff --git a/src/dispatcher/dta_wr_value.li b/src/dispatcher/dta_wr_value.li
index 7914764..f59e9fd 100644
--- a/src/dispatcher/dta_wr_value.li
+++ b/src/dispatcher/dta_wr_value.li
@@ -128,7 +128,7 @@ Section NODE_TYPE, DTA
result
);
-Section DTA_RD
+Section DTA
- finalise typ:TYPE with (expr:EXPR,s:SLOT) in lst:LIST <-
( + new_value:EXPR;
diff --git a/src/external/arithmetic/expr_add.li b/src/external/arithmetic/expr_add.li
index 05b5658..6386f7e 100644
--- a/src/external/arithmetic/expr_add.li
+++ b/src/external/arithmetic/expr_add.li
@@ -32,7 +32,7 @@ Section Inherit
+ parent_expr_binary:Expanded EXPR_BINARY;
-Section Private
+Section Public
+ symbol:STRING_CONSTANT := "+";
diff --git a/src/external/arithmetic/expr_and.li b/src/external/arithmetic/expr_and.li
index 791e9b0..2385866 100644
--- a/src/external/arithmetic/expr_and.li
+++ b/src/external/arithmetic/expr_and.li
@@ -32,7 +32,7 @@ Section Inherit
+ parent_expr_binary:Expanded EXPR_BINARY;
-Section Private
+Section Public
- symbol:STRING_CONSTANT := "&";
diff --git a/src/external/arithmetic/expr_binary.li b/src/external/arithmetic/expr_binary.li
index e1a656d..ba120a2 100644
--- a/src/external/arithmetic/expr_binary.li
+++ b/src/external/arithmetic/expr_binary.li
@@ -79,11 +79,11 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + same:SELF;
same ?= other;
- (same != NULL) && {left == same.left} && {right == same.right}
+ (same != NULL) && {left ~= same.left} && {right ~= same.right}
);
//
diff --git a/src/external/arithmetic/expr_div.li b/src/external/arithmetic/expr_div.li
index 2bf4d7d..1f39490 100644
--- a/src/external/arithmetic/expr_div.li
+++ b/src/external/arithmetic/expr_div.li
@@ -32,7 +32,7 @@ Section Inherit
+ parent_expr_binary:Expanded EXPR_BINARY;
-Section Private
+Section Public
- symbol:STRING_CONSTANT := "/";
diff --git a/src/external/arithmetic/expr_neg.li b/src/external/arithmetic/expr_neg.li
index 1b8c1e6..fb36e0f 100644
--- a/src/external/arithmetic/expr_neg.li
+++ b/src/external/arithmetic/expr_neg.li
@@ -32,7 +32,7 @@ Section Inherit
+ parent_expr_unary:Expanded EXPR_UNARY;
-Section Private
+Section Public
- symbol:CHARACTER <- '-';
diff --git a/src/external/arithmetic/expr_not.li b/src/external/arithmetic/expr_not.li
index f94579d..bdc046a 100644
--- a/src/external/arithmetic/expr_not.li
+++ b/src/external/arithmetic/expr_not.li
@@ -32,7 +32,7 @@ Section Inherit
+ parent_expr_unary:Expanded EXPR_UNARY;
-Section Private
+Section Public
- symbol:CHARACTER <- '~';
diff --git a/src/external/arithmetic/expr_or.li b/src/external/arithmetic/expr_or.li
index 1441666..f18cfe3 100644
--- a/src/external/arithmetic/expr_or.li
+++ b/src/external/arithmetic/expr_or.li
@@ -32,7 +32,7 @@ Section Inherit
+ parent_expr_binary:Expanded EXPR_BINARY;
-Section Private
+Section Public
- symbol:STRING_CONSTANT := "|";
diff --git a/src/external/arithmetic/expr_shift_l.li b/src/external/arithmetic/expr_shift_l.li
index e426846..2be4257 100644
--- a/src/external/arithmetic/expr_shift_l.li
+++ b/src/external/arithmetic/expr_shift_l.li
@@ -32,7 +32,7 @@ Section Inherit
+ parent_expr_binary:Expanded EXPR_BINARY;
-Section Private
+Section Public
+ symbol:STRING_CONSTANT := "<<";
diff --git a/src/external/arithmetic/expr_shift_r.li b/src/external/arithmetic/expr_shift_r.li
index d40614c..74b6d42 100644
--- a/src/external/arithmetic/expr_shift_r.li
+++ b/src/external/arithmetic/expr_shift_r.li
@@ -32,7 +32,7 @@ Section Inherit
+ parent_expr_binary:Expanded EXPR_BINARY;
-Section Private
+Section Public
+ symbol:STRING_CONSTANT := ">>";
diff --git a/src/external/arithmetic/expr_unary.li b/src/external/arithmetic/expr_unary.li
index a145966..32bf833 100644
--- a/src/external/arithmetic/expr_unary.li
+++ b/src/external/arithmetic/expr_unary.li
@@ -75,11 +75,11 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + same:SELF;
same ?= other;
- (same != NULL) && {right == same.right}
+ (same != NULL) && {right ~= same.right}
);
- remove <-
diff --git a/src/external/comparison/expr_binary_cmp.li b/src/external/comparison/expr_binary_cmp.li
index 6ec7670..c19f3ff 100644
--- a/src/external/comparison/expr_binary_cmp.li
+++ b/src/external/comparison/expr_binary_cmp.li
@@ -85,11 +85,11 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + same:SELF;
same ?= other;
- (same != NULL) && {left == same.left} && {right == same.right}
+ (same != NULL) && {left ~= same.left} && {right ~= same.right}
);
//
diff --git a/src/external/logic/expr_binary_logic.li b/src/external/logic/expr_binary_logic.li
index 89fe690..02e98d9 100644
--- a/src/external/logic/expr_binary_logic.li
+++ b/src/external/logic/expr_binary_logic.li
@@ -79,11 +79,11 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + same:SELF;
same ?= other;
- (same != NULL) && {left == same.left} && {right == same.right}
+ (same != NULL) && {left ~= same.left} && {right ~= same.right}
);
//
diff --git a/src/external/logic/expr_unary_logic.li b/src/external/logic/expr_unary_logic.li
index a952b59..8b3e908 100644
--- a/src/external/logic/expr_unary_logic.li
+++ b/src/external/logic/expr_unary_logic.li
@@ -76,11 +76,11 @@ Section Public
// Comparaison.
//
- - Self:SELF '==' Right 60 other:EXPR :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:EXPR :BOOLEAN <-
( + same:SELF;
same ?= other;
- (same != NULL) && {right == same.right}
+ (same != NULL) && {right ~= same.right}
);
- remove <-
diff --git a/src/hello.li b/src/hello.li
index 9e0b839..7efb679 100644
--- a/src/hello.li
+++ b/src/hello.li
@@ -29,10 +29,16 @@ Section Header
Section Inherit
- - parent_object:OBJECT := OBJECT;
+ + parent_string:Expanded STRING;
Section Public
+ - main <-
+ ( + c:HELLO;
+ c := HELLO;
+ `/* @c */`;
+ );
+/*
- main <-
( + str:STRING;
@@ -59,4 +65,4 @@ Section Public
"------------------\n".print;
};
);
-
+*/
diff --git a/src/item/itm_slot.li b/src/item/itm_slot.li
index 12e28d1..d8b1e1f 100644
--- a/src/item/itm_slot.li
+++ b/src/item/itm_slot.li
@@ -120,7 +120,7 @@ Section Public
- is_equal_profil other:ITM_SLOT <-
(
- (Self != other).if {
+ (Self != other).if {
(result_type != other.result_type).if {
string_tmp.copy "Invariance type result invalid."; // (";
//type.to_run.append_name_in string_tmp;
diff --git a/src/item/itm_type_generic.li b/src/item/itm_type_generic.li
index 300f50c..f5bfe6b 100644
--- a/src/item/itm_type_generic.li
+++ b/src/item/itm_type_generic.li
@@ -33,7 +33,7 @@ Section Inherit
Section Private
- - dico:FAST_ARRAY(ITM_TYPE_GENERIC) := FAST_ARRAY(ITM_TYPE_GENERIC).create_with_capacity 32;
+ - dico_tg:FAST_ARRAY(ITM_TYPE_GENERIC) := FAST_ARRAY(ITM_TYPE_GENERIC).create_with_capacity 32;
- create n:STRING_CONSTANT style s:STRING_CONSTANT with lt:FAST_ARRAY(ITM_TYPE_MONO) :SELF <-
( + result:SELF;
@@ -61,21 +61,21 @@ Section Public
( + result:SELF;
+ idx:INTEGER;
- idx := dico.lower;
+ idx := dico_tg.lower;
{
- (idx <= dico.upper) && {
- (dico.item idx.name != n ) ||
- {dico.item idx.style != s } ||
- {dico.item idx.list_type != lt}
+ (idx <= dico_tg.upper) && {
+ (dico_tg.item idx.name != n ) ||
+ {dico_tg.item idx.style != s } ||
+ {dico_tg.item idx.list_type != lt}
}
}.while_do {
idx := idx + 1;
};
- (idx <= dico.upper).if {
- result ?= dico.item idx;
+ (idx <= dico_tg.upper).if {
+ result ?= dico_tg.item idx;
} else {
result := create n style s with lt;
- dico.add_last result;
+ dico_tg.add_last result;
};
result
);
diff --git a/src/item/itm_type_parameter.li b/src/item/itm_type_parameter.li
index 749c98c..1f24b41 100644
--- a/src/item/itm_type_parameter.li
+++ b/src/item/itm_type_parameter.li
@@ -29,7 +29,7 @@ Section Header
Section Inherit
- + parent_itm_type:Expanded ITM_TYPE_SIMPLE;
+ + parent_itm_type_simple:Expanded ITM_TYPE_SIMPLE;
Section Public
diff --git a/src/item/itm_type_style.li b/src/item/itm_type_style.li
index 4b51e2a..d3c52d0 100644
--- a/src/item/itm_type_style.li
+++ b/src/item/itm_type_style.li
@@ -34,7 +34,7 @@ Section Inherit
Section Private
- - dico:FAST_ARRAY(ITM_TYPE_STYLE) := FAST_ARRAY(ITM_TYPE_STYLE).create_with_capacity 32;
+ - dico_ts:FAST_ARRAY(ITM_TYPE_STYLE) := FAST_ARRAY(ITM_TYPE_STYLE).create_with_capacity 32;
- create n:STRING_CONSTANT style s:STRING_CONSTANT :SELF <-
( + result:SELF;
@@ -58,20 +58,20 @@ Section Public
( + result:SELF;
+ idx:INTEGER;
- idx := dico.lower;
+ idx := dico_ts.lower;
{
- (idx <= dico.upper) && {
- (dico.item idx.name != n) ||
- {dico.item idx.style != s}
+ (idx <= dico_ts.upper) && {
+ (dico_ts.item idx.name != n) ||
+ {dico_ts.item idx.style != s}
}
}.while_do {
idx := idx + 1;
};
- (idx <= dico.upper).if {
- result ?= dico.item idx;
+ (idx <= dico_ts.upper).if {
+ result ?= dico_ts.item idx;
} else {
result := create n style s;
- dico.add_last result;
+ dico_ts.add_last result;
};
result
);
diff --git a/src/lip/lip_binary.li b/src/lip/lip_binary.li
index 29921aa..077ee6a 100644
--- a/src/lip/lip_binary.li
+++ b/src/lip/lip_binary.li
@@ -71,8 +71,8 @@ Section Public
(operator)
.when '|' then { result := lv | rv; }
.when '&' then { result := lv & rv; }
- .when '=' then { result := lv == rv; }
- .when 'E' then { result := lv !== rv; }
+ .when '=' then { result := lv ~= rv; }
+ .when 'E' then { result := lv !~= rv; }
.when '>' then { result := lv > rv; }
.when '<' then { result := lv < rv; }
.when 'S' then { result := lv >= rv; }
diff --git a/src/lip/lip_constant.li b/src/lip/lip_constant.li
index 5577718..6facb50 100644
--- a/src/lip/lip_constant.li
+++ b/src/lip/lip_constant.li
@@ -116,7 +116,7 @@ Section Public
result
);
- - Self:SELF '==' other:LIP_CONSTANT :LIP_CONSTANT <-
+ - Self:SELF '~=' other:LIP_CONSTANT :LIP_CONSTANT <-
( + result:LIP_CONSTANT;
+ s:SELF;
s ?= other;
@@ -146,7 +146,7 @@ Section Public
result
);
- - Self:SELF '!==' other:LIP_CONSTANT :LIP_CONSTANT <-
+ - Self:SELF '!~=' other:LIP_CONSTANT :LIP_CONSTANT <-
( + result:LIP_CONSTANT;
+ s:SELF;
s ?= other;
diff --git a/src/lisaac.li b/src/lisaac.li
index aad4f75..7bcaa23 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -215,9 +215,9 @@ Section Private
arg := NULL;
(t = ALIAS_STR.prototype_boolean).if {
cmd.to_upper;
- (cmd == "TRUE").if {
+ (cmd ~= "TRUE").if {
arg := LIP_BOOLEAN.get TRUE;
- }.elseif {cmd == "FALSE"} then {
+ }.elseif {cmd ~= "FALSE"} then {
arg := LIP_BOOLEAN.get FALSE;
};
}.elseif {t = ALIAS_STR.prototype_integer} then {
diff --git a/src/profil_block.li b/src/profil_block.li
index 7167834..035fd60 100644
--- a/src/profil_block.li
+++ b/src/profil_block.li
@@ -265,7 +265,7 @@ Section Public
- is_block:BOOLEAN := TRUE;
- - Self:SELF '==' Right 60 other:TYPE :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:TYPE :BOOLEAN <-
(
other = to_type_block
);
@@ -362,7 +362,7 @@ Section Public
( + result:BOOLEAN;
+ t:TYPE_BLOCK;
- result := Self == other;
+ result := Self ~= other;
(result).if_false {
t ?= other;
result := (
diff --git a/src/tools/alias_array.li b/src/tools/alias_array.li
index 6ad575f..8da2e0b 100644
--- a/src/tools/alias_array.li
+++ b/src/tools/alias_array.li
@@ -30,7 +30,7 @@ Section Header
Section Inherit
- - parent_object:ANY := ANY;
+ - parent_any:ANY := ANY;
Section Private
diff --git a/src/tools/alias_str.li b/src/tools/alias_str.li
index 71957dc..a8f9d16 100644
--- a/src/tools/alias_str.li
+++ b/src/tools/alias_str.li
@@ -278,7 +278,7 @@ Section Public
} else {
result ?= tmp;
};
- ? {result == str};
+ ? {result ~= str};
result
);
diff --git a/src/tools/types.li b/src/tools/types.li
index 04eb5bd..d3ae187 100644
--- a/src/tools/types.li
+++ b/src/tools/types.li
@@ -76,7 +76,7 @@ Section Public
)
[ +? {Result != NULL}; ];
- - Self:SELF '==' Right 60 other:TYPES :BOOLEAN <-
+ - Self:SELF '~=' Right 60 other:TYPES :BOOLEAN <-
(
(Self = other) ||
{
diff --git a/src/tools/types_tmp.li b/src/tools/types_tmp.li
index 2e8a2fa..f1842b2 100644
--- a/src/tools/types_tmp.li
+++ b/src/tools/types_tmp.li
@@ -111,7 +111,7 @@ Section Public
bucket.fast_add result;
};
};
- 20 ? {result == Self};
+ 20 ? {result ~= Self};
free;
result
diff --git a/src/type/prototype.li b/src/type/prototype.li
index b92cbf8..895ff4a 100644
--- a/src/type/prototype.li
+++ b/src/type/prototype.li
@@ -91,15 +91,18 @@ Section Public
// Parent.
cur := first_slot;
- {(cur != NULL) && {cur.id_section.is_inherit_or_insert}}.while_do {
+ {(cur != NULL) && {cur.id_section.is_inherit_or_insert}}.while_do {
typ.slot_run.add_last (SLOT.create cur type typ);
+ typ.verify_cyclic_inheritance typ;
+ typ.verify_itm_slot_parent cur;
cur := cur.next;
};
// Mapping.
(is_mapping).if {
{cur != NULL}.while_do {
(cur.id_section.is_mapping).if {
- ? {cur.style = '+'};
+ ? {cur.style = '+'};
+ typ.verify_itm_slot_parent cur;
typ.slot_run.add_last (SLOT.create cur type typ);
};
cur := cur.next;
diff --git a/src/type/type.li b/src/type/type.li
index 31be2f0..61d0dc6 100644
--- a/src/type/type.li
+++ b/src/type/type.li
@@ -263,7 +263,8 @@ Section Public
result := slot_run.item j;
} else {
itm_slot := prototype.slot_list.fast_reference_at n;
- (itm_slot != NULL).if {
+ (itm_slot != NULL).if {
+ verify_itm_slot_parent itm_slot;
result := SLOT.create itm_slot type Self;
slot_run.add_last result;
};
@@ -905,7 +906,7 @@ Section Public
- is_block:BOOLEAN := FALSE;
- - Self:SELF '==' Right 60 other:TYPE :BOOLEAN <- (Self = other);
+ - Self:SELF '~=' Right 60 other:TYPE :BOOLEAN <- (Self = other);
- is_sub_type other:TYPE :BOOLEAN <-
( + result:BOOLEAN;
@@ -1165,4 +1166,49 @@ Section Private
};
result
);
-
\ No newline at end of file
+
+Section TYPE,PROTOTYPE
+
+ - verify_itm_slot_parent ref:ITM_SLOT <-
+ ( + idx:INTEGER;
+ + type_parent:TYPE;
+ + ts:ITM_TYPE_SIMPLE;
+ + other:ITM_SLOT;
+
+ idx := slot_run.lower;
+ {
+ (idx <= slot_run.upper) &&
+ {slot_run.item idx.id_section.is_inherit_or_insert}
+ }.while_do {
+ ts ?= slot_run.item idx.result_type;
+ type_parent := ts.to_run_for Self.raw;
+ other := type_parent.prototype.slot_list.fast_reference_at (ref.name);
+ (other != NULL).if {
+ ref.is_equal_profil other;
+ };
+ type_parent.verify_itm_slot_parent ref;
+ idx := idx + 1;
+ };
+ );
+
+ - verify_cyclic_inheritance ref:TYPE <-
+ ( + idx:INTEGER;
+ + type_parent:TYPE;
+ + ts:ITM_TYPE_SIMPLE;
+ + s:SLOT;
+
+ idx := slot_run.lower;
+ {
+ (idx <= slot_run.upper) &&
+ {slot_run.item idx.id_section.is_inherit_or_insert}
+ }.while_do {
+ s := slot_run.item idx;
+ ts ?= s.result_type;
+ type_parent := ts.to_run_for Self.raw;
+ (type_parent = ref).if {
+ semantic_error (s.position,"Static cyclic inheritance.");
+ };
+ type_parent.verify_cyclic_inheritance ref;
+ idx := idx + 1;
+ };
+ );
\ No newline at end of file
diff --git a/src/type/type_full.li b/src/type/type_full.li
index 2aab477..de113e8 100644
--- a/src/type/type_full.li
+++ b/src/type/type_full.li
@@ -121,12 +121,12 @@ Section Public
- is_expanded_c:BOOLEAN <- (is_expanded) && {raw.type_c != NULL};
- - Self:SELF '==' Right 60 other:TYPE_FULL :BOOLEAN <-
+ - Self:SELF '==' Right 60 other:SELF :BOOLEAN <-
(
(Self = other) || {(raw = other.raw) && {(flag & 01111b) = (other.flag & 01111b)}}
);
- - Self:SELF '!==' Right 60 other:TYPE_FULL :BOOLEAN <- ! (Self == other);
+ - Self:SELF '!==' Right 60 other:SELF :BOOLEAN <- ! (Self == other);
- append_name_in buffer:STRING <-
(
diff --git a/src/variable/slot.li b/src/variable/slot.li
index 10fd7de..a8b56fc 100644
--- a/src/variable/slot.li
+++ b/src/variable/slot.li
@@ -46,7 +46,7 @@ Section Public
- create s:ITM_SLOT type t:TYPE :SLOT <-
( + result:SLOT;
-
+
result := clone;
result.make s type t
);
@@ -98,7 +98,7 @@ Section Public
(slot_data_intern = NULL).if {
create_slot_data;
(slot_id = NULL).if {
- slot_id := SLOT_DATA.create common_slot type (TYPE_ID.get_index 1.default);
+ slot_id := SLOT_DATA.create common_slot type_full (TYPE_ID.get_index 1.default);
slot_id.init;
};
};
@@ -123,7 +123,7 @@ Section Public
slot := SLOT_CODE.create common_slot with v;
(slot_code_intern = NULL).if {
slot_code_intern := slot;
- slot_id := SLOT_DATA.create common_slot type (TYPE_ID.get_index 0.default);
+ slot_id := SLOT_DATA.create common_slot type_full (TYPE_ID.get_index 0.default);
slot_id.init;
result := 1;
} else {
@@ -132,7 +132,7 @@ Section Public
};
slot_code_list.add_last slot;
(slot_id = NULL).if {
- slot_id := SLOT_DATA.create common_slot type (TYPE_ID.get_index 1.default);
+ slot_id := SLOT_DATA.create common_slot type_full (TYPE_ID.get_index 1.default);
slot_id.init;
};
result := slot_code_list.upper + 2;
@@ -170,7 +170,7 @@ Section Public
(tm.lower).to (tm.upper-1) do { k:INTEGER;
typ := tm.item k.to_run_for receiver_type;
slot_data_list.add_last (
- SLOT_DATA.create common_slot type typ
+ SLOT_DATA.create common_slot type_full typ
);
};
typ := tm.last.to_run_for NULL;
@@ -178,5 +178,5 @@ Section Public
ts ?= result_type;
typ := ts.to_run_for receiver_type;
};
- slot_data_intern := SLOT_DATA.create common_slot type typ;
+ slot_data_intern := SLOT_DATA.create common_slot type_full typ;
);
\ No newline at end of file
diff --git a/src/variable/slot_data.li b/src/variable/slot_data.li
index 0bb43d9..750314a 100644
--- a/src/variable/slot_data.li
+++ b/src/variable/slot_data.li
@@ -284,7 +284,7 @@ Section Public
// Constructeur.
//
- - create b:SLOT type t:TYPE_FULL :SELF <-
+ - create b:SLOT type_full t:TYPE_FULL :SELF <-
(
create (b.position) name (b.name) style (b.style) base b type t
);
--
Lisaac compiler
More information about the Lisaac-commits
mailing list