refinements of the parser

parent 9f3bc4ee
......@@ -23,7 +23,7 @@
f-reg f-reg! f-reg-pr
f-false f-true f-id
f-eof f-nl f-nl! f-nl-pr
f-cons f-list f-cons* ff? ff* ff+ f-out
f-cons f-list f-append f-cons* ff? ff* ff+ f-out
parse parse-no-clear
*current-file-parsing*
*translator* *whitespace*
......@@ -196,7 +196,8 @@
chtr f-id f-pk s-tag s-tag! spr-tag
s-seq s-and s-and! s-and!! s-and-i s-or s-or-i
f-or f-or! f-and f-and! f-seq f? f+ f* ff? ff+ ff*
f-cons f-list f-cons* mk-token p-freeze parse f-out
f-cons f-list f-cons* f-append mk-token p-freeze parse
f-out
f-true f-false f-nl ss f< f> fn f-eof
<s-match> <s-lambda> mk-simple-token f-clear-body
f-char f-char! pr-char f-reg f-reg! pr-reg
......@@ -438,7 +439,7 @@
(<let> ((val (hash-ref (fluid-ref *freeze-map*)
(cons* N M tok) #f))
(fr (<newframe>)))
(if (not val)
(if (not val)
(<let> ((n N) (m M))
(<or>
(<and>
......@@ -453,7 +454,7 @@
(<code>
(<unwind> fr)
(hash-set! (fluid-ref *freeze-map*)
(cons* n m tok) (list X XL N M XX ... val2)))
(cons* n m tok) val2))
<fail>)))
(if (pair? val)
(<apply> f-true val)
......@@ -596,6 +597,19 @@
((x y . l)
(f-cons x (apply f-list y l))))))
(define f-append
(f-wrap 'f-list
(case-lambda
((x) x)
((f g)
(<p-lambda> (c)
(.. (c1) ((ss f) c))
(.. (c2) ((ss g) c1))
(<p-cc> (append c1 c2))))
((x y . l)
(f-append x (apply f-append y l))))))
(define f*
(f-wrap 'f*
(lambda (x)
......@@ -701,7 +715,8 @@
chtr f-id f-pk s-tag s-tag! spr-tag
s-seq s-and s-and! s-and!! s-and-i s-or s-or-i
f-or f-or! f-and f-and! f-seq f? f+ f* ff? ff+ ff*
f-cons f-list f-cons* mk-token p-freeze parse f-out
f-cons f-list f-cons* f-append
mk-token p-freeze parse f-out
f-true f-false f-nl ss f< f> fn f-eof
<s-match> <s-lambda> mk-simple-token f-clear-body
f-char f-char! pr-char f-reg f-reg! pr-reg
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment