Commit Graph

64 Commits

Author SHA1 Message Date
Anton-Latukha 0cb3946ee7
clean-up: (return -> pure)
M  main/Main.hs
M  main/Repl.hs
M  src/Nix/Builtins.hs
M  src/Nix/Convert.hs
M  src/Nix/Effects.hs
M  src/Nix/Effects/Basic.hs
M  src/Nix/Eval.hs
M  src/Nix/Exec.hs
M  src/Nix/Expr/Types.hs
M  src/Nix/Json.hs
M  src/Nix/Lint.hs
M  src/Nix/Normal.hs
M  src/Nix/Options/Parser.hs
M  src/Nix/Parser.hs
M  src/Nix/Scope.hs
M  src/Nix/String.hs
M  src/Nix/TH.hs
M  src/Nix/Thunk/Basic.hs
M  src/Nix/Utils.hs
M  src/Nix/Value.hs
M  src/Nix/Value/Equal.hs
M  src/Nix/XML.hs
M  tests/EvalTests.hs
M  tests/Main.hs
M  tests/NixLanguageTests.hs
M  tests/ParserTests.hs
M  tests/TestCommon.hs
2020-09-21 01:57:52 +03:00
John Wiegley 0ca6613d4b Fixes for building with GHC 8.6.5 under Nix 2020-01-13 17:55:16 -08:00
Guillaume Maudoux 4ded48a789 Add proper default 'nix' prefix to search paths
The search path of Nix contains by default the "nix" prefix that points
to $datadir/nix/corepkgs, where $datadir defaults to $prefix/lib at
installation time, but can be overriden by NIX_DATA_DIR.

We implemented it using `Paths.hnix.getDataDir` and `NIX_DATA_DIR` to
follow Nix behaviour as closely as possible.

A small discrepancy is that we do the lookup on each invocation, where
Nix caches the searchPath at context creation.
2019-11-26 14:32:29 -07:00
Félix Baylac-Jacqué cacbfdbd6d Builtins: add builtins.concatMap
Fixes #448
2019-04-01 15:45:27 -07:00
Félix Baylac-Jacqué 3acc67ba66 Fix eval-okay-builtins-add.
Nix omits the trailing .0 when displaying a Float. Aligning current
hnix pretty printer with this behaviour.

Fixes #447.
2019-03-27 21:16:54 -07:00
John Wiegley 94e0be3882
Reformat all sources with Brittany, to restore consistency 2019-03-17 14:47:38 -07:00
Ryan Trinkle c738f552b8 Disable new tests that have never yet passed 2019-03-09 15:16:22 -05:00
Ken Micklas 195d4531cd Fix build in tests 2018-12-10 15:33:29 -05:00
Shea Levy 2bba6c84e6
Revert "Fix compilation"
This fix isn't necessary now that the XML context change is
reverted.

This reverts commit 51d493f484.
2018-11-27 14:22:04 -05:00
Domen Kožar 51d493f484
Fix compilation 2018-11-25 10:01:14 +00:00
John Wiegley ba0dc19d2d
Work from mightybyte: Minimize deps required, for building with GHCJS 2018-05-08 16:41:15 -07:00
John Wiegley e6e117f6b7
Disable the builtins.path test for now, until #128 is fixed 2018-05-07 12:06:45 -07:00
hsloan c1561ea711 Implement builtins.currentTime 2018-05-02 21:32:00 -07:00
John Wiegley 84dcb2e378 If a .nix test has no .exp file, just check that it evaluates 2018-04-30 19:12:24 -04:00
John Wiegley 0b6c52eb45 Remove all warnings 2018-04-28 16:26:32 -07:00
John Wiegley dfcb48fce1 Restore verbose error reporting from Nix language tests 2018-04-28 15:30:44 -07:00
John Wiegley 6d2df41a03 Make the search-path test immune to the user's NIX_PATH 2018-04-27 16:45:58 -07:00
John Wiegley 6c2149f767 Remove code TODOs, which have been changed into GitHub issues 2018-04-26 17:13:22 -07:00
John Wiegley 68d81dd57c More work on provenance reporting 2018-04-24 23:09:43 -07:00
John Wiegley 2de8c7cf84 More fixes to error reporting 2018-04-24 12:25:40 -07:00
John Wiegley 01bcb86d3f Further improvements to error rendering, but not all done yet 2018-04-24 11:12:20 -07:00
John Wiegley 9864a8c7a5 Rework the way that info frames and error are handled
There is still work to be done to render the new "typed frames", and to
convert all the current string based frame into typed frames. This will pave
the way forward to smarter error messages that can be browsed in intelligent
environments like Emacs and the browser.
2018-04-24 02:15:28 -07:00
John Wiegley c3f34e62ce Use verbosity to control how much is displayed in error messages 2018-04-17 17:25:59 -07:00
John Wiegley 451ccf7c60 Fix test eval-okay-autoargs 2018-04-15 02:22:33 -07:00
John Wiegley cce65fb106 Add argument processing for the tests; test still not working yet 2018-04-15 02:16:06 -07:00
John Wiegley 7f6a64da04 More corrections to the search path logic
Fixes #112
2018-04-13 16:37:11 -07:00
John Wiegley 78b185c5b5 Add a strange hack needed to get a test to run 2018-04-13 01:20:58 -07:00
John Wiegley ef489753e7 Fix to find env path 2018-04-13 00:52:09 -07:00
John Wiegley 14bc5360f4 More work on supporting -I and completing env paths 2018-04-13 00:34:49 -07:00
John Wiegley 99189e9536 The basic REPL now works; doesn't allow establishing definitions yet 2018-04-12 16:46:34 -07:00
John Wiegley 90e4a3ec37 Add preliminary parsing of .flags files, though more work is needed 2018-04-11 21:02:37 -07:00
John Wiegley 74de14dc7d Restore the linter, to some degree, at least for the language tests 2018-04-10 21:02:01 -07:00
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