File tree 2 files changed +17
-12
lines changed
2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -477,6 +477,8 @@ jl_value_t *jl_parse_next(void)
477
477
if (c == FL_EOF )
478
478
return NULL ;
479
479
if (iscons (c )) {
480
+ if (cdr_ (c ) == FL_EOF )
481
+ return NULL ;
480
482
value_t a = car_ (c );
481
483
if (isfixnum (a )) {
482
484
jl_lineno = numval (a );
Original file line number Diff line number Diff line change 181
181
(set! *ts-stack* (cdr *ts-stack*)))
182
182
183
183
(define (jl-parser-next )
184
- (skip-ws-and-comments (ts:port current-token-stream))
185
- ( let ((lineno (input-port-line (ts:port current-token-stream))) )
186
- ( let ((e (parser-wrap ( lambda ( )
187
- (julia-parse current-token-stream) ))))
188
- ( if ( eof-object? e)
189
- e
190
- ( cons lineno
191
- (parser-wrap
192
- (lambda ()
193
- ( if ( and ( pair? e) ( or ( eq? ( car e) 'error )
194
- ( eq? ( car e) 'continue )) )
184
+ (let* ((err (parser-wrap
185
+ ( lambda ( )
186
+ (skip-ws-and-comments (ts:port current-token-stream)))) )
187
+ (lineno (input-port-line (ts:port current-token-stream))))
188
+ ( cons lineno
189
+ ( if ( pair? err)
190
+ err
191
+ (parser-wrap
192
+ (lambda ()
193
+ ( let ((e (julia-parse current-token-stream)) )
194
+ ( if ( eof-object? e )
195
195
e
196
- (expand-toplevel-expr e)))))))))
196
+ (if (and (pair? e) (or (eq? (car e) 'error )
197
+ (eq? (car e) 'continue )))
198
+ e
199
+ (expand-toplevel-expr e))))))))))
197
200
198
201
; expand a piece of raw surface syntax to an executable thunk
199
202
(define (jl-expand-to-thunk expr )
You can’t perform that action at this time.
0 commit comments