If there are whitespaces before EOF and the command-line is
incomplete, make a TO-COMPLETE record
This commit is contained in:
parent
10821ee8dd
commit
dcfe19b989
|
@ -132,12 +132,23 @@
|
|||
(let ((token (lex-operator cursor-index port)))
|
||||
(lp (peek-char port) (cons token tokens))))
|
||||
((char-set-contains? char-set:whitespace c)
|
||||
(let ((pos (current-column port)))
|
||||
(let ((start-pos (current-column port)))
|
||||
(read-char port)
|
||||
(lp (peek-char port)
|
||||
(if (and cursor-index (= cursor-index pos))
|
||||
(cons (make-empty-to-complete pos) tokens)
|
||||
tokens))))
|
||||
(let read-whitspaces ((c (peek-char port))
|
||||
(cursor? (= start-pos cursor-index)))
|
||||
(cond
|
||||
((eof-object? c)
|
||||
(lp c (if (or cursor?
|
||||
(= (current-column port) cursor-index))
|
||||
(cons (make-empty-to-complete cursor-index)
|
||||
tokens)
|
||||
tokens)))
|
||||
((char-set-contains? char-set:whitespace c)
|
||||
(read-char port)
|
||||
(read-whitspaces (peek-char port)
|
||||
(or cursor?
|
||||
(= (current-column port) cursor-index))))
|
||||
(else (lp c tokens))))))
|
||||
(else
|
||||
(let ((token (lex-token cursor-index port)))
|
||||
(lp (peek-char port) (cons token tokens)))))))
|
||||
|
|
Loading…
Reference in New Issue