Index: generated/natools-static_hash_maps-s_expressions-command_map.adb ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_map.adb +++ generated/natools-static_hash_maps-s_expressions-command_map.adb @@ -1,20 +1,20 @@ with Interfaces; use Interfaces; package body Natools.Static_Hash_Maps.S_Expressions.Command_Map is - P : constant array (0 .. 0) of Natural := - (0 .. 0 => 3); - - T1 : constant array (0 .. 0) of Unsigned_8 := - (0 .. 0 => 8); - - T2 : constant array (0 .. 0) of Unsigned_8 := - (0 .. 0 => 5); - - G : constant array (0 .. 8) of Unsigned_8 := - (0, 0, 0, 0, 3, 1, 0, 2, 0); + P : constant array (0 .. 2) of Natural := + (1, 9, 11); + + T1 : constant array (0 .. 2) of Unsigned_8 := + (0, 16, 5); + + T2 : constant array (0 .. 2) of Unsigned_8 := + (10, 9, 15); + + G : constant array (0 .. 17) of Unsigned_8 := + (0, 1, 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 6, 7, 0, 3, 2, 0); function Hash (S : String) return Natural is F : constant Natural := S'First - 1; L : constant Natural := S'Length; F1, F2 : Natural := 0; @@ -21,12 +21,12 @@ J : Natural; begin for K in P'Range loop exit when L < P (K); J := Character'Pos (S (P (K) + F)); - F1 := (F1 + Natural (T1 (K)) * J) mod 9; - F2 := (F2 + Natural (T2 (K)) * J) mod 9; + F1 := (F1 + Natural (T1 (K)) * J) mod 18; + F2 := (F2 + Natural (T2 (K)) * J) mod 18; end loop; - return (Natural (G (F1)) + Natural (G (F2))) mod 4; + return (Natural (G (F1)) + Natural (G (F2))) mod 8; end Hash; end Natools.Static_Hash_Maps.S_Expressions.Command_Map; Index: generated/natools-static_hash_maps-s_expressions-command_maps-test.adb ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_maps-test.adb +++ generated/natools-static_hash_maps-s_expressions-command_maps-test.adb @@ -1,7 +1,7 @@ --- Generated at 2014-05-31 15:03:28 +0000 by Natools.Static_Hash_Maps --- from natools-static_hash_maps-s_expressions-hash_maps.sx +-- Generated at 2014-11-09 20:46:38 +0000 by Natools.Static_Hash_Maps +-- from src/natools-static_hash_maps-s_expressions-hash_maps.sx with Natools.Static_Hash_Maps.S_Expressions.Command_Pkg; with Natools.Static_Hash_Maps.S_Expressions.Command_Map; function Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test return Boolean is Index: generated/natools-static_hash_maps-s_expressions-command_maps-test.ads ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_maps-test.ads +++ generated/natools-static_hash_maps-s_expressions-command_maps-test.ads @@ -1,5 +1,5 @@ --- Generated at 2014-05-31 15:03:28 +0000 by Natools.Static_Hash_Maps --- from natools-static_hash_maps-s_expressions-hash_maps.sx +-- Generated at 2014-11-09 20:46:38 +0000 by Natools.Static_Hash_Maps +-- from src/natools-static_hash_maps-s_expressions-hash_maps.sx function Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test return Boolean; Index: generated/natools-static_hash_maps-s_expressions-command_maps.adb ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_maps.adb +++ generated/natools-static_hash_maps-s_expressions-command_maps.adb @@ -1,7 +1,7 @@ --- Generated at 2014-05-31 15:03:28 +0000 by Natools.Static_Hash_Maps --- from natools-static_hash_maps-s_expressions-hash_maps.sx +-- Generated at 2014-11-09 20:46:38 +0000 by Natools.Static_Hash_Maps +-- from src/natools-static_hash_maps-s_expressions-hash_maps.sx with Natools.Static_Hash_Maps.S_Expressions.Command_Pkg; with Natools.Static_Hash_Maps.S_Expressions.Command_Map; package body Natools.Static_Hash_Maps.S_Expressions.Command_Maps is Index: generated/natools-static_hash_maps-s_expressions-command_maps.ads ================================================================== --- generated/natools-static_hash_maps-s_expressions-command_maps.ads +++ generated/natools-static_hash_maps-s_expressions-command_maps.ads @@ -1,7 +1,7 @@ --- Generated at 2014-05-31 15:03:28 +0000 by Natools.Static_Hash_Maps --- from natools-static_hash_maps-s_expressions-hash_maps.sx +-- Generated at 2014-11-09 20:46:38 +0000 by Natools.Static_Hash_Maps +-- from src/natools-static_hash_maps-s_expressions-hash_maps.sx private package Natools.Static_Hash_Maps.S_Expressions.Command_Maps is function To_Package_Command (Key : String) return Package_Command; function To_Map_Command (Key : String) return Map_Command; @@ -30,21 +30,33 @@ Public_Child, Pure_Package, Preelaborate_Package, Test_Function); - Map_2_Key_0 : aliased constant String := "hash-package"; - Map_2_Key_1 : aliased constant String := "nodes"; - Map_2_Key_2 : aliased constant String := "function"; - Map_2_Key_3 : aliased constant String := "not-found"; - Map_2_Keys : constant array (0 .. 3) of access constant String + Map_2_Key_0 : aliased constant String := "definite"; + Map_2_Key_1 : aliased constant String := "definite-elements"; + Map_2_Key_2 : aliased constant String := "indefinite"; + Map_2_Key_3 : aliased constant String := "indefinite-elements"; + Map_2_Key_4 : aliased constant String := "hash-package"; + Map_2_Key_5 : aliased constant String := "nodes"; + Map_2_Key_6 : aliased constant String := "function"; + Map_2_Key_7 : aliased constant String := "not-found"; + Map_2_Keys : constant array (0 .. 7) of access constant String := (Map_2_Key_0'Access, Map_2_Key_1'Access, Map_2_Key_2'Access, - Map_2_Key_3'Access); - Map_2_Elements : constant array (0 .. 3) of Map_Command - := (Hash_Package, + Map_2_Key_3'Access, + Map_2_Key_4'Access, + Map_2_Key_5'Access, + Map_2_Key_6'Access, + Map_2_Key_7'Access); + Map_2_Elements : constant array (0 .. 7) of Map_Command + := (Definite_Elements, + Definite_Elements, + Indefinite_Elements, + Indefinite_Elements, + Hash_Package, Nodes, Function_Name, Not_Found); end Natools.Static_Hash_Maps.S_Expressions.Command_Maps; Index: src/natools-static_hash_maps-s_expressions-hash_maps.sx ================================================================== --- src/natools-static_hash_maps-s_expressions-hash_maps.sx +++ src/natools-static_hash_maps-s_expressions-hash_maps.sx @@ -14,10 +14,12 @@ (Test_Function test-function))) (Map_Command (hash-package Natools.Static_Hash_Maps.S_Expressions.Command_Map) (function To_Map_Command) (nodes + (Definite_Elements definite definite-elements) + (Indefinite_Elements indefinite indefinite-elements) (Hash_Package hash-package) (Nodes nodes) (Function_Name function) (Not_Found not-found)))) Index: src/natools-static_hash_maps-s_expressions.adb ================================================================== --- src/natools-static_hash_maps-s_expressions.adb +++ src/natools-static_hash_maps-s_expressions.adb @@ -136,10 +136,16 @@ Set_Hash_Package_Name (Map, Sx.To_String (Arguments.Current_Atom)); else Set_Hash_Package_Name (Map, ""); end if; + + when Definite_Elements => + Set_Definite (Map); + + when Indefinite_Elements => + Set_Indefinite (Map); when Function_Name => if Event = Sx.Events.Add_Atom then Set_Function_Name (Map, Sx.To_String (Arguments.Current_Atom)); else Index: src/natools-static_hash_maps-s_expressions.ads ================================================================== --- src/natools-static_hash_maps-s_expressions.ads +++ src/natools-static_hash_maps-s_expressions.ads @@ -46,10 +46,12 @@ Test_Function, Extra_Declarations); type Map_Command is (Hash_Package, + Definite_Elements, + Indefinite_Elements, Nodes, Function_Name, Not_Found); end Natools.Static_Hash_Maps.S_Expressions;