parseNixText function

This commit is contained in:
Allen Nelson 2015-10-27 17:32:03 -05:00
parent 64a45f4181
commit a876d49789
4 changed files with 24 additions and 6 deletions

View File

@ -1,7 +1,12 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Nix.Parser (parseNixFile, parseNixString, Result(..)) where
module Nix.Parser (
parseNixFile,
parseNixString,
parseNixText,
Result(..)
) where
import Control.Applicative
import Control.Monad
@ -244,3 +249,6 @@ parseNixFile = parseFromFileEx $ nixExpr <* eof
parseNixString :: String -> Result NExpr
parseNixString = parseFromString $ nixExpr <* eof
parseNixText :: Text -> Result NExpr
parseNixText = parseNixString . unpack

View File

@ -3,4 +3,6 @@ let
haskellPackages = nixpkgs.pkgs.haskell.packages.${compiler};
in
haskellPackages.callPackage ./project.nix {}
haskellPackages.callPackage ./project.nix {
pkgs = nixpkgs;
}

View File

@ -1,5 +1,5 @@
Name: hnix
Version: 0.2.2
Version: 0.2.3
Synopsis: Haskell implementation of the Nix language
Description:
Haskell implementation of the Nix language.

View File

@ -1,11 +1,19 @@
{ mkDerivation, ansi-wl-pprint, base, containers, data-fix, parsers
, stdenv, tasty, tasty-hunit, tasty-th, text, transformers
, trifecta, unordered-containers, cabal-install
, trifecta, unordered-containers, cabal-install, pkgs
}:
let
inherit (builtins) filterSource;
inherit (pkgs.lib) elem;
in
mkDerivation {
pname = "hnix";
version = "0.2.2";
src = ./.;
version = "0.2.3";
src = let
notNamed = list: name: !(elem (baseNameOf name) list);
in filterSource (n: _: notNamed [".git" "dist" "benchmarks"] n) ./.;
isLibrary = true;
isExecutable = true;
buildDepends = [