String-parsing in Nix: Difference between revisions
imported>Milahu add parsers: xml, mix.lock + text + format |
mNo edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
Some string parsers written in Nix | Some string parsers written in Nix | ||
=== | === YAML === | ||
* https://github.com/DavHau/fromYaml | * https://github.com/DavHau/fromYaml | ||
* https://github.com/arcnmx/nixexprs/blob/master/lib/from-yaml.nix | * https://github.com/arcnmx/nixexprs/blob/master/lib/from-yaml.nix | ||
=== | === TOML === | ||
* 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/nprindle/nix-parsec/pull/6 | ||
Line 36: | Line 36: | ||
* https://github.com/nprindle/nix-parsec/pull/4 | * https://github.com/nprindle/nix-parsec/pull/4 | ||
=== | === Arithmetic === | ||
* https://github.com/nprindle/nix-parsec/tree/master/examples/arithmetic | * https://github.com/nprindle/nix-parsec/tree/master/examples/arithmetic | ||
Line 83: | Line 83: | ||
* 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]) | ||
[[Category:nix]] | |||
[[Category:Development]] |
Latest revision as of 20:43, 24 April 2024
String parsers
Some string parsers written in Nix
YAML
TOML
XML
yarn.lock
Lockfile for 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/npmlock2nix/pull/29
- https://github.com/nprindle/nix-parsec/pull/3
mix.lock
Lockfile for mix, a package manager for Erlang
Lisp
- https://github.com/utdemir/nixlisp/blob/main/nix/parser.nix
- https://github.com/nprindle/nix-parsec/pull/4
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
- https://github.com/nprindle/nix-parsec - API is similar to megaparsec in Haskell
Grammars
- antlr https://github.com/antlr/grammars-v4
- tree-sitter https://github.com/search?q=tree-sitter+grammar
See also
- Add an Earley parser builtin (nix#1491)
- purenix - compile PureScript to Nix
- String parsing in other Functional Programming Languages
- String parsing in Haskell (google)