Commit graph

106 commits

Author SHA1 Message Date
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 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
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