[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNU ELPA] Peg version 1.0.1
From: |
ELPA update |
Subject: |
[GNU ELPA] Peg version 1.0.1 |
Date: |
Sun, 31 Mar 2024 05:47:52 -0400 |
Version 1.0.1 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`.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNU ELPA] Peg version 1.0.1,
ELPA update <=