blob: 8820907da4096675c84b58903d1c65fd488771c0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# resyn
Literal **re**gex **syn**tax for Common Lisp.
Sample REPL session:
```lisp
* (asdf:load-system :resyn)
T
* (set-dispatch-macro-character #\# #\~ #'org.euandre.resyn:reader)
T
* (defparameter url "https://euandre.org")
URL
* (when (#~m|https?://(.*)| url)
:is-a-web-url)
:IS-A-WEB-URL
* '(#~m|https?://(.*)| url)
((LAMBDA (ORG.EUANDRE.RESYN::STR)
(ORG.EUANDRE.RESYN:MATCH "https?://(.*)" ORG.EUANDRE.RESYN::STR :ERE
:IGNORE-CASE? NIL :GLOBAL? NIL))
URL)
* (equal '(#~m/abc/ "")
'(#~/abc/ ""))
T
* (let ((term "it"))
(#~s/%(term)/%(term) (the \%term)/i "it works like a charm"))
"it (the %term) works like a charm"
T
* (#~s/(a+)(b+)/\2\1/ "aabbbb")
"bbbbaa"
T
```
WIP version, with some FIXME markers spread throughout the code, and no
documentation yet.
|