31 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
842c61c9f1 Regenerate bootstrap sources 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
15745870c3 Lkt: regenerate bootstrap sources 2026-02-12 11:48:42 +00:00
Killian Perlin
b66eafd4dc Regenerate bootstrap sources 2026-01-29 13:33:06 +00:00
Pierre-Marie de Rodat
63f7bcd73d Regenerate bootstrap sources 2026-01-20 16:03:43 +00:00
Pierre-Marie de Rodat
9a1ffb91f0 Regenerate bootstrap sources 2026-01-20 16:03:43 +00:00
Pierre-Marie de Rodat
58ef2b4385 Regenerate bootstrap sources 2026-01-20 16:03:43 +00:00
Eric Botcazou
b1d584d75e Fix a few illegal Ada 2012 constructs now spotted by the compiler
They are illegal per RM 6.4.1(6.4): In a function call, the accessibility
level of the actual object for each explicitly aliased parameter shall not
be statically deeper than the accessibility level of the master of the call.

The fix is to make more parameters explicitly aliased.

Issue: eng/toolchain/gnat#1696
2025-12-10 20:30:06 +01:00
Killian Perlin
5e9e82b751 Frontend implementation for query comprehension 2025-11-26 11:08:18 +00:00
Killian Perlin
9c63199a40 Add stream operator support
Update bootstrap
2025-10-30 11:13:02 +01:00
Laurent Thévenoux
2964f7850c Make Pretty_Print_Main docstrings RST ready 2025-10-23 08:43:39 +00:00
Raphaël AMIARD
354b054174 Allow parsing of any decl in BlockExpr 2025-10-21 13:25:04 +00:00
Raphaël AMIARD
daf063fee3 Refactor lexer/parser rules grammar
* Make the grammar less ambiguous by changing the syntax of the lexer's
  forward declartion from `Foo` to `Foo <- null`

* This in turn allows the sharing of the `decl` grammar rule in the
  grammar, simplifying the grammar and allowing the production of better
  error messages.

* The lexer_decl rule is simplified (lexer_family_decl occured twice)

* GrammarNull is allowed to not have a type suffix
2025-10-21 13:25:04 +00:00
Jerome Lambourg
05473171db In project files, remove the use of the gnatcoll.gpr project.
The gnatcoll_core should be used instead.

For eng/toolchain/gnatcoll-core#133
2025-08-19 11:40:43 +02:00
Pierre-Marie de Rodat
37c69d7f80 Lkt: add error recovery to the parsing of block expression
Introduce a new node (`BlockExprClause`) so that:

1. The `;` token belongs to list items in block expressions rather than
   being a separator for that list.

2. The inner expression in block exprs belongs to that list, so that
   there is no `;` token parser that follows the parser for that list.

The conjunction of both points allows us to introduce `skip`/`dont_skip`
parser for error recovery in the parsing of block expressions. The extra
sources that are accepted by the new parser are rejected by the Lkt
frontend.

Note that, due to a Langkit parser bug (likely
eng/libadalang/langkit#652), sometimes there is no parsing error even
though the parse tree contains an error node. This should be addressed
later.
2025-07-09 09:25:10 +00:00
Pierre-Marie de Rodat
a61867e2d5 manage.py: include extension sources + langkit.yaml in bootstrap sources 2025-06-27 12:40:56 +02:00
Remi Segard
4168574f42 Lkt: prevent PLE when getting custom image
``custom_image`` was calling ``full_name``, which was a public property:
this implies that PLE would be called when using simple syntaxic
methods, like ast dumping. This introduces ``full_name_internal`` which
is used internally instead of ``full_name``, which becomes a simple
public wrapper.
2025-06-02 11:00:55 +02:00
Raphaël AMIARD
75882ae9d5 Rename "from" into "origin" 2025-05-26 13:43:27 +00:00
Raphaël AMIARD
bf4cf11c5a Lktql: Fix some comments 2025-05-23 07:18:07 +00:00
Raphaël AMIARD
932fb6fb1f Significantly refactor the grammar for patterns.
The first iteration was just a relatively basic copy&paste from the LKQL
grammar, that carries a lot of cruft and legacy at this stage. Following
the comments on the initial review for the merge request, it was decided
to take the opportunity to clean the grammar.

* Rename "BasePattern" into "Pattern"
* Remove every pattern abstract intermediate class (ValuePattern and
  NodePattern). The categorizations they introduce is not very useful,
  and they introduce a lot of complexity.
* Rename pattern details
* Remove mentions of "node" patterns, since we want to make the notion
  of matching on a given type more general than just for node types.
* Rename ExtendedNodePattern -> ExtendedPattern, since we might want to
  generalize the notion, and NodeKindPattern was renamed into
  TypePattern already.
* Rewrite most of the docstrings
* Rename Splat -> Ellipsis
* Unify the naming of sub pattern fields (call them all
  `sub_pattern`/`sub_patterns`.
2025-05-23 07:18:07 +00:00
Raphaël AMIARD
eecd91877d Lktql: Add support for patterns in match expressions 2025-05-23 07:18:07 +00:00
Raphaël AMIARD
00bf1a5964 Lktql: Add patterns to the Lkt grammar
Also add some support for unparsing (not complete but good enough for
now)
2025-05-23 07:18:07 +00:00
Remi Segard
fb91422439 Lkt: Add null checks on get_type 2025-05-16 08:15:02 +00:00
Pierre-Marie de Rodat
6cefc74c93 Set up pre-commit checks and reformat the Python sources with black 2025-03-26 14:04:20 +00:00
Pierre-Marie de Rodat
954280b1bd Lkt: cleanly reject the null-conditional operator on cast expressions
`a?.as[T]` would be equivalent to `a.as[T]`, and `a?.as[T].foo` would be
equivalent to `a.as[T]?.foo`, so allowing `a?.as[T]` is not particularly
useful, and is even confusing when combined with the `a.as![T]` form
(semantic of `!` opposed to the one of `?`). Fix the parser to still
correctly analyze this form, but disallow it during the lowering.
2025-03-26 14:02:49 +00:00
Pierre-Marie de Rodat
8aa24c4f0c Lkt: fix the handling of ?.keep[T] expressions
Modify the Lkt KeepExpr node and related parser to correctly parse
`a?.keep[T]` and adapt lowering logic to implement the null-conditional
behavior correctly.
2025-03-26 14:02:49 +00:00