Commit graph

32 commits

Author SHA1 Message Date
John Wiegley 4c2eebbe40 Refactor evaluation using a type class 2018-04-09 00:52:10 -07:00
Ryan Trinkle 1ada8648f2 Fix comparison of derivations 2018-04-07 20:15:55 -04:00
John Wiegley 85b7799246 Quiet some warnings 2018-04-07 15:15:22 -07:00
John Wiegley c8e9012778 Some minor fixups for compilation 2018-04-07 15:13:58 -07:00
Doug Beardsley 3d98bc8e05 Revert import change 2018-04-07 15:07:09 -07:00
Doug Beardsley 1b7dac071d Test to catch a bug in builtins.match
Also added infrastructure for comparing against current nix behavior,
not just current nix tests.
2018-04-07 15:07:09 -07:00
John Wiegley ea6a98f602 Implement builtins.tryEval 2018-04-07 14:33:15 -07:00
John Wiegley d9047cc216 Factor out some code into new module Nix.Value 2018-04-07 11:38:12 -07:00
Doug Beardsley a074ede2f1 Remove old comment 2018-04-05 17:06:00 -06:00
Doug Beardsley 42fbb1faa9 The eval-okay-xml test case passes
Still need to decide what to do with commented out instances
2018-04-05 17:06:00 -06:00
Doug Beardsley 873d0f8ec0 WIP XML serializer for NVClosure
Seems to be working except for mismatches in tag ordering
2018-04-05 17:03:14 -06:00
John Wiegley a1fdb35be0 __curPos requires that we evaluation with location info
Fixes #125
2018-04-05 00:12:27 -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 2ea17d7000 Make the language tests output a bit less noisy 2018-04-04 00:05:10 -07:00
Ryan Trinkle bc753fda5f Ignore tests ending in ".exp.disabled" 2018-04-03 23:54:29 -04: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 1dede9334a Correction to the tests 2018-04-01 10:55:23 -07:00
John Wiegley d08ca26da0 Add informative backtraces on evaluation failure 2018-03-30 23:10:44 -07:00
John Wiegley 74cc1a2ad5 Split MonadNix into evaluation and environmental effects 2018-03-30 14:25:03 -07:00
John Wiegley 9f6c2ba948 Move a lot of code around into new modules 2018-03-30 14:08:38 -07:00
John Wiegley a4a2fc0659 Move the linting code into its own module 2018-03-30 12:45:23 -07:00
John Wiegley 22924a591f Implement getEnv, set TEST_VAR=foo for the language tests 2018-03-30 02:16:52 -07:00
John Wiegley c234849fd6 Fix a few tests by making a small change to printNix 2018-03-30 02:07:08 -07:00
John Wiegley 8e944cc223 Fix the tests 2018-03-30 02:00:36 -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 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 39f772ef3c Restore monadic abstraction (to support importFile), fix attribute sets 2018-03-28 14:45:10 -07:00
John Wiegley 3a29249e43 Normalize import statements, add option parsing 2018-03-27 21:59:27 -07:00
John Wiegley 1e0e47d064 Remove monadic context from evalExpr: we weren't using it! 2018-03-27 19:07:08 -07:00
Guillaume Maudoux 25f1da3408 Run lang tests from upstream 2018-02-15 12:06:09 +01:00