diff options
author | Steve Purcell <steve@sanityinc.com> | 2020-06-20 15:59:29 +1200 |
---|---|---|
committer | Steve Purcell <steve@sanityinc.com> | 2020-06-20 16:01:01 +1200 |
commit | 257557be073e697c61e70005d32642ac9515451b (patch) | |
tree | 847f177fb03291df54a851118b55bf7e71c08a0d | |
parent | 1b7520aab8594c1e231974273db5d8515d415bc3 (diff) | |
download | nixlib-257557be073e697c61e70005d32642ac9515451b.tar nixlib-257557be073e697c61e70005d32642ac9515451b.tar.gz nixlib-257557be073e697c61e70005d32642ac9515451b.tar.bz2 nixlib-257557be073e697c61e70005d32642ac9515451b.tar.lz nixlib-257557be073e697c61e70005d32642ac9515451b.tar.xz nixlib-257557be073e697c61e70005d32642ac9515451b.tar.zst nixlib-257557be073e697c61e70005d32642ac9515451b.zip |
Add docstring with example Package-Requires parse inputs and results
-rw-r--r-- | parse.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/parse.nix b/parse.nix index 6244b6954fbe..3fc18b7f0a46 100644 --- a/parse.nix +++ b/parse.nix @@ -6,6 +6,19 @@ let (x: builtins.typeOf x == "string") (builtins.split _sep _s); + # Parse (all) Package-Requires elisp headers found in the input string + # `packageFile` into a list of package name strings. + # + # Example inputs: + # + # ;; Package-Requires: () + # => [ ] + # ;; Package-Requires: ((dash "2.12.1") (pkg-info "0.4") (let-alist "1.0.4") (seq "1.11") (emacs "24.3")) + # => [ "dash" "pkg-info" "let-alist" "seq" "emacs" ] + # ;; Package-Requires: (dash (pkg-info "0.4")) + # => [ "dash" "pkg-info" ] + # ;; Package-Requires: ((dash) (pkg-info "0.4")) + # => [ "dash" "pkg-info" ] parsePackagesFromPackageRequires = packageFile: let lines = splitString "\r?\n" packageFile; |