add target option to command line, fix | when its last char on line

This commit is contained in:
2024-08-19 21:37:24 +03:00
parent 86dbe8eb0a
commit 4367febcd7
2 changed files with 24 additions and 11 deletions

View File

@@ -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))