24 Commits

Author SHA1 Message Date
Jerome Lambourg
4ef839c85c Adjust tests after change of API for project loading. 2024-06-01 19:43:04 +02:00
Jerome Lambourg
ba54406d43 Bump copyright notice to 2024
Also remove copyright from tests

no-issue-check
2024-01-10 11:11:21 +01:00
Jerome Lambourg
399f0071bc Adjust tests for eng/gpr/gpr-issues#145 2023-09-20 08:27:25 +00:00
Jerome Lambourg
b7a1d9ad4b Bump copyright year.
Fix eng/gpr/gpr#14
2023-01-02 11:51:43 +01:00
Pierre Béguet
52566ad278 Pack and attribute identifier refactoring in libGPR2
Major change into libGPR2 and GPRTools, all APIs previously
using Attribute_Id and/or Package_Id/Attribute_Id are now
using the combined qualified name Q_Attribute_Id in order
to unify APIs usage.
Few exceptions exist when retriving Attributes from a named
Package.
As Q_Attribute_Id is now used all over libGPR2, the list of
Attribute_Id constants was removed and a list of Q_Attribute_Id
constants can now be found at the same place. This was done
to simplify APIs call by providing defined and registered
attributes qualified name.

V720-027 :
When users are adding attributes without adding a package first
this package is not taken into account when launching Validity_Check.
We cannot make the assumption on which kind of project this package
is authorized to be in, so we are adding a precondition.
We now raise an ASSERTION_ERROR when trying to add an attribute
in a unknown package.

TN: V725-008
TN: V720-027
Change-Id: I3807ac993002c308021f082c7ba034cc371563cc
2022-08-29 07:35:59 +00:00
Fabien Chouteau
bb9b6a7bb3 Change license header of GPR2 library to Apache 2.0
no-precommit-check
This patch is rejected by the "Copyright notice must include current
year" check, we actually want to preserve the copyright years here.

TN: V822-021
Change-Id: Iad42ad0863f12d7a3c714855287c5996581910b6
2022-08-24 15:07:24 +00:00
Jérôme Lambourg
3ddedc127b Update year in copyright notice
no-tn-check

Change-Id: I6c02538c84e05dd1668a27f673146cc5793a81c5
2022-01-04 09:26:28 +00:00
Nicolas Roche
2a8a657854 Refactor the way view attributes are computed.
The view's "Attribute" function now fully computes the attributes values
based on the attributes definitions in Project.Registry.Attribute.

The various subprograms that were used to retrieve individually those
values are now simplified and call Attribute.

As a result, retrieval of Package Values and Attributes need to be
performed via the View, so as a result GPR2.Project.Pack is now a private
package, and only contains the raw object definition of a Package.

The parser is also reworked to benefit from the attribute computation when
referencing attributes. As a result it now need to work on the view object
rather than trying to build first the lists of variables and attributes
before building the object.

In order for the parser to see the package definition, it has been also
renamed to GPR2.Project.Parser, and GPR2.Parser hierarchy is now removed.

Finally, the GPR2.Project.Attribute object has been improved to include
missing information to fully handle all situations. In particular the
notion of Aliased attributes is now added to it (attributes that have
different names, such as Spec and Specification).

Part of U813-023

Change-Id: Ife12e67035c45f2915050e6550eb7d83d98fede2
Depends-On: Ie49c13da3ef7dbfc5f9b51f863e46b9f0ff9c4d1
2021-11-25 16:38:32 +01:00
Jerome Lambourg
20071b09cd Add an attribute id and package id
This allows for faster retrieval of attributes with the use of containers
manipulating bounded values, as well as simple integer comparisons.

Depends-On: I325abb397527ac72abff4f3bfe315a3a42aad25b
TN: U722-008

Change-Id: Ic56ecb845fb6768d62b5b6c533850c2f58550469
2021-08-15 21:36:12 +02:00
Dmitriy Anisimkov
5c3c1da456 Add leading zero to one digit column numbers in messages
S417-040

Change-Id: I1998a6001ba46ac845173cbc57b05fe82fe1b207
2020-01-18 10:10:58 +01:00
Pascal Obry
85ef01b803 Add message level in from of the message.
The message level format can be controled for each level (information,
warning, error). It can be either not displayed or with a short or
long version.

Update expected outputs.

For S914-004.

Change-Id: I126463466fd109b5abb9a8354eea55a5099d3cbf
2019-10-08 22:17:17 +02:00
Pascal Obry
787388747f Attribute.Name now returns an Identifier.Object.
We were passing the name as an Identifier.Object but storing only
the name as a string hence losing the sloc. Furthermore now Name
does return an Identifier.Object.

Change-Id: I51f8c1e8ee872360bfa40f564d42ddfc5d856933
2019-05-18 18:01:37 +02:00
Robin Morier
fb4488f3cb Change all headers to Adacore (2019).
Change-Id: I42bb106e26be87e226a3d202b80d9edc1446afe5
2019-02-12 11:59:41 +01:00
Pascal Obry
2ce754cc39 Attribute's Name and Value/Values are now source referenced.
The Name is a Source_Reference.Identifier.Object and the Value
is a Source_Reference.Value.Object. This is needed to be able
to record the source references for values. The API is now also
cleaner, we were passing the Name (as Name_Type) and the corresponding
sloc to each routine. Now the slock for the Name is into the
corresponding object.

This change also support Name and Value for variables and types.

Adapt the code to this new API.

Change-Id: Ica2bd2ab0f4666c58378d7b8b7748b7b58613269
2019-02-12 11:22:36 +01:00
Pascal Obry
54d5f08641 Add all search paths into the tree log message as information.
Fix all tests to skip information messages now.

Change-Id: I6ea6657b4a9be3e1272717d48803bd6a1c4b6a70
2018-10-01 17:38:52 +02:00
Pascal Obry
762cd36bce Add proper API to deal with Path_Name.
Upadte code and tests accordingly.

No new feature just a code clean-up.

Change-Id: I84e7fecff425d23b246840e90cb5df00854a192a
2018-04-28 19:56:31 +02:00
Pascal Obry
74d0f4f066 Update some tests for them to pass on Windows.
Continued work for OB10-014.

Change-Id: Iea890855fafe3ef21c61f6b46f80086e9ecb30cb
2017-07-31 11:34:13 +02:00
Pascal Obry
c549628acc Final touch to build LibGPR2 with latest langkit version.
This version passes all the tests.

Change-Id: I950434645f2c22c73972e0b03b31fcbda554c4dd
2017-06-21 11:37:23 +02:00
Pascal Obry
e3e00bb649 Ensure that a context is passed to Load.
This is needed to pass all arguments coming from a tools (-XVAR=VALUE
for GPRbuild for example) while loading a project. It is needed for
proper semantics of External built-in.

Update regression tests.

Continued work for P113-046.

Change-Id: Iefa2ab2716ff05680a12ac42a6e9a124722bd3b2
2016-10-01 16:39:38 +02:00
Pascal Obry
3ad0421e00 Check for some sources' naming errors.
We now detect some errors when dealing with sources.

When an error occurs we raise an exception as we do not want errors to
get unnoticed.

Add corresponding regression test.

Part of P113-046.

Change-Id: I3d75d459230867d852a5c720c68be5a470c5782c
2016-08-29 21:49:22 +02:00
Pascal Obry
4a6c447662 Store the project tree in Views.
Instead of storing the configuration view we directly store the
tree (actually an access to the tree). For this a project tree
object is now limited and is self referenced (Rosen's trick).

The Load routine is now a procedure to comply with the limited
tree object. This permits some clean-up as some routines are not
needed anymore.

Note that the tree will be needed to be able to record error messages
(in the tree's log object) while parsing sources. So this is globally
a clean-up to prepare future work.

The regression tests are adjusted accordingly.

Part of P113-046.

Change-Id: I6f5068a11c2f346d8df8c37b35c6d6b8898e9745
2016-08-05 00:01:57 +02:00
Pascal Obry
63fa5a1a92 Introduce No_Case Name/Value types.
Rework Name_Type support.

A Name_Type is now a type and handled without case-sensitivity. An
Optional_Name_Type is introduced which allows empty value.

The code is changed to take this into account. For example there is
no more need to Less_Case_Insensitive or Equal_Case_Insensitive as the
Name_Type's "=" and "<" operator are already case insensitive.

Part of P113-046.

Change-Id: Ie16e5e7add49a16ffffee2610afafdf7474c8c5c
2016-07-18 19:38:46 +02:00
Pascal Obry
cd9952cda6 Rework the attributes representation and iterator.
The new representation allows multiple attribute with the same
name but with different index.

Part of P113-046.

Change-Id: I7566bf69a1b41903b58e63af11c8579a165ea88d
2016-07-18 19:38:04 +02:00
Pascal Obry
293822f15f LangKit parser errors are now part of the project's log facility.
Add corresponding regression test.

Part of P113-046.

Change-Id: Ie2c466a841743e0bee59ee4c86dccf2aca31ae09
2016-04-28 22:28:56 +02:00