13 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
ec4872e418 Lkt: change naming convention for token names for lower to camel
This makes the convention consistent with the DSL, and avoids
workarounds for conflicts with Lkt keywords: in Libadalang, the Null
token can stay Null, instead of null_tok (no API breakage needed).
2024-06-28 08:41:26 +00:00
Pierre-Marie de Rodat
5d5a1029cb Lkt: rename @unparse_newline_after to @with_unparsing_newline 2024-06-19 10:18:02 +00:00
Pierre-Marie de Rodat
0ca47a255c Lkt: rename @unparse_spacing to @unparsing_spacing 2024-06-19 10:18:02 +00:00
Pierre-Marie de Rodat
8da114fb26 Unparsing: keep track of the link to original tokens
This change enhances the unparsing engine so that template instantiation
keeps track of tokens from the source code to reformat as the unparsed
token are produced.

This is preparatory work to preserve formatting information from the
original source code (empty lines and comments), but no change of
behavior is expected at this stage.
2024-06-10 12:38:13 +00:00
Pierre-Marie de Rodat
73ef5560c0 Lexer: use the first text found for a token in order to unparse it 2024-02-28 09:51:39 +00:00
Pierre-Marie de Rodat
e2f68bb610 Introduce the "is_comment" trivia annotation
This new annotation will allow unparsers to determine which trivia
should be preserve during unparsing (no trivia is preserve right now).
2024-02-19 12:19:08 +00:00
Pierre-Marie de Rodat
dfcf584cbe Langkit_Support.Generic_API.Unparsing: add Prettier output prototype 2024-01-10 12:36:41 +00:00
Pierre-Marie de Rodat
d46bddb785 properties/big_integer: rework testcase
Enhance it to cover more DSL operations on big integers, and remove uses
of lexical envs, clearly not necessary to test big integers. This will
help transitionning the testcase to Lkt.
2023-12-13 13:36:33 +00:00
Pierre-Marie de Rodat
16639a7818 lexer_example: set "var" as alphanumerical
This is necessary so that unparsing inserts a space between "var" and
"foo" in "var foo". That problem was undetected so far in our only
rewriting API test because all variable declaration nodes were rewritten
from sources (they were not synthetized), so formatting (which includes
that space) was preserved.
2023-11-13 13:30:29 +00:00
Pierre-Marie de Rodat
4c1391dd5f Introduce a language spec-wide option to enable case insensitivity
When enabled, this new option triggers the lexer engine to perform
"native" case insentivity and provides a default symbol canonicalizer
that just converts names to lower case.

TN: U118-054
2021-01-25 12:52:15 +01:00
Raphaël AMIARD
f2c6d30415 RA22-015: Rework unparsing annotations 2020-06-30 15:43:53 +02:00
Pierre-Marie de Rodat
8f9232f99e Regenerate lexer_example.lkt
TN: RA22-015
2020-03-16 10:41:18 +01:00
Pierre-Marie de Rodat
de58c96d16 Testsuite: factorize common lexers in the concrete syntax
TN: RA22-015
2020-03-16 10:41:18 +01:00