forked from GitHub/gf-core
matching empty string fixed
This commit is contained in:
@@ -56,10 +56,10 @@ tryMatch (p,t) = do
|
|||||||
where
|
where
|
||||||
trym p t' =
|
trym p t' =
|
||||||
case (p,t') of
|
case (p,t') of
|
||||||
|
(_,(x,Empty,y)) -> trym p (x,K [],y) -- because "" = [""] = []
|
||||||
(PV IW, _) | isInConstantForm t -> return [] -- optimization with wildcard
|
(PV IW, _) | isInConstantForm t -> return [] -- optimization with wildcard
|
||||||
(PV x, _) | isInConstantForm t -> return [(x,t)]
|
(PV x, _) | isInConstantForm t -> return [(x,t)]
|
||||||
(PString s, ([],K i,[])) | s==i -> return []
|
(PString s, ([],K i,[])) | s==i -> return []
|
||||||
(PString "",([],Empty,[])) -> return [] -- because "" = [""] = []
|
|
||||||
(PInt s, ([],EInt i,[])) | s==i -> return []
|
(PInt s, ([],EInt i,[])) | s==i -> return []
|
||||||
(PFloat s,([],EFloat i,[])) | s==i -> return [] --- rounding?
|
(PFloat s,([],EFloat i,[])) | s==i -> return [] --- rounding?
|
||||||
(PC p pp, ([], Con f, tt)) |
|
(PC p pp, ([], Con f, tt)) |
|
||||||
|
|||||||
Reference in New Issue
Block a user