1
0
forked from GitHub/gf-core

regular expression patterns

This commit is contained in:
aarne
2006-01-07 14:39:40 +00:00
parent 16a4868efa
commit 69e1668f16
18 changed files with 173 additions and 137 deletions

View File

@@ -509,6 +509,9 @@ term2patt trm = case termForm trm of
Ok ([], Cn (IC "@"), [Vr a,b]) -> do
b' <- term2patt b
return (PAs a b')
Ok ([], Cn (IC "-"), [a]) -> do
a' <- term2patt a
return (PNeg a')
Ok ([], Cn (IC "*"), [a]) -> do
a' <- term2patt a
return (PRep a')
@@ -540,6 +543,7 @@ patt2term pt = case pt of
PSeq a b -> appc "+" [(patt2term a), (patt2term b)] --- an encoding
PAlt a b -> appc "|" [(patt2term a), (patt2term b)] --- an encoding
PRep a -> appc "*" [(patt2term a)] --- an encoding
PNeg a -> appc "-" [(patt2term a)] --- an encoding
redirectTerm :: Ident -> Term -> Term