Commit Graph

137 Commits

Author SHA1 Message Date
John Wiegley 91b33e250d Report evaluation errors nicely from Main.hs
Fixes #156
2018-04-10 12:25:34 -07:00
John Wiegley bf4ab0e4a8 Add an --ignore-errors option to the hnix executable 2018-04-10 09:02:02 -07:00
John Wiegley 2694f6ffaf More work on the megaparsec parser 2018-04-10 08:34:21 -07:00
John Wiegley 8f37f37986 Down to 16 basic test failures with megaparsec 2018-04-09 21:35:46 -07:00
John Wiegley 9d7f25d368 All is building with Megaparsec now, but many parsing tests fail 2018-04-09 17:12:16 -07:00
John Wiegley d964b7bb29 Allow expression trees to be deepseq'd 2018-04-09 02:07:40 -07:00
John Wiegley 9d5a7f8a27 Remove some settings from hnix.cabal 2018-04-05 21:10:06 -07:00
John Wiegley a0651ad2fd Add a -f option for reading files to process from another file or stdin 2018-04-05 20:43:13 -07:00
John Wiegley 838f08ddcf Don't require a -f option; behave as nix-instantiate does 2018-04-05 15:17:45 -07:00
John Wiegley c6f2da7409 Use the ST monad for running the linter
The only place where IO is needed is to read the source file when reporting
errors, so for now I just use unsafeIOToST for this one effect, since it
refers to data that should be immutable for the duration of the linting run.
2018-04-04 13:36:00 -07:00
John Wiegley 2bb88590ac Simplify the implementation of thunks by relying on Haskell's implementation
Relates to #75
2018-04-03 17:15:54 -07:00
John Wiegley ea36f85338 Use closures to capture the environment of a lambda abstraction
Fixes #108
2018-04-03 14:40:49 -07:00
John Wiegley b33c2647ec Remove some debug code 2018-04-03 14:24:16 -07:00
John Wiegley c3eb7a94b9 Add basic support for quasi-quotation of Nix expressions in Haskell 2018-04-03 14:21:33 -07:00
John Wiegley c50bf1a9f6 Preserve more information in __cur_file rather than __cwd 2018-04-02 19:57:05 -07:00
John Wiegley d7228c6a75 Move language feature pragmas into each Haskell file, not .cabal 2018-04-01 22:49:12 -07:00
John Wiegley f47b764dcf Initial phase of sym eval completed, still missing function application 2018-04-01 10:34:08 -07:00
John Wiegley d08ca26da0 Add informative backtraces on evaluation failure 2018-03-30 23:10:44 -07:00
John Wiegley 19e88692a3 Fix an import in Main.hs 2018-03-30 14:56:41 -07:00
John Wiegley cab2fe914e Add a missing import 2018-03-30 12:48:20 -07:00
John Wiegley 71b4bf5e8a Various fixes, and make imports local to their containing file 2018-03-30 01:50:19 -07:00
John Wiegley 4e698d76fa More fixes to lazy evaluation and scoping 2018-03-30 01:11:27 -07:00
John Wiegley 8f24c7b645 Implement laziness, although without support for concurrency 2018-03-29 15:35:12 -07:00
John Wiegley e06271d9ca Initial round of work on supporting first class thunks 2018-03-29 12:16:18 -07:00
John Wiegley 84918aa1d3 Remove the MonadFix requirement, it was not needed; fix NRecSet 2018-03-28 23:52:07 -07:00
John Wiegley dfee8cd2b8 Add checkExpr, which checks for errors in Nix expressions
This allows us to pass 10 more of the NixLanguageTests, so that after parsing
a file containing "x: y", we can report that y is undefined.
2018-03-28 16:27:35 -07:00
John Wiegley 2c188045cd Passing --debug to hnix when not evaluating dump the parse tree 2018-03-28 15:48:32 -07:00
John Wiegley 39f772ef3c Restore monadic abstraction (to support importFile), fix attribute sets 2018-03-28 14:45:10 -07:00
John Wiegley b923af49f4 Split off some utility functions into their own Nix.Utils module 2018-03-27 22:32:43 -07:00
John Wiegley f0f88edac7 Add support for import statements 2018-03-27 22:21:17 -07:00
John Wiegley 3a29249e43 Normalize import statements, add option parsing 2018-03-27 21:59:27 -07:00
Vaibhav Sagar ab52fb8d00 Import Nix.Expr so main/Main.hs compiles 2017-11-29 17:42:12 +08:00
Vaibhav Sagar 397dd29297 Reduce code duplication in main/Main.hs 2017-09-23 20:00:18 +08:00
Allen Nelson 9765256ab4 parsing variadic functions, avoiding empty list error 2015-06-23 19:19:46 -05:00
Allen Nelson b4c66b4876 not evaluating in hnix executable, only parsing 2015-06-23 16:53:07 -05:00
Benno Fünfstück 1b82727a17 Use data-fix for Fix and fix path parsing bug 2014-09-27 20:12:30 +02:00
Benno Fünfstück 3413a817e6 subdirectory for main to avoid redundant compile
Cabal builds the library files twice if the main executable and the
library share the same hs-source-dirs. Moving the main executable source
code to a subdirectory avoids this issue.
2014-08-19 18:48:55 +02:00