Skip to content

Commit

Permalink
Merge pull request #355 from JuliaLang/jn/macro-sourcelocation
Browse files Browse the repository at this point in the history
Compat flag for adding source location argument to macros (JuliaLang/julia#21746)
  • Loading branch information
vtjnash authored May 12, 2017
2 parents 594fafc + 90d06f7 commit d8a1c04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ for `HermOrSym` such that using the new methods are backward compatible.

* Single-argument `min`, `max` and `minmax` are defined on 0.4.

* The `Expr(:macrocall)` has an extra initial argument `__source__`, which can be tested for with `Compat.macros_have_sourceloc`.

## New types

Currently, no new exported types are introduced by Compat.
Expand Down
3 changes: 3 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1494,4 +1494,7 @@ end

include("to-be-deprecated.jl")

# https://github.com/JuliaLang/julia/pull/21746
const macros_have_sourceloc = VERSION >= v"0.7-" && length(:(@test).args) == 2

end # module Compat

0 comments on commit d8a1c04

Please sign in to comment.