7029 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
0ce013a499 New script to create a source package for Langkit_Support
TN: TA19-011
2020-10-20 16:32:07 +02:00
Pierre-Marie de Rodat
a556e9b89d Langkit_Support.Symbols: fix Get_Symbol for null symbols
When symbol canonicalization fails, $.Lexer_Implementation.Force_Symbol
calls Get_Symbol passing to it No_Thin_Symbol, so Get_Symbol needs to
support this case.

TN: T923-007
2020-09-23 12:52:22 +02:00
Pierre-Marie de Rodat
2580460fe5 Introduce the named environments mechanism
See the "Named environments" comments section in
pkg_implementation_spec.mako for details.

TN: T320-010
2020-09-23 10:00:39 +02:00
Pierre-Marie de Rodat
b2f7a7d62a $.Implementation: always generate env spec helpers
Put the declaration of these helper subprograms in $.Implementation's
spec so that we never get a warning about them being unused. This is now
the most common way to handle templating: first it removes the need to
do complex conditional code emission, simplifying templates, and second,
in the future, these helpers will belong to Langkit_Support: avoiding to
generate them when they are not needed (i.e. only for toy language
specs) is pointless.

TN: T320-010
2020-09-23 10:00:39 +02:00
Pierre-Marie de Rodat
87b19100a6 Langkit_Support.Vectors: make the Reserve primitive public
TN: T320-010
2020-09-23 10:00:39 +02:00
Pierre-Marie de Rodat
d071ca2c6c Fix the representation of Cast/IsA expressions for debugging 2020-09-23 10:00:39 +02:00
Pierre-Marie de Rodat
eb4ef234bf Use simpler names for node-specific pre/post env actions procedures
This essentially reduces for instance "Bare_Foo_Pre_Env_Actions" to
"Foo_Pre_Env_Actions".

TN: T320-010
2020-09-23 10:00:39 +02:00
Pierre-Marie de Rodat
e0168b2449 Testsuite: statically link test programs
TN: T320-010
2020-09-23 10:00:39 +02:00
Pierre-Marie de Rodat
cd900089aa GDB helpers: refactor GDB value matching code
TN: T320-010
2020-09-23 10:00:39 +02:00
Pierre-Marie de Rodat
d7e35e7ba4 Forbid add_env() in post-PLE
Such uses of add_env() look suspicious, and they would complicate the
implementation of named envs.

TN: T320-010
2020-09-23 10:00:39 +02:00
Raphaël AMIARD
fa11d4bdd3 T917-024/SA28-035: Don't use negative ranges for token slocs. 2020-09-21 15:16:26 +02:00
Romain Beguet
e0d1509f92 Minor: Fix GDB Helpers due to recent change in token sloc representation. 2020-09-17 14:45:59 +02:00
Raphaël AMIARD
eff5ae2cd9 T910-014: Improve App
- Allow just subclassing App.process_unit, by providing a default main
  that iterates on units and calls process_unit on each

- Allow passing args to python App programmatically
2020-09-11 17:54:55 +02:00
Pierre-Marie de Rodat
039b5aa93e Restore support for Python3.7
This removes Python3.8-specific parts of Langkit so that users based on
not-too-recent Python distributions (for instance on Debian stable) can
use Langkit without building their own interpreter.

To detect such future 3.8 specificities, this commit also tunes the
Travis CI setup to run using Python 3.7.

TN: T911-014
2020-09-11 14:44:34 +02:00
Raphaël AMIARD
e376e0d7cf SA28-035: Correct bug in TDH.Compute_Lines_Start 2020-09-09 19:01:45 +02:00
Pierre-Marie de Rodat
b389a3b1b1 $.Rewriting: remove useless WITH/USE
TN: T811-027
2020-09-08 17:28:37 +02:00
Pierre-Marie de Rodat
abbb68e949 Use gnatcov's --no-subprojects flag
We want coverage analysis to process only the root project (i.e. the
generated library, and not langkit_support & all). This used to be the
default, but gnatcov recently switched to a "recursive" mode by default.
Use the new --no-subprojects flag to get back to the previous behavior.

TN: S528-004
2020-09-08 17:28:37 +02:00
Pierre-Marie de Rodat
9da902be11 ocaml_api/general: fix encoding issues on Windows
TN: T804-039
2020-09-08 17:28:37 +02:00
Raphaël AMIARD
cbd21c6d14 Add langkit_support vector get/pop test 2020-09-08 16:57:26 +02:00
Raphaël AMIARD
b239997070 SA28-035: get rid of sloc computation in lexer implem 2020-09-08 16:57:26 +02:00
Raphaël AMIARD
2c845d6f41 SA28-035: Remove unused mako template helper 2020-09-08 16:57:26 +02:00
Raphaël AMIARD
5e0d91a342 SA28-035: LK.Bump_Ptr - Add untyped alloc APIs
Will be used to allocate the logic vars in LAL directly in the unit
pool, for faster/more convenient allocation and deallocation.
2020-09-08 16:57:26 +02:00
Raphaël AMIARD
8f7fe71fc3 SA28-035: Add Address compiled type
Will be used to store a reference to a logic var manually allocated
array in LAL. In general, can be useful to store data for extensions
that needs to be opaque from the DSL side because the type is not a DSL
compatible type.
2020-09-08 16:57:26 +02:00
Raphaël AMIARD
b3d7f0c875 SA28-035: Add extension points to unit
Those extension points will allow us to store a logic var vector in the
analysis unit, and use it to lazily allocate logic vars rather than
storing them in nodes directly,
2020-09-08 16:57:26 +02:00
Raphaël AMIARD
2b851d0c28 SA28-035: Pack token records
This saves quite a lot of memory and has minimal performance impact.
2020-09-08 16:57:26 +02:00