MacroTools.jl icon indicating copy to clipboard operation
MacroTools.jl copied to clipboard

MacroTools provides a library of tools for working with Julia code and expressions.

Results 41 MacroTools.jl issues
Sort by recently updated
recently updated
newest added

`splitdef` fails with an assertion on an anonymous function with a single varargs argument: ```julia julia> splitdef(Meta.parse(" (args...) -> 0 ")) ERROR: ArgumentError: Not a function definition: :(args...->begin #= none:1...

JET.jl rightly notes that this function will error if a `missing` appears inside an expression, and we try to bind it. This is certainly an edge case (and clearly no-one's...

I noticed that the latest version of the currently deployed docs is 0.5.4, however, the latest tag is 0.5.6 and the latest version of this package is 0.5.9. Is there...

Similar to what was noted in https://github.com/FluxML/MacroTools.jl/issues/40#issuecomment-357466077, ```julia julia> @capture :(myvariable = 2) (lhs_Symbol = rhs_) true julia> @capture :(myvariable = 2) (lhs_Symbol = rhs_) | someotherpat false julia> @capture...

This PR adds new methods `splitargdef` and `combineargdef` (in addition to existing `splitarg` and `combinearg`) that use dictionaries as an interface. The dict interface more completely expresses corner cases, as...

```julia module MM using MacroTools: @capture @capture(:(x=2), _lhs = _rhs) end > UndefVarError: MacroTools not defined ``` It works if I import MacroTools. In my code, I usually fix this...

``` help?> MacroTools.isdef Test for function definition expressions. julia> MacroTools.isdef(:(f() = 3)) true julia> MacroTools.isdef(:(f())) true julia> MacroTools.isdef(:ix) true ```

`rmlines` would be more useful it it worked recursively. ``` rmlines(Meta.parse(""" begin begin begin end end end""")) quote begin #= none:3 =# begin #= none:4 =# end end end ```...

This PR fixes issues involved with the syntaxes to specify expression types. Currently, `@capture` and `@match` can't distinguish between their syntax to specify a `:head` of `Expr` and a variable...