Location Improvements
Motivation and Context
Related issue: #1503
This MR is the first step towards removing Location.dummy
and Location.generated
. It aims at ensuring locations are explicit (up until Mini_c
)
by removing many of the optional ?loc/?location
parameters from our AST combinators.
Description
Added several virtual locations that are more descriptive than dummy
/ generated
e.g. Location.interpreter
for Ast
fragments generated by the interpreter.
Require variables to have explicit locations.
Modified Ast_(imperative|core|typed|aggregated)
combinators to require explicit locations.
A non-trivial amount of trivial updates to various functions for passing around locations.
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to not work as expected) -
Performance improvement (non-breaking change that improves performance) -
None (change with no changelog)
Changelog
Location tracking improvements within the compiler
Checklist:
-
Changes follow the existing coding style (use dune @fmt
to check). -
Tests for the changes have been added (for bug fixes / feature). -
Documentation has been updated. -
Changelog description has been added (if appropriate). -
Start titles under ## Changelog
section with #### (if appropriate). -
There is no image or uploaded file in changelog -
Examples in changed behaviour have been added to the changelog (for breaking change / feature).