2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,4 +1,44 @@
|
|||
$ txr -c '@(do (print (read)) (put-line ""))'
|
||||
((data "quoted data" 123 4.5) <- input from TTY
|
||||
(data (!@# (4.5) "(more" "data)")))
|
||||
((data "quoted data" 123 4.5) (data (! (sys:var #) (4.5) "(more" "data)"))) <- output
|
||||
@(define float (f))@\
|
||||
@(local (tok))@\
|
||||
@(cases)@\
|
||||
@{tok /[+\-]?\d+\.\d*([Ee][+\-]?\d+)?/}@\
|
||||
@(or)@\
|
||||
@{tok /[+\-]?\d*\.\d+([Ee][+\-]?\d+)?/}@\
|
||||
@(or)@\
|
||||
@{tok /[+\-]?\d+[Ee][+\-]?\d+/}@\
|
||||
@(end)@\
|
||||
@(bind f @(flo-str tok))@\
|
||||
@(end)
|
||||
@(define int (i))@\
|
||||
@(local (tok))@\
|
||||
@{tok /[+\-]?\d+/}@\
|
||||
@(bind i @(int-str tok))@\
|
||||
@(end)
|
||||
@(define sym (s))@\
|
||||
@(local (tok))@\
|
||||
@{tok /[^\s()]+/}@\
|
||||
@(bind s @(intern tok))@\
|
||||
@(end)
|
||||
@(define str (s))@\
|
||||
@(local (tok))@\
|
||||
@{tok /"(\\"|[^"])*"/}@\
|
||||
@(bind s @[tok 1..-1])@\
|
||||
@(end)
|
||||
@(define atom (a))@\
|
||||
@(cases)@\
|
||||
@(float a)@(or)@(int a)@(or)@(str a)@(or)@(sym a)@\
|
||||
@(end)@\
|
||||
@(end)
|
||||
@(define expr (e))@\
|
||||
@(cases)@\
|
||||
@/\s*/@(atom e)@\
|
||||
@(or)@\
|
||||
@/\s*\(\s*/@(coll :vars (e))@(expr e)@/\s*/@(last))@(end)@\
|
||||
@(end)@\
|
||||
@(end)
|
||||
@(freeform)
|
||||
@(expr e)@junk
|
||||
@(output)
|
||||
expr: @(format nil "~s" e)
|
||||
junk: @junk
|
||||
@(end)
|
||||
|
|
|
|||
|
|
@ -1,44 +1 @@
|
|||
@(define float (f))@\
|
||||
@(local (tok))@\
|
||||
@(cases)@\
|
||||
@{tok /[+\-]?\d+\.\d*([Ee][+\-]?\d+)?/}@\
|
||||
@(or)@\
|
||||
@{tok /[+\-]?\d*\.\d+([Ee][+\-]?\d+)?/}@\
|
||||
@(or)@\
|
||||
@{tok /[+\-]?\d+[Ee][+\-]?\d+/}@\
|
||||
@(end)@\
|
||||
@(bind f @(flo-str tok))@\
|
||||
@(end)
|
||||
@(define int (i))@\
|
||||
@(local (tok))@\
|
||||
@{tok /[+\-]?\d+/}@\
|
||||
@(bind i @(int-str tok))@\
|
||||
@(end)
|
||||
@(define sym (s))@\
|
||||
@(local (tok))@\
|
||||
@{tok /[^\s()]+/}@\
|
||||
@(bind s @(intern tok))@\
|
||||
@(end)
|
||||
@(define str (s))@\
|
||||
@(local (tok))@\
|
||||
@{tok /"(\\"|[^"])*"/}@\
|
||||
@(bind s @[tok 1..-1])@\
|
||||
@(end)
|
||||
@(define atom (a))@\
|
||||
@(cases)@\
|
||||
@(float a)@(or)@(int a)@(or)@(str a)@(or)@(sym a)@\
|
||||
@(end)@\
|
||||
@(end)
|
||||
@(define expr (e))@\
|
||||
@(cases)@\
|
||||
@/\s*/@(atom e)@\
|
||||
@(or)@\
|
||||
@/\s*\(\s*/@(coll :vars (e))@(expr e)@/\s*/@(last))@(end)@\
|
||||
@(end)@\
|
||||
@(end)
|
||||
@(freeform)
|
||||
@(expr e)@junk
|
||||
@(output)
|
||||
expr: @(format nil "~s" e)
|
||||
junk: @junk
|
||||
@(end)
|
||||
@/\s*\(\s*/@(coll :vars (e))@(expr e)@/\s*/@(last))@(end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue