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

Match types when slurping

Open GregPlowman opened this issue 8 years ago • 0 comments

I couldn't work out how to match types when slurping with __:

block = quote
    begin
        north
        east
        south
        west
    end
end

Untyped slurping works:

symbols = @match block begin
    begin
        s__
    end => s
end

but I wanted to match only Symbols, so I tried this but didn't work:

symbols = @match block begin
    begin
        s__Symbol
    end => s
end

GregPlowman avatar Feb 10 '17 03:02 GregPlowman