From 1c2829fd90e503a1448463c5fe34f1769cd57875 Mon Sep 17 00:00:00 2001 From: Cédric Ricard Date: Wed, 6 Aug 2008 10:06:49 +0000 Subject: [PATCH] Fix compile problems due to lexical change for list ( [h . t] -> '.' have to be followed by a space) --- anubis_dev/library/graphism/charts.anubis | 2 +- anubis_dev/library/locale/L3.anubis | 2 +- anubis_dev/library/locale/L3LanguageInfo.anubis | 2 +- anubis_dev/library/network/dns.anubis | 2 +- anubis_dev/library/system/files.anubis | 12 ++++++------ anubis_dev/library/system/logger.anubis | 2 +- anubis_dev/library/system/muscle.anubis | 2 +- anubis_dev/library/system/parameter/inifile.anubis | 4 ++-- anubis_dev/library/system/string.anubis | 2 +- anubis_dev/library/test/Anubis UnitTest.aproj | 2 ++ anubis_dev/library/test/Anubis UnitTest.ide | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ anubis_dev/library/test/tools/utf-8.unit_test.anubis | 63 ++++++++++++++++++++++++++++++++++++++++----------------------- anubis_dev/library/tools/unit_test.anubis | 2 +- 13 files changed, 107 insertions(+), 39 deletions(-) diff --git a/anubis_dev/library/graphism/charts.anubis b/anubis_dev/library/graphism/charts.anubis index 918ac97..db3cd9b 100644 --- a/anubis_dev/library/graphism/charts.anubis +++ b/anubis_dev/library/graphism/charts.anubis @@ -830,7 +830,7 @@ define (List(Y_ScaleValue),Int) //Int->lg de l'étiquette la plus grande if values is { [] then (lysv,max_ypx+8), // 8 = 5+3 = marge + longueur du tiret - [y.t] then + [y . t] then with ypx = text_length(scale_font,y), make_ysvalue(scale_font,t, [y_svalue(ypx,y) . lysv], diff --git a/anubis_dev/library/locale/L3.anubis b/anubis_dev/library/locale/L3.anubis index f0d0843..8eca3ef 100644 --- a/anubis_dev/library/locale/L3.anubis +++ b/anubis_dev/library/locale/L3.anubis @@ -822,7 +822,7 @@ define Int if lang_list is { [] then current, - [h.t] then + [h . t] then if l3_load_base(collection_name, h) is { failure then get_max_of(collection_name, t, symbolic_name, current) diff --git a/anubis_dev/library/locale/L3LanguageInfo.anubis b/anubis_dev/library/locale/L3LanguageInfo.anubis index 7f763ae..b01c0b2 100644 --- a/anubis_dev/library/locale/L3LanguageInfo.anubis +++ b/anubis_dev/library/locale/L3LanguageInfo.anubis @@ -163,7 +163,7 @@ define String if lang_code_list is { [] then "", - [h.t] then + [h . t] then if h is { symbolic then "symb", diff --git a/anubis_dev/library/network/dns.anubis b/anubis_dev/library/network/dns.anubis index 5255768..6f9e822 100644 --- a/anubis_dev/library/network/dns.anubis +++ b/anubis_dev/library/network/dns.anubis @@ -2007,7 +2007,7 @@ define Maybe(String) failure then if so_far is { [ ] then failure, - [_._] then success(implode(reverse(so_far))) + [_ . _] then success(implode(reverse(so_far))) }, success(c) then if is_blank(c) diff --git a/anubis_dev/library/system/files.anubis b/anubis_dev/library/system/files.anubis index fc4b409..08714be 100644 --- a/anubis_dev/library/system/files.anubis +++ b/anubis_dev/library/system/files.anubis @@ -299,7 +299,7 @@ define ResultCopy if io_list is { [] then copy_ok(so_far), - [ h .t ] then + [ h . t ] then if rewind(h)(unique) then with result = copy_Data_IO_to_Stream(h, target, 0), if result is copy_ok(written) then @@ -319,7 +319,7 @@ public define ResultCopy if io_list is { [] then copy_ok(0), - [ h .t ] then copy_Data_IO_List_to_Stream(io_list, target, 0) + [ h . t ] then copy_Data_IO_List_to_Stream(io_list, target, 0) }. public define ResultCopy @@ -396,24 +396,24 @@ define Maybe(String) if folders is { [] then success(join("/", reverse(so_far))), - [h.t] then + [h . t] then if h = "" | h = "." then if so_far is { [] then normalize_path(t, [h . so_far]), // the first '/'or '.' have to be added to keep absolute or relative path - [_._] then + [_ . _] then if t is { [] then if h = "" then normalize_path(t, [h . so_far]) // the last '/' should be keeped too else normalize_path(t, so_far), // but not the '.' - [_._] then normalize_path(t, so_far) + [_ . _] then normalize_path(t, so_far) } } else if h = ".." then if so_far is { [] then failure, - [_.h2] then normalize_path(t, h2) + [_ . h2] then normalize_path(t, h2) } else normalize_path(t, [h . so_far]) diff --git a/anubis_dev/library/system/logger.anubis b/anubis_dev/library/system/logger.anubis index 8f9a200..3af4507 100644 --- a/anubis_dev/library/system/logger.anubis +++ b/anubis_dev/library/system/logger.anubis @@ -333,7 +333,7 @@ public define Maybe(Logger) if loggers is { [] then failure, - [h .t] then + [h . t] then if h.pl.loggerName = name then success(h) else diff --git a/anubis_dev/library/system/muscle.anubis b/anubis_dev/library/system/muscle.anubis index e94d1df..31615b9 100644 --- a/anubis_dev/library/system/muscle.anubis +++ b/anubis_dev/library/system/muscle.anubis @@ -852,7 +852,7 @@ define Maybe(ByteArray) if t is { [] then success(so_far + flatten_header + flatten_body), - [_ ._] then flatten_fields(t, so_far + flatten_header + flatten_body ) + [_ . _] then flatten_fields(t, so_far + flatten_header + flatten_body ) } } }. diff --git a/anubis_dev/library/system/parameter/inifile.anubis b/anubis_dev/library/system/parameter/inifile.anubis index 0edea5b..4f030ee 100644 --- a/anubis_dev/library/system/parameter/inifile.anubis +++ b/anubis_dev/library/system/parameter/inifile.anubis @@ -93,7 +93,7 @@ define Bool isSection( List(IniSection) sectionList, String sectionName) = if sectionList is { [] then false, //the list is empty, the section doesn't exist - [h .t] then if h is iniSection(name, _) then print("inspecting " +name +" \n"); + [h . t] then if h is iniSection(name, _) then print("inspecting " +name +" \n"); if name = sectionName then true else isSection(t, sectionName) @@ -120,7 +120,7 @@ define List(IniSection) deleteSection (IniInfo i, List(IniSection) sectionList, if sectionList is { [] then [], - [h .t ] then + [h . t ] then if h.name = sectionName then t else diff --git a/anubis_dev/library/system/string.anubis b/anubis_dev/library/system/string.anubis index 2053cf1..37b7f67 100644 --- a/anubis_dev/library/system/string.anubis +++ b/anubis_dev/library/system/string.anubis @@ -453,7 +453,7 @@ define Maybe(List(String)) if string_so_far is { [] then failure, //if the list of string is empty we have failed to find out words - [_._] then success(reverse(string_so_far)) + [_ . _] then success(reverse(string_so_far)) }, [ h . t ] then if is_white_char(h) then diff --git a/anubis_dev/library/test/Anubis UnitTest.aproj b/anubis_dev/library/test/Anubis UnitTest.aproj index cb642b6..17a1a15 100644 --- a/anubis_dev/library/test/Anubis UnitTest.aproj +++ b/anubis_dev/library/test/Anubis UnitTest.aproj @@ -43,9 +43,11 @@ + + \ No newline at end of file diff --git a/anubis_dev/library/test/Anubis UnitTest.ide b/anubis_dev/library/test/Anubis UnitTest.ide index 5cf3ed9..8817200 100644 --- a/anubis_dev/library/test/Anubis UnitTest.ide +++ b/anubis_dev/library/test/Anubis UnitTest.ide @@ -4,6 +4,50 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # SharpDevelop 1.0.9.98 Project("{B6712916-30DE-4a3e-A54C-2A79AC984AEE}") = "Anubis UnitTest", "Anubis UnitTest.aproj", "{B3F890FB-FBDA-46B4-92E8-9AF1EC349AD2}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{1F556345-E955-43F3-9BAC-EA0091627D9C}" + ProjectSection(SolutionItems) = postProject + ..\predefined.anubis = ..\predefined.anubis + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "system", "system", "{6ABBDA0C-2966-4A88-98DF-DE408905E8F6}" + ProjectSection(SolutionItems) = postProject + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{5D486852-5060-4CB1-821A-CC1304B9DDED}" + ProjectSection(SolutionItems) = postProject + ..\tools\basis.anubis = ..\tools\basis.anubis + ..\tools\utf-8.anubis = ..\tools\utf-8.anubis + ..\tools\basis.anubis = ..\tools\basis.anubis + ..\tools\btree1.anubis = ..\tools\btree1.anubis + ..\tools\cmd_line.anubis = ..\tools\cmd_line.anubis + ..\tools\connections.anubis = ..\tools\connections.anubis + ..\tools\dump_file.anubis = ..\tools\dump_file.anubis + ..\tools\explore_disk.anubis = ..\tools\explore_disk.anubis + ..\tools\findstring.anubis = ..\tools\findstring.anubis + ..\tools\hashtable.anubis = ..\tools\hashtable.anubis + ..\tools\latex.anubis = ..\tools\latex.anubis + ..\tools\maml.anubis = ..\tools\maml.anubis + ..\tools\maml.anubis.1 = ..\tools\maml.anubis.1 + ..\tools\maybefloat.anubis = ..\tools\maybefloat.anubis + ..\tools\read_table.anubis = ..\tools\read_table.anubis + ..\tools\safe_save_retrieve.anubis = ..\tools\safe_save_retrieve.anubis + ..\tools\saturate.anubis = ..\tools\saturate.anubis + ..\tools\schedul_task.anubis = ..\tools\schedul_task.anubis + ..\tools\sdbms.anubis = ..\tools\sdbms.anubis + ..\tools\sdbms1.anubis = ..\tools\sdbms1.anubis + ..\tools\sdbms2.anubis = ..\tools\sdbms2.anubis + ..\tools\streams.anubis = ..\tools\streams.anubis + ..\tools\tables.anubis = ..\tools\tables.anubis + ..\tools\tools.anubis = ..\tools\tools.anubis + ..\tools\unit_test.anubis = ..\tools\unit_test.anubis + ..\tools\utf-8.anubis = ..\tools\utf-8.anubis + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compiler", "Compiler", "{C97D4BBC-F21F-4BE2-8276-73251E1442BD}" + ProjectSection(SolutionItems) = postProject + ..\..\compiler\src\predef.anubis = ..\..\compiler\src\predef.anubis + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,4 +59,9 @@ Global {B3F890FB-FBDA-46B4-92E8-9AF1EC349AD2}.Release|Any CPU.Build.0 = Release|Any CPU {B3F890FB-FBDA-46B4-92E8-9AF1EC349AD2}.Release|Any CPU.ActiveCfg = Release|Any CPU EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {C97D4BBC-F21F-4BE2-8276-73251E1442BD} = {1F556345-E955-43F3-9BAC-EA0091627D9C} + {5D486852-5060-4CB1-821A-CC1304B9DDED} = {1F556345-E955-43F3-9BAC-EA0091627D9C} + {6ABBDA0C-2966-4A88-98DF-DE408905E8F6} = {1F556345-E955-43F3-9BAC-EA0091627D9C} + EndGlobalSection EndGlobal diff --git a/anubis_dev/library/test/tools/utf-8.unit_test.anubis b/anubis_dev/library/test/tools/utf-8.unit_test.anubis index 46be923..fba9169 100644 --- a/anubis_dev/library/test/tools/utf-8.unit_test.anubis +++ b/anubis_dev/library/test/tools/utf-8.unit_test.anubis @@ -1,34 +1,51 @@ + read tools/basis.anubis read tools/utf-8.anubis read tools/unit_test.anubis -public define One +define String + to_hexa + ( + List(Word8) l + ) = + if l is + { + [] then "", + [h . t] then "[" + to_hexa(h) + "] " + to_hexa(t) + }. + +define One to_utf8_test ( UnitTestContext ut )= - with utf8_test1 = to_utf8(65), - if utf8_test1 = [65] then - with utf8_test2 = to_utf8(233), - if utf8_test2 = [195 . [169]] then - with utf8_test3 = to_utf8(8364), - if utf8_test3 = [226, 130 . [172]] then - with utf8_test4 = to_utf8(119070), - if utf8_test4 = [240, 157, 132 . [158]] then - with utf8_test5 = to_utf8(256), - if utf8_test5 = [200 . [128]] then - unique - else - print("Error UTF-8 encode : result " + to_Int(utf8_test5) + " instead of 51328") - else - print("Error UTF-8 encode : result " + to_Int(utf8_test4) + " instead of 2147483647") - else - print("Error UTF-8 encode : result " + to_Int(utf8_test3) + " instead of 14844932") - else - print("Error UTF-8 encode : result " + to_Int(utf8_test2) + " instead of 50089") - else - print("Error UTF-8 encode : result " + to_Int(utf8_test1) + " instead of 65") - . + assertIsSame(ut, to_utf8(65), [65], to_hexa, "index <= 127"); + assertIsSame(ut, to_utf8(233), [0xc3, 0xa9], to_hexa, "127 < index <= 256 (é)"); + assertIsSame(ut, to_utf8(8364), [0xe2, 0x82, 0xac], to_hexa, "256 < index (euro symbol)"); + assertIsSame(ut, to_utf8(119070), [0xf0, 0x9d, 0x84, 0x9e], to_hexa, "256 < index"); + +// with utf8_test1 = to_utf8(65), +// if utf8_test1 = [65] then +// with utf8_test2 = to_utf8(233), +// if utf8_test2 = [195 . [169]] then +// with utf8_test3 = to_utf8(8364), +// if utf8_test3 = [226, 130 . [172]] then +// with utf8_test4 = to_utf8(119070), +// if utf8_test4 = [240, 157, 132 . [158]] then +// with utf8_test5 = to_utf8(256), +// if utf8_test5 = [200 . [128]] then +// unique +// else +// print("Error UTF-8 encode : result " + to_Int(utf8_test5) + " instead of 51328") +// else +// print("Error UTF-8 encode : result " + to_Int(utf8_test4) + " instead of 2147483647") +// else +// print("Error UTF-8 encode : result " + to_Int(utf8_test3) + " instead of 14844932") +// else +// print("Error UTF-8 encode : result " + to_Int(utf8_test2) + " instead of 50089") +// else +// print("Error UTF-8 encode : result " + to_Int(utf8_test1) + " instead of 65") + unique. public define UnitTestSuite make_UTF8_test_suite diff --git a/anubis_dev/library/tools/unit_test.anubis b/anubis_dev/library/tools/unit_test.anubis index 1e45396..ad06007 100644 --- a/anubis_dev/library/tools/unit_test.anubis +++ b/anubis_dev/library/tools/unit_test.anubis @@ -88,7 +88,7 @@ define (Word32 /*passed*/, Word32 /*failed*/, List(UnitTestResult)) if failed_tests is { [] then all_results, - [h.t] then map_add(t, [ut_result(test.test_name, error(h)) . all_results]), + [h . t] then map_add(t, [ut_result(test.test_name, error(h)) . all_results]), }, run_test_suite(t, filter, -- libgit2 0.21.4