String-parsing in Nix: Difference between revisions

From NixOS Wiki
imported>Milahu
m rename section to IPv4 address
imported>Milahu
add parsers: xml, mix.lock + text + format
Line 11: Line 11:


* https://github.com/mozilla/nixpkgs-mozilla/blob/master/lib/parseTOML.nix
* https://github.com/mozilla/nixpkgs-mozilla/blob/master/lib/parseTOML.nix
=== xml ===
* https://github.com/nprindle/nix-parsec/pull/6
* [https://github.com/NixOS/nixpkgs/issues/57239 fromXML builtin? (nixpkgs#57239)]


=== yarn.lock ===
=== yarn.lock ===
Lockfile for [https://yarnpkg.com/ yarn], a package manager for JavaScript


* https://github.com/nix-community/dream2nix/blob/main/src/subsystems/nodejs/translators/yarn-lock/parser.nix
* https://github.com/nix-community/dream2nix/blob/main/src/subsystems/nodejs/translators/yarn-lock/parser.nix
* https://github.com/nix-community/npmlock2nix/pull/29
* https://github.com/nix-community/npmlock2nix/pull/29
* https://github.com/nprindle/nix-parsec/pull/3
=== mix.lock ===
Lockfile for [https://hex.pm/docs/usage mix], a package manager for Erlang
* https://github.com/nprindle/nix-parsec/pull/3
* https://github.com/nprindle/nix-parsec/pull/3


Line 25: Line 38:
=== arithmetic ===
=== arithmetic ===


https://github.com/nprindle/nix-parsec/tree/master/examples/arithmetic
* https://github.com/nprindle/nix-parsec/tree/master/examples/arithmetic


=== cabal freeze ===
=== cabal.project.freeze ===


https://github.com/nix-community/dream2nix/blob/main/src/subsystems/haskell/translators/cabal-freeze/parser.nix
Lockfile for [https://cabal.readthedocs.io/en/stable/cabal-commands.html#cabal-freeze cabal], a package manager for Haskell
 
* https://github.com/nix-community/dream2nix/blob/main/src/subsystems/haskell/translators/cabal-freeze/parser.nix


=== IPv4 address ===
=== IPv4 address ===


https://github.com/NixOS/nix/issues/1491#issuecomment-318273971
* https://github.com/NixOS/nix/issues/1491#issuecomment-318273971


=== UUID ===
=== UUID ===


https://github.com/nprindle/nix-parsec/tree/master/examples/uuids
* https://github.com/nprindle/nix-parsec/tree/master/examples/uuids


=== Linux kernel config ===
=== Linux kernel config ===


https://github.com/nprindle/nix-parsec/tree/master/examples/kernel-config
* https://github.com/nprindle/nix-parsec/tree/master/examples/kernel-config


=== Python setup.cfg ===
=== Python setup.cfg ===


https://github.com/seppeljordan/nix-setuptools/blob/master/lib/setuptools.nix
* https://github.com/seppeljordan/nix-setuptools/blob/master/lib/setuptools.nix


=== PureScript ===
=== PureScript ===


https://github.com/purs-nix/purs-nix/blob/master/parser.nix
* https://github.com/purs-nix/purs-nix/blob/master/parser.nix


== Parser combinators ==
== Parser combinators ==


Build parsers from grammars
Build complex parsers from many small parsers


* https://github.com/nprindle/nix-parsec - API is similar to [https://github.com/mrkkrp/megaparsec megaparsec] in Haskell
* https://github.com/nprindle/nix-parsec - API is similar to [https://github.com/mrkkrp/megaparsec megaparsec] in Haskell
Line 65: Line 80:


* [https://github.com/NixOS/nix/issues/1491 Add an Earley parser builtin (nix#1491)]
* [https://github.com/NixOS/nix/issues/1491 Add an Earley parser builtin (nix#1491)]
* [https://github.com/NixOS/nixpkgs/issues/57239 fromXML builtin? (nixpkgs#57239)]
* [https://github.com/purenix-org/purenix purenix - compile PureScript to Nix]
* [https://github.com/purenix-org/purenix purenix - compile PureScript to Nix]
* String parsing in other Functional Programming Languages
* String parsing in other Functional Programming Languages
** String parsing in Haskell ([https://www.google.com/search?q=String+parsing+in+Haskell google])
** String parsing in Haskell ([https://www.google.com/search?q=String+parsing+in+Haskell google])
** XML parser in pure Haskell ([https://www.google.com/search?q=XML+parser+in+pure+Haskell google])

Revision as of 07:54, 20 November 2022

String parsers

Some string parsers written in Nix

yaml

toml

xml

yarn.lock

Lockfile for yarn, a package manager for JavaScript

mix.lock

Lockfile for mix, a package manager for Erlang

Lisp

arithmetic

cabal.project.freeze

Lockfile for cabal, a package manager for Haskell

IPv4 address

UUID

Linux kernel config

Python setup.cfg

PureScript

Parser combinators

Build complex parsers from many small parsers

Grammars

See also