Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, I've implemented extended dynamic wrapping, on which we takled earlier on email #22

Open
wants to merge 101 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
f134bb2
Smart context sensitivity, first try.
mabragor Apr 25, 2013
4000583
Basic dynamic wrapping done, tests written.
mabragor Apr 25, 2013
97282fa
Added {m,n} repetitions, a la that are present in regexps, but M and …
mabragor Apr 25, 2013
f357196
choise -> choice + added cond operator with tests
mabragor Apr 26, 2013
9d3a452
Comment compiler macro as it does not work as intended.
mabragor Apr 28, 2013
833aaa1
Take context into account when memoising results.
mabragor Apr 28, 2013
b08d38a
Merge branch 'master' of https://github.com/mabragor/esrap
mabragor Apr 28, 2013
a2892f3
Add followed-by-not-gen and preceded-by-not-gen operators
mabragor Apr 28, 2013
0da60c1
Added 'first' operator
mabragor Apr 28, 2013
5a63c9e
Described new syntax in README
mabragor Apr 28, 2013
e993d64
Towards multidimensional contexts.
mabragor Apr 29, 2013
f7ab8c2
Multidimensional contexts done.
mabragor May 3, 2013
f73e4f5
In FOLLOWED-BY-NOT-GEN EOF can be specified
mabragor May 4, 2013
347f262
- Added tag clause
mabragor May 4, 2013
52f95b7
Add explanation of the idea of liquid branch
mabragor May 31, 2013
cbde7fb
A few first strokes
mabragor Jun 1, 2013
d09770e
Liquefication starts
mabragor Oct 23, 2013
66c2213
First version of esrap-liquid, that passes at least some trivial tests
mabragor Nov 8, 2013
59e2197
Make tests involving MATCH-START and MATCH-END working
mabragor Nov 8, 2013
d7ba99b
Fix greedy repetitions of zero-length-matching rules
mabragor Nov 8, 2013
73930cf
Add back CHARACTER-RANGES, test dynamic context wrapping.
mabragor Nov 8, 2013
2ffc49a
Enable some context sensitivity tests. Fix STRING rule. Fix TIMES rule.
mabragor Nov 8, 2013
0365c65
Towards temporary rules in PARSE
mabragor Nov 8, 2013
529ff15
Make PARSE compile temporary top-level rule on the fly
mabragor Nov 9, 2013
d1a2701
Change name of system to ESRAP-LIQUID, add COPYING
mabragor Nov 12, 2013
495d063
Make all but one test enabled and working
mabragor Nov 13, 2013
1c2fea1
Enable and correct the last test
mabragor Nov 13, 2013
5ff2151
Rewrite README, so it corresponds to new state of things
mabragor Nov 13, 2013
b85ac1b
Integrate PARSE into DEFMACRO inheritance framework
mabragor Nov 14, 2013
9e52720
Add esrap environments
mabragor Nov 14, 2013
bfee872
Adapt example-sexp.lisp to liquid esrap
mabragor Nov 18, 2013
f619677
Adapt example-symbol-table.lisp to liquid
mabragor Nov 18, 2013
41f6ea9
Adapt example-very-context-sensitive.lisp to liquid
mabragor Nov 18, 2013
ef7fdb6
Fixed definition of esrap environment
mabragor Nov 27, 2013
0d670f0
Add support for testing of EOF and export FAIL-PARSE
mabragor Nov 27, 2013
8434fb0
Fix ability to define rules as closures
mabragor Nov 28, 2013
f866ff1
Fix a bug with advancement of position in ? macro
mabragor Nov 30, 2013
148f266
Make non-consuming negation compatible with TEXT
mabragor Nov 30, 2013
b56b59f
Add concept to readme
mabragor Jan 25, 2014
4d9b934
First cut on capturing
mabragor Jan 25, 2014
c8c998c
More tests on C! capturing
mabragor Jan 27, 2014
e6ac87b
Add proper parsing of arguments of rules
mabragor Feb 18, 2014
361fea8
Add tests for &OPTIONAL arguments to rules
mabragor Feb 25, 2014
0e20f4c
Adapt to new interface of CL-INDETERMINISM
mabragor Mar 28, 2014
cc0dfea
Use alexandria's make-keyword instead of home-brewed keywordicate
mabragor Oct 12, 2014
91ab18b
Fix recursive erasure of c-bang-symbols
mabragor Dec 14, 2014
8e08249
Explicitly isolated formatting FAIL-PARSE macro
mabragor Jan 26, 2015
72fbcdd
Start work on stream-based parsing
mabragor Feb 9, 2015
9c12ebe
First sketch of buffer we need for stream parsing
mabragor Feb 14, 2015
d407c06
Add first cut on iteration over strings
mabragor Feb 14, 2015
6811478
Add test for caching iterator
mabragor Feb 14, 2015
8cbab9d
Remove debug output
mabragor Feb 14, 2015
3a223d4
Fix naming of REWIND in tests
mabragor Feb 14, 2015
4259496
Add context-nonsensitive optimization
mabragor Feb 14, 2015
9b985ae
Debugging streaming
mabragor Feb 15, 2015
2a7ad39
Fix bug with TIMES
mabragor Feb 15, 2015
3b4391d
Make basic tests work
mabragor Feb 15, 2015
3b7e2ab
Add abc-or-def test
mabragor Feb 17, 2015
e14b170
Add nice debugging output on demand
mabragor Feb 17, 2015
4c33d79
Towards tracing error in position increment
mabragor Feb 17, 2015
b247d16
Add triple a test
mabragor Feb 17, 2015
40b674b
Merge branch 'streaming' of https://github.com/mabragor/esrap-liquid …
mabragor Feb 17, 2015
9552eb7
Make smoke tests work
mabragor Feb 17, 2015
407466b
All tests, that were left, work, removed MATCH-START and MATCH-END
mabragor Feb 17, 2015
9344274
Fix carriage noreturn in <-
mabragor Feb 17, 2015
77fc30e
Fix one more in bug in <-
mabragor Feb 17, 2015
b527431
Rewrote README positively, added about streaming
mabragor Feb 18, 2015
38478b9
Add cl-interpol dependency
mabragor Feb 18, 2015
77d14c8
Make FAIL-PARSE and FAIL-PARSE-FORMAT accept usual string syntax
mabragor Mar 27, 2015
28cf120
Export FAIL-PARSE-FORMAT
mabragor Mar 27, 2015
f547447
Fix interning when *print-case* is not :upcase.
orivej Jun 29, 2015
b7e23fa
Merge pull request #4 from orivej/master
mabragor Jul 13, 2015
ac6155e
Add MOST-FULL-PARSE macro
mabragor Sep 21, 2015
2892816
Merge branch 'master' of https://github.com/mabragor/esrap-liquid
mabragor Sep 21, 2015
37c286d
Break everything except basic functionality
mabragor Mar 25, 2016
abdc8d1
Fix all tests except capturing
mabragor Mar 25, 2016
81f6130
Don't depend on DEFMACRO-ENHANCE and other implementation-specific pa…
mabragor Mar 25, 2016
67b7c63
Towards cap and recap
mabragor Mar 25, 2016
900599d
Fix capturing
mabragor Mar 26, 2016
04b115c
Delete unused remnants of original esrap
mabragor Mar 26, 2016
1554700
Bring examples to new notation
mabragor Mar 26, 2016
1ff729c
Shorten readme
mabragor Mar 26, 2016
cd6e250
Add section on API change
mabragor Mar 26, 2016
e8020d4
Export MAYBE-WRAP-IN-DESCENT utility function
mabragor Mar 26, 2016
f1a782a
Fix ESRAP-ENV definition
mabragor Mar 26, 2016
26e4df2
Accurately propagate cap values upwards
mabragor Mar 28, 2016
639f786
Add mainly-non-context
mabragor Mar 29, 2016
e57a86a
Add test about hinting
mabragor Mar 30, 2016
2cbb532
Add parse-stream function
mabragor Apr 5, 2016
c7732cf
Write about parse-stream in readme
mabragor Apr 5, 2016
0edc73b
More tests for correct esrap-env
mabragor Apr 5, 2016
0f15634
First cut on more intelligible error reporting
mabragor Apr 5, 2016
47e83aa
Add iter's last text
mabragor Apr 5, 2016
99ccd24
Add mood to log only essential fail-parses
mabragor Apr 5, 2016
9311ea3
Fix typo in readme.
bon Jun 18, 2016
4d4e31f
Merge pull request #5 from bon/master
mabragor Jun 18, 2016
acf4ea3
Add LIST-V, PROGN-V and PROG1-V macros
mabragor Jun 27, 2016
15b5d49
Merge branch 'master' of https://github.com/mabragor/esrap-liquid
mabragor Jun 27, 2016
1eb9893
Export PARSE-TOKEN-ITER in ESRAP-ENV
mabragor Oct 9, 2016
aed6a27
Towards adding iterator extensions
mabragor Oct 9, 2016
35f7855
First version of tokenizers using only hard-shrink
Oct 9, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bring examples to new notation
  • Loading branch information
mabragor committed Mar 26, 2016
commit 155470071bfc60854a8a10fe4158be5e85965881
12 changes: 5 additions & 7 deletions example-sexp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

(in-package :sexp-grammar)

(enable-read-macro-tokens)

;;; A semantic predicate for filtering out double quotes.

(defun not-doublequote (char)
Expand All @@ -29,7 +27,7 @@

(defrule string-char ()
(|| (pred #'not-doublequote character)
(list #\\ #\")))
(list (v #\\) (v #\"))))

;;; Here we go: an S-expression is either a list or an atom, with possibly leading whitespace.

Expand All @@ -40,15 +38,15 @@

(defrule magic ()
(if (eq * :use-magic)
(progn "foobar"
(progn (v "foobar")
:magic)
(fail-parse "No room for magic in this world")))

(defrule list ()
#\(
(let ((res `(,sexp ,. (times sexp))))
(v #\()
(let ((res `(,(v sexp) ,. (times sexp))))
(? whitespace)
#\)
(v #\))
res))

(defrule atom ()
Expand Down
12 changes: 6 additions & 6 deletions example-symbol-table.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
(times (postimes (pred #'alphanumericp character))))

(defrule declaration ()
(destructuring-bind (name colon type) (list name #\: type)
(destructuring-bind (name colon type) (list (v name) (v #\:) (v type))
(declare (ignore colon))
(setf (lookup name) (list name :type type))
(values)))

(defrule use ()
(let ((name name))
(let ((name (v name)))
(list :use (or (lookup name)
(error "~@<Undeclared variable: ~S.~@:>"
name)))))
Expand All @@ -59,14 +59,14 @@
(remove nil (postimes (|| scope declaration use))))

(defrule statement/ws ()
(prog1 statement (? whitespace)))
(prog1 (v statement) (? whitespace)))

(defrule scope ()
(let ((*symbol-table* (make-symbol-table *symbol-table*)))
(list* :scope (apply #'append
(progm (progn #\{ (? whitespace))
(* statement/ws)
(progn #\} (? whitespace)))))))
(progm (progn (v #\{) (? whitespace))
(times statement/ws)
(progn (v #\}) (? whitespace)))))))

(parse 'scope "{
a:int
Expand Down
8 changes: 4 additions & 4 deletions example-very-context-sensitive.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
(character-ranges (#\0 #\9)))

(defrule indent-spec-line ()
(parse-integer (text (progm (progn spaces "|")
(parse-integer (text (progm (progn (v spaces) (v "|"))
(postimes digit)
(progn "|" spaces #\newline)))))
(progn (v "|") (v spaces) (v #\newline))))))

(defrule indented-line ()
(prog1 (text (make-string indented-spaces :initial-element #\space)
(prog1 (text (make-string (v indented-spaces) :initial-element #\space)
(times (!! #\newline)))
#\newline))
(v #\newline)))

(defun more-indented-block-p (explicit-block)
(>= (caddr explicit-block)
Expand Down