diff --git a/src/julia-parser.scm b/src/julia-parser.scm index 25ed1cbdc643e..c34e1103b0fa2 100644 --- a/src/julia-parser.scm +++ b/src/julia-parser.scm @@ -705,12 +705,12 @@ (define (parse-block s (down parse-eq)) (parse-Nary s down '(#\newline #\;) 'block - '(end else elseif catch finally) #t)) + '(end else elseif catch finally) #t)) ;; ";" at the top level produces a sequence of top level expressions (define (parse-stmts s) (let ((ex (parse-Nary s (lambda (s) (parse-docstring s parse-eq)) - '(#\;) 'toplevel '(#\newline) #t))) + '(#\;) 'toplevel '(#\newline) #t))) ;; check for unparsed junk after an expression (let ((t (peek-token s))) (if (not (or (eof-object? t) (eqv? t #\newline) (eq? t #f))) @@ -2077,7 +2077,12 @@ (define (parse-docstring s production) (let* ((ex (production s))) - (if (and (doc-string-literal? ex) (not (closing-token? (peek-token s)))) + (if (and (doc-string-literal? ex) + (let loop ((t (peek-token s))) + (cond + ((closing-token? t) #f) + ((newline? t) (take-token s) (loop (peek-token s))) + (else #t)))) `(macrocall (|.| Base (quote @doc)) ,ex ,(production s)) ex)))