String-parsing in Nix: Difference between revisions

From NixOS Wiki
imported>Milahu
add parser: PureScript
imported>Milahu
update: Parser combinators
Line 51: Line 51:
https://github.com/purs-nix/purs-nix/blob/master/parser.nix
https://github.com/purs-nix/purs-nix/blob/master/parser.nix


== Parser generators ==
== Parser combinators ==


Generate parser from grammar
Build parsers from grammars


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


== See also ==
== See also ==

Revision as of 19:26, 17 November 2022

String parsers

Some string parsers written in Nix

yaml

toml

yarn.lock

Lisp

arithmetic

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

cabal freeze

https://github.com/nix-community/dream2nix/blob/main/src/subsystems/haskell/translators/cabal-freeze/parser.nix

IPv4 addresses

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

UUID

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

Linux kernel config

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

Python setup.cfg

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

PureScript

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

Parser combinators

Build parsers from grammars

See also