diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index d6bc03091f37b..f1acb9c3250e1 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -5001,6 +5001,10 @@ f(x) = yt(x) ((≔ ⩴ ≕ :=) (error (string "unsupported assignment operator \"" (deparse (car e)) "\""))) + ;; bare :escape + ((escape) + (error (string "\"esc(...)\" used outside of macro expansion"))) + ((error) (error (cadr e))) (else diff --git a/test/syntax.jl b/test/syntax.jl index 1b630a56f84f8..c19721b5c54b3 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -3985,3 +3985,5 @@ begin end end @test f45494() === (0,) + +@test_throws "\"esc(...)\" used outside of macro expansion" eval(esc(:(const x=1)))