projects
/
lml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3ab8846
)
r2715: Auto commit for Debian build
author
Kevin M. Rosenberg
<kevin@rosenberg.net>
Mon, 16 Sep 2002 10:11:25 +0000
(10:11 +0000)
committer
Kevin M. Rosenberg
<kevin@rosenberg.net>
Mon, 16 Sep 2002 10:11:25 +0000
(10:11 +0000)
lml.cl
patch
|
blob
|
history
diff --git
a/lml.cl
b/lml.cl
index 5aea792905d74a3ee181936700e2c4b6584b14b3..96da5827cb4231b6aa75239eca84049c91928309 100644
(file)
--- a/
lml.cl
+++ b/
lml.cl
@@
-7,7
+7,7
@@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Aug 2002
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Aug 2002
;;;;
-;;;; $Id: lml.cl,v 1.1
1 2002/09/16 10:02:14
kevin Exp $
+;;;; $Id: lml.cl,v 1.1
2 2002/09/16 10:11:25
kevin Exp $
;;;;
;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;;
;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
@@
-201,11
+201,15
@@
(html :xmlns "http://www.w3.org/1999/xhtml"
,@body)))
(html :xmlns "http://www.w3.org/1999/xhtml"
,@body)))
+(defun new-string ()
+ (make-array 1024 :fill-pointer 0 :adjustable t :element-type 'character))
+
(set-macro-character #\[
#'(lambda (stream char)
(declare (ignore char))
(let ((forms '())
(set-macro-character #\[
#'(lambda (stream char)
(declare (ignore char))
(let ((forms '())
- (curr-string (make-array 1024 :fill-pointer 0 :adjustable t :element-type 'character))
+ (curr-string (new-string))
+ (paren-level 0)
(got-comma nil))
(do ((ch (read-char stream t nil t) (read-char stream t nil t)))
((eql ch #\]))
(got-comma nil))
(do ((ch (read-char stream t nil t) (read-char stream t nil t)))
((eql ch #\]))
@@
-214,14
+218,19
@@
;; Starting top-level ,(
(progn
(push `(lml-print ,curr-string) forms)
;; Starting top-level ,(
(progn
(push `(lml-print ,curr-string) forms)
- (set
f (fill-pointer curr-string) 0
)
+ (set
q curr-string (new-string)
)
(setq got-comma nil)
(vector-push #\( curr-string)
(do ((ch (read-char stream t nil t) (Read-char stream t nil t)))
(setq got-comma nil)
(vector-push #\( curr-string)
(do ((ch (read-char stream t nil t) (Read-char stream t nil t)))
- ((
eql ch #\
)))
+ ((
and (eql ch #\)) (zerop paren-level
)))
(when (eql ch #\])
(format *trace-output* "Syntax error reading #\]")
(return nil))
(when (eql ch #\])
(format *trace-output* "Syntax error reading #\]")
(return nil))
+ (case ch
+ (#\(
+ (incf paren-level))
+ (#\)
+ (decf paren-level)))
(vector-push-extend ch curr-string))
(vector-push-extend #\) curr-string)
(let ((eval-string (read-from-string curr-string))
(vector-push-extend ch curr-string))
(vector-push-extend #\) curr-string)
(let ((eval-string (read-from-string curr-string))
@@
-231,7
+240,7
@@
(when ,res
(lml-print ,res)))
forms))
(when ,res
(lml-print ,res)))
forms))
- (set
f (fill-pointer curr-string) 0
))
+ (set
q curr-string (new-string)
))
;; read comma, then non #\( char
(progn
(unless (eql ch #\,)
;; read comma, then non #\( char
(progn
(unless (eql ch #\,)