Skip to content

Commit

Permalink
store location of loop boundary
Browse files Browse the repository at this point in the history
Since lowering always inserts gotos and other instructions after loop
bodies, this allows debuggers to give a more useful location for these
instructions.

fixes JuliaDebug/JuliaInterpreter.jl#485
  • Loading branch information
simeonschaub committed Aug 10, 2021
1 parent c2b4b38 commit ad132fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1376,14 +1376,14 @@
(if (eq? word 'quote)
(list 'quote blk)
blk))))
((while) (begin0 (list 'while (parse-cond s) (parse-block s))
((while) (begin0 (list 'while (parse-cond s) (append (parse-block s) (list (line-number-node s))))
(expect-end s word)))
((for)
(let* ((ranges (parse-comma-separated-iters s))
(body (parse-block s)))
(expect-end s word)
`(for ,(if (length= ranges 1) (car ranges) (cons 'block ranges))
,body)))
,(append body (list (line-number-node s))))))

((let)
(let ((binds (if (memv (peek-token s) '(#\newline #\;))
Expand Down

0 comments on commit ad132fe

Please sign in to comment.