[GNU ELPA] Peg version 1.0.2
ELPA update <[email protected]>
| Newsgroups | gmane.emacs.sources |
|---|---|
| Message-ID | <[email protected]> |
Version 1.0.2 of package Peg has just been released in GNU ELPA.
You can now find it in M-x list-packages RET.
Peg describes itself as:
=========================================
Parsing Expression Grammars in Emacs Lisp
=========================================
More at https://elpa.gnu.org/packages/peg.html
## Summary:
This package implements Parsing Expression Grammars for Emacs Lisp.
Parsing Expression Grammars (PEG) are a formalism in the spirit of
Context Free Grammars (CFG) with some simplifications which makes
the implementation of PEGs as recursive descent parsers particularly
simple and easy to understand [Ford, Baker].
PEGs are more expressive than regexps and potentially easier to use.
This file implements the macros `define-peg-rule', `with-peg-rules', and
`peg-parse' which parses the current buffer according to a PEG.
E.g. we can match integers with:
(with-peg-rules
((number sign digit (* digit))
(sign (or "+" "-" ""))
(digit [0-9]))
(peg-run (peg number)))
or
(define-peg-rule digit ()
[0-9])
(peg-parse (number sign digit (* digit))
## Recent NEWS:
Since 1.0.1:
- Use OClosures to represent PEG rules when available, and let cl-print
display their source code.
- New PEX form (with RULES PEX...).
- Named rulesets.
- You can pass arguments to rules.
- New `funcall' rule to call rules indirectly (e.g. a peg you received
as argument).
Version 1.0:
- New official entry points `peg` and `peg-run`.