Skip to content

Commit

Permalink
Functional Union for sets
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Jul 3, 2024
1 parent dff61d2 commit 52953d8
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
4 changes: 2 additions & 2 deletions config/aaa_config.ads
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma Style_Checks (Off);
package Aaa_Config is
pragma Pure;

Crate_Version : constant String := "0.2.6-dev";
Crate_Version : constant String := "0.3.0-dev";
Crate_Name : constant String := "aaa";

Alire_Host_OS : constant String := "linux";
Expand All @@ -15,6 +15,6 @@ package Aaa_Config is
Alire_Host_Distro : constant String := "ubuntu";

type Build_Profile_Kind is (release, validation, development);
Build_Profile : constant Build_Profile_Kind := release;
Build_Profile : constant Build_Profile_Kind := validation;

end Aaa_Config;
38 changes: 35 additions & 3 deletions config/aaa_config.gpr
Original file line number Diff line number Diff line change
@@ -1,23 +1,55 @@
-- Configuration for aaa generated by Alire
with "umwi.gpr";
abstract project Aaa_Config is
Crate_Version := "0.2.6-dev";
Crate_Version := "0.3.0-dev";
Crate_Name := "aaa";

Alire_Host_OS := "linux";

Alire_Host_Arch := "x86_64";

Alire_Host_Distro := "ubuntu";
Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " ") &
Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " ");
Ada_Compiler_Switches := Ada_Compiler_Switches &
(
"-O3" -- Optimize for performance
,"-gnatn" -- Enable inlining
,"-ffunction-sections" -- Separate ELF section for each function
,"-fdata-sections" -- Separate ELF section for each variable
,"-g" -- Generate debug info
,"-gnato" -- Enable numeric overflow checking
,"-gnatwa" -- Enable all warnings
,"-gnatw.X" -- Disable warnings for No_Exception_Propagation
,"-gnatVa" -- All validity checks
,"-gnatwe" -- Warnings as errors
,"-gnata" -- Enable assertions and contracts
,"-gnaty3" -- Specify indentation level of 3
,"-gnatya" -- Check attribute casing
,"-gnatyA" -- Use of array index numbers in array attributes
,"-gnatyB" -- Check Boolean operators
,"-gnatyb" -- Blanks not allowed at statement end
,"-gnatyc" -- Check comments
,"-gnaty-d" -- Disable check no DOS line terminators present
,"-gnatye" -- Check end/exit labels
,"-gnatyf" -- No form feeds or vertical tabs
,"-gnatyh" -- No horizontal tabs
,"-gnatyi" -- Check if-then layout
,"-gnatyI" -- check mode IN keywords
,"-gnatyk" -- Check keyword casing
,"-gnatyl" -- Check layout
,"-gnatym" -- Check maximum line length
,"-gnatyn" -- Check casing of entities in Standard
,"-gnatyO" -- Check that overriding subprograms are explicitly marked as such
,"-gnatyp" -- Check pragma casing
,"-gnatyr" -- Check identifier references casing
,"-gnatyS" -- Check no statements after THEN/ELSE
,"-gnatyt" -- Check token spacing
,"-gnatyu" -- Check unnecessary blank lines
,"-gnatyx" -- Check extra parentheses
,"-gnatW8" -- UTF-8 encoding for wide characters
);

type Build_Profile_Kind is ("release", "validation", "development");
Build_Profile : Build_Profile_Kind := "release";
Build_Profile : Build_Profile_Kind := "validation";

end Aaa_Config;
4 changes: 2 additions & 2 deletions config/aaa_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef AAA_CONFIG_H
#define AAA_CONFIG_H

#define CRATE_VERSION "0.2.6-dev"
#define CRATE_VERSION "0.3.0-dev"
#define CRATE_NAME "aaa"

#define ALIRE_HOST_OS "linux"
Expand All @@ -15,6 +15,6 @@
#define BUILD_PROFILE_VALIDATION 2
#define BUILD_PROFILE_DEVELOPMENT 3

#define BUILD_PROFILE 1
#define BUILD_PROFILE 2

#endif
3 changes: 3 additions & 0 deletions src/aaa-strings.ads
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ package AAA.Strings with Preelaborate is

function To_Vector (This : Set) return Vector;

function Union (L : Set; R : String) return Set
is (L.Union (To_Set (R)));

-------------
-- Vectors --
-------------
Expand Down

0 comments on commit 52953d8

Please sign in to comment.