-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/export: fix let exporting
This is a hacky fix that relies on the original let AST expression to be present in the ADT. In practice this will almost certainly always be the case, though. As part of this, the name uniquer has been fixed to remember the random number. The exporter methods were defined on the value, instead of the pointer type, so the random generator was created on each instance. The first few numbers are now fixed, to have more sane numbers in the majority of cases. This algorithm has the additional property that if an expression refers to a let that is not exported, the expression will be inlined. This does not give the correct result if this expression itself contains references, but that is a general problem with the current exporter. NOTE: the filepath substitution is incorrect in value mode. The original was incorrect as well, however, as the alias also was inserted in the wrong scope. In practice this only matters for the already broken `eval`. In export it would always generate an error anyway. Unique name generator comment moved to where it applies. Fixes #1116 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I31c05485a5af4d9b423c71bd4e51fc05b5d4a5d7 Signed-off-by: Marcel van Lohuizen <[email protected]>
- Loading branch information
Showing
6 changed files
with
368 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.