summaryrefslogtreecommitdiff
path: root/cl-forth.lisp
diff options
context:
space:
mode:
authormRnea <akannemre@gmail.com>2024-08-19 21:37:24 +0300
committermRnea <akannemre@gmail.com>2024-08-19 21:37:24 +0300
commit4367febcd70e9bb7538cd168917ec3c7d3b0a6f3 (patch)
treeb399f89c5cc90c793b2ef50bce9307e4d7befb09 /cl-forth.lisp
parent86dbe8eb0abe2a2d5f0f687ff190c4e9f547d126 (diff)
add target option to command line, fix | when its last char on line
Diffstat (limited to 'cl-forth.lisp')
-rw-r--r--cl-forth.lisp12
1 files changed, 6 insertions, 6 deletions
diff --git a/cl-forth.lisp b/cl-forth.lisp
index faa48a6..ec2a0f3 100644
--- a/cl-forth.lisp
+++ b/cl-forth.lisp
@@ -46,12 +46,12 @@
(let ((flag t))
(cond ((char= #\| next-char)
(read-char line-stream)
- (if (char-equal #\Space
- (peek-char nil line-stream nil nil))
- (collect (make-token :pipe line-num col :identifier)
- into tokens)
- (progn (unread-char #\| line-stream)
- (setf flag nil))))
+ (let ((peeked (peek-char nil line-stream nil nil)))
+ (if (or (not peeked) (char-equal #\Space peeked))
+ (collect (make-token :pipe line-num col :identifier)
+ into tokens)
+ (progn (unread-char #\| line-stream)
+ (setf flag nil)))))
((char= #\Space next-char) (read-char line-stream))
((char= #\; next-char) ;; and not in string
(finish))