fcard / ExpressionPatterns.jl

Match, Destructure and Dispatch on expressions.
Other
8 stars 5 forks source link

Pattern matching failture with simple slurps #33

Open fcard opened 7 years ago

fcard commented 7 years ago
julia> @letds [*{x}, a, *{y}, 10] = :[1,2,3,4,5,6,7,8,9,10] (x,y)
ERROR: ArgumentError: pattern`([(:*){x}, a, (:*){y}, 10],)` cannot be matched with ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],)

What the! I was sure those sort of simple things were working before. How am I to brag about having a Regex for Exprs when I can't even do this! Hmm, Regex for Exprs, maybe I should branch that off in its own package, that could interest people more. (it won't) MetaRegex.jl, that surely will catch some eyes. (pffffff)

Also, slurp, what a word to keep saying over and over. Once more I blame it all on Mike Innes, he introduced me to the term! Curse you Mike Innes for making me uncomfortable discussing my package with myself! (moreso!)

fcard commented 7 years ago

Related to GenericGreedySlurp followed by another slurp, hmhm. It's probably not wanting to backtrack when it should.

... God that code is a mess, I will have to resolve THAT before fixing this. I am getting into issue dependency hell here...

Qiyamah commented 7 years ago

Do you have an estimate for solving the problem? Because I had a very similar package doing regex on expr with trees and state machines, now i am planning to abandon it and use yours.

fcard commented 7 years ago

I have a solution in mind and a good chunk of the code done. I don't have an exact estimate but there shouldn't be too much work left, I just need to find the time to finish it.