mirror of
https://github.com/anoma/juvix.git
synced 2024-12-01 00:04:58 +03:00
672e400a2a
Core transformations apply to the whole InfoTable, the REPL needs to apply Core transformations to the single node that it compiles from the user input string. The solution in this commit is to: 1. Compile the input string as before to obtain a Core Node. 2. Add this Node to a copy of the Core InfoTable for the loaded file. 3. Apply the (CLI specified) Core transformations to this InfoTable. 4. Extract the (now transformed) Node from the InfoTable. We can think of a way to improve this, maybe when we tackle allowing the user to make new definitions in the REPL. As soon as compilation of pattern matching is complete we should enable some (all?) Core transformations by default. Example: At the moment we get the following result in the REPL: ``` juvix repl ... Stdlib.Prelude> 1 + 1 suc (suc zero) ``` After this commit we can turn on `nat-to-int` transformation: ``` juvix repl -t nat-to-int Stdlib.Prelude> 1 + 1 2 ``` * Part of https://github.com/anoma/juvix/issues/1531 |
||
---|---|---|
.. | ||
Commands | ||
TopCommand | ||
App.hs | ||
AsmInterpreter.hs | ||
CommonOptions.hs | ||
Evaluator.hs | ||
GlobalOptions.hs | ||
Main.hs | ||
Root.hs | ||
TopCommand.hs |