Commit graph

64 commits

Author SHA1 Message Date
John Wiegley 2a61ed7307 Fix to value rendering (though won't work with scripting yet) 2018-04-25 00:03:17 -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 8a93068102 Rename Nix.Core back to Nix.Eval, since Nix.Eval was now almost empty 2018-04-21 10:11:34 -07:00
John Wiegley 35d669e55c Add a missing call to withNixContext in Main.hs 2018-04-21 00:48:04 -07:00
John Wiegley 86b09103d6 Move production of a reduced test case to --reduce, improve --trace 2018-04-20 22:36:40 -07:00
John Wiegley 2c80225241 Add a new --trace option, separate from verbosity levels 2018-04-18 23:20:58 -07:00
John Wiegley dfe9869472 Add new option --force, which forces evaluation results to normal form 2018-04-17 18:12:19 -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 8d25aa461d Add --json option to hnix, which can render both expressions and values 2018-04-17 14:24:52 -07:00
John Wiegley dacd0ca0db Restore the "normal form recursive" ToNix/FromNix type classes
This allows for very easily written Builtins
2018-04-15 20:43:04 -07:00
John Wiegley 42c0503de8 Move more code into Nix.Entry, to better support the tests 2018-04-15 02:02:26 -07:00
John Wiegley 4f17250d11 More simplifying of imports 2018-04-14 09:44:55 -07:00
John Wiegley 58b65d2ce1 Don't evaluate to normal form by default in the top level evaluators 2018-04-13 19:29:18 -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 709cc5247e Add code for doing Hindley-Milner type inference, and a repl
This code was written by Stephen Diehl and Kwang Yul Seo, which they released
under an MIT license as the project poly_constraints:

    https://github.com/kseo/poly_constraints

The code is added to hnix right now as mainly a placeholder, and will need to
be modified before it can be used.
2018-04-12 10:53:50 -07:00
John Wiegley 9a089712aa Create new __includes builtin, set by --include/-I 2018-04-11 22:02:31 -07:00
John Wiegley 371380c98f Add support for the --attr/-A option 2018-04-11 21:31:48 -07:00
John Wiegley 96df58fb29 Split off command-line options processing into a new Nix.Options module 2018-04-11 20:53:38 -07:00
John Wiegley f3ee76f4ae Support handling of --arg and --argstr, though with some changes
optparse-applicative can't really support "--arg name value", so instead we
require "--arg name=value", printing an error message if the user attempts the
former.
2018-04-11 20:46:52 -07:00
John Wiegley b621ffee0a Move the caching support code into its own Nix.Cache module 2018-04-11 20:21:02 -07:00
John Wiegley 22175aa927 Use the serialise library on non-Linux systems, compact on Linux 2018-04-11 17:59:42 -07:00
John Wiegley 941d4f9fd3 Add testing code for writing out Nix parses as compact regions 2018-04-11 14:35:17 -07:00
John Wiegley c2aaec0e9e Read in --arg and --argstr options, but don't handle them yet 2018-04-10 21:29:48 -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 9d8c90efbf Add a --parse flag that currently does nothing; change -e to -E 2018-04-10 17:42:35 -07:00
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