Skip to content

Commit aa79ae4

Browse files
committed
fix #32467, parsing macro on for inside do inside call (#32476)
(cherry picked from commit b74ef05)
1 parent 8dd88f3 commit aa79ae4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/julia-parser.scm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,6 @@
216216
`(with-bindings ((whitespace-newline #t))
217217
,@body))
218218

219-
(define-macro (without-whitespace-newline . body)
220-
`(with-bindings ((whitespace-newline #f))
221-
,@body))
222-
223219
;; --- lexer ---
224220

225221
(define (newline? c) (eqv? c #\newline))
@@ -1546,7 +1542,7 @@
15461542
(define (parse-do s)
15471543
(with-bindings
15481544
((expect-end-current-line (input-port-line (ts:port s))))
1549-
(without-whitespace-newline
1545+
(with-normal-context
15501546
(let ((doargs (if (memv (peek-token s) '(#\newline #\;))
15511547
'()
15521548
(parse-comma-separated s parse-range))))

test/syntax.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,3 +1875,14 @@ x32499 = begin
18751875
S32499(x=2)
18761876
end
18771877
@test x32499 == 2
1878+
1879+
# issue #32467
1880+
let f = identity(identity() do
1881+
x = 0
1882+
@inbounds for i = 1:2
1883+
x += i
1884+
end
1885+
x
1886+
end)
1887+
@test f() == 3
1888+
end

0 commit comments

Comments
 (0)