parseNixText function
This commit is contained in:
parent
64a45f4181
commit
a876d49789
|
@ -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
|
||||
|
|
|
@ -3,4 +3,6 @@ let
|
|||
haskellPackages = nixpkgs.pkgs.haskell.packages.${compiler};
|
||||
in
|
||||
|
||||
haskellPackages.callPackage ./project.nix {}
|
||||
haskellPackages.callPackage ./project.nix {
|
||||
pkgs = nixpkgs;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
14
project.nix
14
project.nix
|
@ -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 = [
|
||||
|
|
Loading…
Reference in a new issue