Skip to content

Commit

Permalink
move to libadalang 23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pjljvandelaar committed Nov 10, 2022
1 parent b4bd6b6 commit c74bb25
Show file tree
Hide file tree
Showing 16 changed files with 279 additions and 86 deletions.
2 changes: 1 addition & 1 deletion alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ maintainers = ["Pierre van de Laar <[email protected]>"]
maintainers-logins = ["pjljvandelaar"]

[[depends-on]]
libadalang = "^22.0.0" # remove this dependency when libadalang is
libadalang = "^23.0.0" # remove this dependency when libadalang is
# already installed on your system
# and accessible via your GPR_PROJECT_PATH

Expand Down
2 changes: 1 addition & 1 deletion examples/alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainers-logins = ["pjljvandelaar"]
executables = ["examples_main"]

[[depends-on]]
libadalang = "^22.0.0"
libadalang = "^23.0.0"
rejuvenation = "^22.0.0"

[[pins]]
Expand Down
2 changes: 1 addition & 1 deletion find_and_replace_tool/alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainers-logins = ["pjljvandelaar"]
executables = ["find_and_replace_tool"]

[[depends-on]]
libadalang = "^22.0.0"
libadalang = "^23.0.0"
rejuvenation = "^22.0.0"

[[pins]]
Expand Down
2 changes: 1 addition & 1 deletion find_tool/alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainers-logins = ["pjljvandelaar"]
executables = ["find_tool"]

[[depends-on]]
libadalang = "^22.0.0"
libadalang = "^23.0.0"
rejuvenation = "^22.0.0"

[[pins]]
Expand Down
4 changes: 2 additions & 2 deletions generator-developers_only/WhenUpdatingLibAdaLang.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
When upgrading LibAdaLang a new version for Match Pattern has to be made.

1. Remove in Match Patterns (in rejuvenation library)
1. Remove in rejuvenation-match_patterns.adb (in rejuvenation library)
all code between
-- Begin of generated fragment using Rejuvenation_Lib_Generator --------
and
Expand All @@ -12,7 +12,7 @@ to point to correct / new LibAdaLang version

3. Run program

4. copy output in Match Pattern (in rejuvenation library)
4. copy output in rejuvenation-match_patterns.adb (in rejuvenation library)
between
-- Begin of generated fragment using Rejuvenation_Lib_Generator --------
and
Expand Down
2 changes: 1 addition & 1 deletion generator-developers_only/alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainers-logins = ["pjljvandelaar"]
executables = ["main_generator"]

[[depends-on]]
libadalang = "^22.0.0"
libadalang = "^23.0.0"
rejuvenation = "^22.0.0"

[[pins]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ package body Generator.Match_Pattern_Specific is
end Equivalent_Value;

Type_Decls : constant Rejuvenation.Node_List.Vector :=
Rejuvenation.Finder.Find (Unit_LAL_Ads.Root, Ada_Type_Decl);
Rejuvenation.Finder.Find (Unit_LAL_Ads.Root, Ada_Concrete_Type_Decl);
Subp_Decls : constant Rejuvenation.Node_List.Vector :=
Rejuvenation.Finder.Find (Unit_LAL_Ads.Root, Ada_Subp_Spec);

Type_Decls2 : constant Rejuvenation.Node_List.Vector :=
Rejuvenation.Finder.Find (Unit_LALCO_Ads.Root, Ada_Type_Decl);
Rejuvenation.Finder.Find (Unit_LALCO_Ads.Root, Ada_Concrete_Type_Decl);

Kinds : List_String.Vector;
Type_To_Direct_Children, Type_To_All_Fields : Mapping_Single_Map.Map;
Expand Down
4 changes: 2 additions & 2 deletions generator-developers_only/src/generator.ads
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package Generator is
package LALCO renames Libadalang.Common;

Filename_LAL_Ads : constant String :=
"C:\GNATPRO\22.1\include\libadalang\libadalang-analysis.ads";
"C:\GNATPRO\23.0\include\libadalang\libadalang-analysis.ads";
Filename_LALCO_Ads : constant String :=
"C:\GNATPRO\22.1\include\libadalang\libadalang-common.ads";
"C:\GNATPRO\23.0\include\libadalang\libadalang-common.ads";

Unit_LAL_Ads : constant LAL.Analysis_Unit :=
Open_File (Filename_LAL_Ads);
Expand Down
7 changes: 4 additions & 3 deletions src/rejuvenation-finder.adb
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,17 @@ package body Rejuvenation.Finder is
function Visit (Node : Ada_Node'Class) return Visit_Status is
begin
if Predicate (Node) then
Result.Append (Ada_Node (Node));
-- TODO: look up which was prefer Node.As_Ada_Node or this
Result.Append (Node.As_Ada_Node);
return Next;
else
return Into;
end if;
end Visit;

begin
Node.Traverse (Visit'Access);
if not Node.Is_Null then
Node.Traverse (Visit'Access);
end if;
return Result;
end Find_Predicate;

Expand Down
Loading

0 comments on commit c74bb25

Please sign in to comment.