- fix: the shortcut for RUN/CONSOLE is &*, not &&

- fix: don't be confused about the token to be completed if the
       command line has trailing whitspaces

- fix: don't crash if READ raises an error
This commit is contained in:
eknauel 2005-08-20 07:48:51 +00:00
parent 6035214d0e
commit 837bc881fa
1 changed files with 12 additions and 7 deletions

View File

@ -135,8 +135,7 @@
(let ((start-pos (current-column port)))
(read-char port)
(let read-whitspaces ((c (peek-char port))
(cursor? (and cursor-index
(= start-pos cursor-index))))
(cursor? #f))
(cond
((eof-object? c)
(lp c (if (or cursor?
@ -158,10 +157,16 @@
(define (lex-command-line cmd-line . args)
(let-optionals args
((cursor-index #f))
(lex-port
cursor-index
(make-tracking-input-port
(make-string-input-port cmd-line)))))
(with-handler
(lambda (c more)
(if (read-error? c)
(signal-syntax-error (condition-stuff c))
(more)))
(lambda ()
(lex-port
cursor-index
(make-tracking-input-port
(make-string-input-port cmd-line)))))))
;; abstract syntax
@ -323,7 +328,7 @@
(values #f tokens)
(let ((t (car tokens)))
(if (and (operator-token? t)
(member (token-token t) '(&& &)))
(member (token-token t) '(&* &)))
(values (token-token t) (cdr tokens))
(values #f tokens)))))