Commit 1c2829fd90e503a1448463c5fe34f1769cd57875

Authored by Cédric RICARD
1 parent 46a4686a

Fix compile problems due to lexical change for list ( [h . t] -> '.' have to be followed by a space)

anubis_dev/library/graphism/charts.anubis
... ... @@ -830,7 +830,7 @@ define (List(Y_ScaleValue),Int) //Int->lg de l'étiquette la plus grande
830 830 if values is
831 831 {
832 832 [] then (lysv,max_ypx+8), // 8 = 5+3 = marge + longueur du tiret
833   - [y.t] then
  833 + [y . t] then
834 834 with ypx = text_length(scale_font,y),
835 835 make_ysvalue(scale_font,t,
836 836 [y_svalue(ypx,y) . lysv],
... ...
anubis_dev/library/locale/L3.anubis
... ... @@ -822,7 +822,7 @@ define Int
822 822 if lang_list is
823 823 {
824 824 [] then current,
825   - [h.t] then
  825 + [h . t] then
826 826 if l3_load_base(collection_name, h) is
827 827 {
828 828 failure then get_max_of(collection_name, t, symbolic_name, current)
... ...
anubis_dev/library/locale/L3LanguageInfo.anubis
... ... @@ -163,7 +163,7 @@ define String
163 163 if lang_code_list is
164 164 {
165 165 [] then "",
166   - [h.t] then
  166 + [h . t] then
167 167 if h is
168 168 {
169 169 symbolic then "symb",
... ...
anubis_dev/library/network/dns.anubis
... ... @@ -2007,7 +2007,7 @@ define Maybe(String)
2007 2007 failure then if so_far is
2008 2008 {
2009 2009 [ ] then failure,
2010   - [_._] then success(implode(reverse(so_far)))
  2010 + [_ . _] then success(implode(reverse(so_far)))
2011 2011 },
2012 2012 success(c) then
2013 2013 if is_blank(c)
... ...
anubis_dev/library/system/files.anubis
... ... @@ -299,7 +299,7 @@ define ResultCopy
299 299 if io_list is
300 300 {
301 301 [] then copy_ok(so_far),
302   - [ h .t ] then
  302 + [ h . t ] then
303 303 if rewind(h)(unique) then
304 304 with result = copy_Data_IO_to_Stream(h, target, 0),
305 305 if result is copy_ok(written) then
... ... @@ -319,7 +319,7 @@ public define ResultCopy
319 319 if io_list is
320 320 {
321 321 [] then copy_ok(0),
322   - [ h .t ] then copy_Data_IO_List_to_Stream(io_list, target, 0)
  322 + [ h . t ] then copy_Data_IO_List_to_Stream(io_list, target, 0)
323 323 }.
324 324  
325 325 public define ResultCopy
... ... @@ -396,24 +396,24 @@ define Maybe(String)
396 396 if folders is
397 397 {
398 398 [] then success(join("/", reverse(so_far))),
399   - [h.t] then
  399 + [h . t] then
400 400 if h = "" | h = "." then
401 401 if so_far is
402 402 {
403 403 [] then normalize_path(t, [h . so_far]), // the first '/'or '.' have to be added to keep absolute or relative path
404   - [_._] then
  404 + [_ . _] then
405 405 if t is
406 406 {
407 407 [] then if h = "" then normalize_path(t, [h . so_far]) // the last '/' should be keeped too
408 408 else normalize_path(t, so_far), // but not the '.'
409   - [_._] then normalize_path(t, so_far)
  409 + [_ . _] then normalize_path(t, so_far)
410 410 }
411 411 }
412 412 else if h = ".." then
413 413 if so_far is
414 414 {
415 415 [] then failure,
416   - [_.h2] then normalize_path(t, h2)
  416 + [_ . h2] then normalize_path(t, h2)
417 417 }
418 418 else
419 419 normalize_path(t, [h . so_far])
... ...
anubis_dev/library/system/logger.anubis
... ... @@ -333,7 +333,7 @@ public define Maybe(Logger)
333 333 if loggers is
334 334 {
335 335 [] then failure,
336   - [h .t] then
  336 + [h . t] then
337 337 if h.pl.loggerName = name then
338 338 success(h)
339 339 else
... ...
anubis_dev/library/system/muscle.anubis
... ... @@ -852,7 +852,7 @@ define Maybe(ByteArray)
852 852 if t is
853 853 {
854 854 [] then success(so_far + flatten_header + flatten_body),
855   - [_ ._] then flatten_fields(t, so_far + flatten_header + flatten_body )
  855 + [_ . _] then flatten_fields(t, so_far + flatten_header + flatten_body )
856 856 }
857 857 }
858 858 }.
... ...
anubis_dev/library/system/parameter/inifile.anubis
... ... @@ -93,7 +93,7 @@ define Bool isSection( List(IniSection) sectionList, String sectionName) =
93 93 if sectionList is
94 94 {
95 95 [] then false, //the list is empty, the section doesn't exist
96   - [h .t] then if h is iniSection(name, _) then print("inspecting " +name +" \n");
  96 + [h . t] then if h is iniSection(name, _) then print("inspecting " +name +" \n");
97 97 if name = sectionName
98 98 then true
99 99 else isSection(t, sectionName)
... ... @@ -120,7 +120,7 @@ define List(IniSection) deleteSection (IniInfo i, List(IniSection) sectionList,
120 120 if sectionList is
121 121 {
122 122 [] then [],
123   - [h .t ] then
  123 + [h . t ] then
124 124 if h.name = sectionName then
125 125 t
126 126 else
... ...
anubis_dev/library/system/string.anubis
... ... @@ -453,7 +453,7 @@ define Maybe(List(String))
453 453 if string_so_far is
454 454 {
455 455 [] then failure, //if the list of string is empty we have failed to find out words
456   - [_._] then success(reverse(string_so_far))
  456 + [_ . _] then success(reverse(string_so_far))
457 457 },
458 458 [ h . t ] then
459 459 if is_white_char(h) then
... ...
anubis_dev/library/test/Anubis UnitTest.aproj
... ... @@ -43,9 +43,11 @@
43 43 <Compile Include="system\message_transceiver.unit_test.anubis" />
44 44 <Compile Include="system\string.unit_test.anubis" />
45 45 <Compile Include="system\wordXX.unit_test.anubis" />
  46 + <Compile Include="tools\utf-8.unit_test.anubis" />
46 47 </ItemGroup>
47 48 <ItemGroup>
48 49 <Folder Include="predefined" />
49 50 <Folder Include="system" />
  51 + <Folder Include="tools" />
50 52 </ItemGroup>
51 53 </Project>
52 54 \ No newline at end of file
... ...
anubis_dev/library/test/Anubis UnitTest.ide
... ... @@ -4,6 +4,50 @@ Microsoft Visual Studio Solution File, Format Version 9.00
4 4 # SharpDevelop 1.0.9.98
5 5 Project("{B6712916-30DE-4a3e-A54C-2A79AC984AEE}") = "Anubis UnitTest", "Anubis UnitTest.aproj", "{B3F890FB-FBDA-46B4-92E8-9AF1EC349AD2}"
6 6 EndProject
  7 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{1F556345-E955-43F3-9BAC-EA0091627D9C}"
  8 + ProjectSection(SolutionItems) = postProject
  9 + ..\predefined.anubis = ..\predefined.anubis
  10 + EndProjectSection
  11 +EndProject
  12 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "system", "system", "{6ABBDA0C-2966-4A88-98DF-DE408905E8F6}"
  13 + ProjectSection(SolutionItems) = postProject
  14 + EndProjectSection
  15 +EndProject
  16 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{5D486852-5060-4CB1-821A-CC1304B9DDED}"
  17 + ProjectSection(SolutionItems) = postProject
  18 + ..\tools\basis.anubis = ..\tools\basis.anubis
  19 + ..\tools\utf-8.anubis = ..\tools\utf-8.anubis
  20 + ..\tools\basis.anubis = ..\tools\basis.anubis
  21 + ..\tools\btree1.anubis = ..\tools\btree1.anubis
  22 + ..\tools\cmd_line.anubis = ..\tools\cmd_line.anubis
  23 + ..\tools\connections.anubis = ..\tools\connections.anubis
  24 + ..\tools\dump_file.anubis = ..\tools\dump_file.anubis
  25 + ..\tools\explore_disk.anubis = ..\tools\explore_disk.anubis
  26 + ..\tools\findstring.anubis = ..\tools\findstring.anubis
  27 + ..\tools\hashtable.anubis = ..\tools\hashtable.anubis
  28 + ..\tools\latex.anubis = ..\tools\latex.anubis
  29 + ..\tools\maml.anubis = ..\tools\maml.anubis
  30 + ..\tools\maml.anubis.1 = ..\tools\maml.anubis.1
  31 + ..\tools\maybefloat.anubis = ..\tools\maybefloat.anubis
  32 + ..\tools\read_table.anubis = ..\tools\read_table.anubis
  33 + ..\tools\safe_save_retrieve.anubis = ..\tools\safe_save_retrieve.anubis
  34 + ..\tools\saturate.anubis = ..\tools\saturate.anubis
  35 + ..\tools\schedul_task.anubis = ..\tools\schedul_task.anubis
  36 + ..\tools\sdbms.anubis = ..\tools\sdbms.anubis
  37 + ..\tools\sdbms1.anubis = ..\tools\sdbms1.anubis
  38 + ..\tools\sdbms2.anubis = ..\tools\sdbms2.anubis
  39 + ..\tools\streams.anubis = ..\tools\streams.anubis
  40 + ..\tools\tables.anubis = ..\tools\tables.anubis
  41 + ..\tools\tools.anubis = ..\tools\tools.anubis
  42 + ..\tools\unit_test.anubis = ..\tools\unit_test.anubis
  43 + ..\tools\utf-8.anubis = ..\tools\utf-8.anubis
  44 + EndProjectSection
  45 +EndProject
  46 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compiler", "Compiler", "{C97D4BBC-F21F-4BE2-8276-73251E1442BD}"
  47 + ProjectSection(SolutionItems) = postProject
  48 + ..\..\compiler\src\predef.anubis = ..\..\compiler\src\predef.anubis
  49 + EndProjectSection
  50 +EndProject
7 51 Global
8 52 GlobalSection(SolutionConfigurationPlatforms) = preSolution
9 53 Debug|Any CPU = Debug|Any CPU
... ... @@ -15,4 +59,9 @@ Global
15 59 {B3F890FB-FBDA-46B4-92E8-9AF1EC349AD2}.Release|Any CPU.Build.0 = Release|Any CPU
16 60 {B3F890FB-FBDA-46B4-92E8-9AF1EC349AD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 61 EndGlobalSection
  62 + GlobalSection(NestedProjects) = preSolution
  63 + {C97D4BBC-F21F-4BE2-8276-73251E1442BD} = {1F556345-E955-43F3-9BAC-EA0091627D9C}
  64 + {5D486852-5060-4CB1-821A-CC1304B9DDED} = {1F556345-E955-43F3-9BAC-EA0091627D9C}
  65 + {6ABBDA0C-2966-4A88-98DF-DE408905E8F6} = {1F556345-E955-43F3-9BAC-EA0091627D9C}
  66 + EndGlobalSection
18 67 EndGlobal
... ...
anubis_dev/library/test/tools/utf-8.unit_test.anubis
  1 +
1 2 read tools/basis.anubis
2 3 read tools/utf-8.anubis
3 4 read tools/unit_test.anubis
4 5  
5   -public define One
  6 +define String
  7 + to_hexa
  8 + (
  9 + List(Word8) l
  10 + ) =
  11 + if l is
  12 + {
  13 + [] then "",
  14 + [h . t] then "[" + to_hexa(h) + "] " + to_hexa(t)
  15 + }.
  16 +
  17 +define One
6 18 to_utf8_test
7 19 (
8 20 UnitTestContext ut
9 21 )=
10   - with utf8_test1 = to_utf8(65),
11   - if utf8_test1 = [65] then
12   - with utf8_test2 = to_utf8(233),
13   - if utf8_test2 = [195 . [169]] then
14   - with utf8_test3 = to_utf8(8364),
15   - if utf8_test3 = [226, 130 . [172]] then
16   - with utf8_test4 = to_utf8(119070),
17   - if utf8_test4 = [240, 157, 132 . [158]] then
18   - with utf8_test5 = to_utf8(256),
19   - if utf8_test5 = [200 . [128]] then
20   - unique
21   - else
22   - print("Error UTF-8 encode : result " + to_Int(utf8_test5) + " instead of 51328")
23   - else
24   - print("Error UTF-8 encode : result " + to_Int(utf8_test4) + " instead of 2147483647")
25   - else
26   - print("Error UTF-8 encode : result " + to_Int(utf8_test3) + " instead of 14844932")
27   - else
28   - print("Error UTF-8 encode : result " + to_Int(utf8_test2) + " instead of 50089")
29   - else
30   - print("Error UTF-8 encode : result " + to_Int(utf8_test1) + " instead of 65")
31   - .
  22 + assertIsSame(ut, to_utf8(65), [65], to_hexa, "index <= 127");
  23 + assertIsSame(ut, to_utf8(233), [0xc3, 0xa9], to_hexa, "127 < index <= 256 (é)");
  24 + assertIsSame(ut, to_utf8(8364), [0xe2, 0x82, 0xac], to_hexa, "256 < index (euro symbol)");
  25 + assertIsSame(ut, to_utf8(119070), [0xf0, 0x9d, 0x84, 0x9e], to_hexa, "256 < index");
  26 +
  27 +// with utf8_test1 = to_utf8(65),
  28 +// if utf8_test1 = [65] then
  29 +// with utf8_test2 = to_utf8(233),
  30 +// if utf8_test2 = [195 . [169]] then
  31 +// with utf8_test3 = to_utf8(8364),
  32 +// if utf8_test3 = [226, 130 . [172]] then
  33 +// with utf8_test4 = to_utf8(119070),
  34 +// if utf8_test4 = [240, 157, 132 . [158]] then
  35 +// with utf8_test5 = to_utf8(256),
  36 +// if utf8_test5 = [200 . [128]] then
  37 +// unique
  38 +// else
  39 +// print("Error UTF-8 encode : result " + to_Int(utf8_test5) + " instead of 51328")
  40 +// else
  41 +// print("Error UTF-8 encode : result " + to_Int(utf8_test4) + " instead of 2147483647")
  42 +// else
  43 +// print("Error UTF-8 encode : result " + to_Int(utf8_test3) + " instead of 14844932")
  44 +// else
  45 +// print("Error UTF-8 encode : result " + to_Int(utf8_test2) + " instead of 50089")
  46 +// else
  47 +// print("Error UTF-8 encode : result " + to_Int(utf8_test1) + " instead of 65")
  48 + unique.
32 49  
33 50 public define UnitTestSuite
34 51 make_UTF8_test_suite
... ...
anubis_dev/library/tools/unit_test.anubis
... ... @@ -88,7 +88,7 @@ define (Word32 /*passed*/, Word32 /*failed*/, List(UnitTestResult))
88 88 if failed_tests is
89 89 {
90 90 [] then all_results,
91   - [h.t] then map_add(t, [ut_result(test.test_name, error(h)) . all_results]),
  91 + [h . t] then map_add(t, [ut_result(test.test_name, error(h)) . all_results]),
92 92 },
93 93 run_test_suite(t,
94 94 filter,
... ...