Skip to content

Commit

Permalink
Merge pull request #18895 from JuliaLang/jb/nofilename
Browse files Browse the repository at this point in the history
tiny fix to avoid `push_loc` nodes in IR for no filename
  • Loading branch information
JeffBezanson authored Oct 15, 2016
2 parents 8a376a0 + 0a3398d commit 3d400f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3061,7 +3061,7 @@ f(x) = yt(x)
;; only possible returned values.
(define (compile-body e vi lam)
(let ((code '())
(filename #f)
(filename 'none)
(first-line #t)
(rett #f)
(arg-map #f) ;; map arguments to new names if they are assigned
Expand Down
8 changes: 8 additions & 0 deletions test/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -823,3 +823,11 @@ end
@test parse("typealias a (Int)") == Expr(:typealias, :a, :Int)
@test parse("typealias b (Int,)") == Expr(:typealias, :b, Expr(:tuple, :Int))
@test parse("typealias Foo{T} Bar{T}") == Expr(:typealias, Expr(:curly, :Foo, :T), Expr(:curly, :Bar, :T))

# don't insert push_loc for filename `none` at the top level
let ex = expand(parse("""
begin
x = 1
end"""))
@test !any(x->(x == Expr(:meta, :push_loc, :none)), ex.args)
end

0 comments on commit 3d400f9

Please sign in to comment.