Libadalang 25 Release Notes

We present here a few highlights of the new features in Libadalang 25. You can access the complete list in the Libadalang 25 feature file.

Libadalang API

Documentation for nodes now lists derived nodes

For all supported APIs, the documentation of all node types now includes the list of all directly derived nodes, with hyperlinks to the derived nodes.

A new kind of call supported by CallExpr.P_Kind

CallExpr.P_Kind can now be called on an entry indexing. P_Kind will return the Family_Index kind in that case.

New optional parameter for P_Get_Aspect property

The P_Get_Aspect property now takes a new optional parameter. By default, the P_Get_Aspect property checks for a given aspect (either specified by an aspect specification, a pragma, or a representation clause) on all the parts of a declaration, even the private ones. By setting Previous_Parts_Only to True, only previous parts (i.e. visible parts) are considered in order to comply with visibility rules.

New optional parameter for P_Has_Aspect property

The P_Has_Aspect property now takes an optional boolean parameter: Previous_Parts_Only. By default, the property will check for the given aspect on all parts of the declaration (even private ones). By setting Previous_Parts_Only to True, only previous parts are considered for aspect checking.

Usability

Correctness improvements in name resolution

Name and type resolution has been improved in multiple ways, including better support for corner cases of Ada’s semantics and name resolution inside generic instantiations has been heavily improved.

Emitting diagnostics for semantically invalid code

Libadalang’s name resolution can now emit diagnostics for some instances of semantically invalid Ada code, such as for type errors. This is a first step towards providing real-time diagnostics in our IDEs.

Reduced memory footprint for name resolution intensive applications

Libadalang’s memory footprint has been heavily reduced for applications that make heavy use of name resolution: cache mechanism for scopes is now able to detect entries that are less likely to be useful in order to evict them.

Ada 2022 and beyond

Libadalang fully supports Ada 2022 features supported by the GNAT compiler, and also implements new features part of the set of GNAT’s curated language extensions.

Added support for GNAT’s curated language extensions

Libadalang fully supports Ada sources containing use of features from the curated subset of GNAT’s language extensions, both for syntactic and semantic analysis:

  • Local declarations without blocks

  • Deep delta aggregates

  • Fixed lower bound for array types and subtypes

  • Prefixed-view notation for primitive calls on regular types

  • Expression defaults for generic formal functions

  • String interpolation

  • First_Controlling_Parameter aspect

You can see the full list of supported extensions in the GNAT reference manual here.