drewc / smug Goto Github PK
View Code? Open in Web Editor NEWSuper Monadic Über Go-into : parser combinators for Common Lisp
Home Page: http://smug.drewc.ca/
License: MIT License
Super Monadic Über Go-into : parser combinators for Common Lisp
Home Page: http://smug.drewc.ca/
License: MIT License
This is an issue on ECL which makes strings base-string unless they contain non base-chars; for example (type-of "") => (SIMPLE-ARRAY BASE-CHAR (0))
The fix is fairly easy; you can either specialize input-rest for base-string, or add this to the beginning of input-rest for cl:string:
(when (not (equal (array-element-type input)
(upgraded-array-element-type 'character)))
(setf input
(make-array (length input) :element-type 'character
:initial-contents input)))
Hi!
This is a cool project, I've enjoyed playing with it.
I was trying it out as an alternative for a parser I'm putting together for a project of my own. I need the ability to identify the line number and context of a parser failure. I don't see any way to do that off hand with Smug. Is that possible?
Thanks!
When :limit is not passed, it still tries to decrement it, causing an error for (1- nil).
Changling line 199 of smug.lisp to this fixes the problem.
(xs (at-least (1- n) parser :limit (and limit (1- limit)))))
Please consider adding :description, :author and :license information to your ASDF system. This will greatly help Quicklisp users and make it easier for them to report bugs.
More information:
http://blog.quicklisp.org/2015/05/looking-for-more-metadata.html
https://www.quicklisp.org
As going through the section ".SATISFIES : the parser predicate" in the tutorial. Then I have the input of the predicate digit-char-p
to make the CLOSURE for .satisfies
, see the below.
(setq ss (.bind (.item)
(lambda (x)
(if (apply #'digit-char-p x)
(.identity x)
(.fail)))))
Then call (funcall ss "1 and")
,then it evaluation aborted. See the following backtrace
0: ((LAMBDA (X)) #\1)
1: ((LAMBDA (INPUT) :IN .BIND) "1 and")
2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (FUNCALL SS "1 and") #<NULL-LEXENV>)
3: (EVAL (FUNCALL SS "1 and"))
I looked around but couldn't find a license for this. What (if any) license is it released under?
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.