cute-jumper / parsec.el Goto Github PK
View Code? Open in Web Editor NEWA parser combinator library for Emacs Lisp, similar to Haskell's Parsec library.
A parser combinator library for Emacs Lisp, similar to Haskell's Parsec library.
parsec-query is a Lisp macro in ‘parsec.el’.
(parsec-query PARSER &rest ARGS)
Get an alternative return value of the PARSER specified by the ARGS.
The args can be in the following forms:
:beg --> return the point before applying the PARSER
:end --> return the point after applying the PARSER
:nil --> return nil
:groups N --> return Nth group for ‘parsec-re’.
As far as I can see only 1 argument makes sense in the ARGS position,
and will be used. Given the documentation I expected all of the args to
be used e.g.
(cl-query (xxx...) :beg :end) would return :beg and :end but only :beg
is returned.
Here's a much-simplified testcase:
(defun test/some-spaces ()
(parsec-many (parsec-ch ?\s)))
(defun test/blank-line ()
(parsec-optional (test/some-spaces))
(parsec-newline))
(parsec-with-input "
last line
"
(parsec-many (test/blank-line)))
This should return a list of three strings, each containing a newline character, but instead it returns parsec-newline's error when it sees the l
.
Hi!
I get (invalid-function parsec-and) from parsec-try.
Got it down to the fact that code gets compiled, but there's more to be uncovered, I think.
The attached file demonstrates the problem.
I can convert it to an ert test if you want me to, although there will be an additional function.
For the moment I work around the packaging problem by adding
;; -*-no-byte-compile: t; -*-
to the file doing the parsing.
Bye,
Kero.
The latest released version, 0.1.3, dates from 2016. Please consider tagging a newer version so that the latest fixes show up in, e.g., MELPA Stable.
Thanks.
hi wanted to pack your lib. could you provide any foss license?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.