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