Throw an error when missing a single quote

We used to loop forever here because of the lack of 'eof-object?'
test!

* geesh/lexer.scm (get-single-quotation): Throw an error on unexpected
end-of-file.
This commit is contained in:
Timothy Sample 2018-11-15 21:18:07 -05:00
parent 48e122c42f
commit 91cfdac307
1 changed files with 1 additions and 0 deletions

View File

@ -365,6 +365,7 @@ next character statisfies @var{pred} (or is a newline)."
(#\'
(let loop ((chr (get-char port)) (acc '()))
(match chr
((? eof-object?) (throw 'lex-error))
(#\' `(<sh-quote> ,(list->string (reverse! acc))))
(x (loop (get-char port) (cons x acc))))))))