summaryrefslogtreecommitdiff
path: root/src/GF/Grammar/PatternMatch.hs
diff options
context:
space:
mode:
authorpeb <unknown>2005-02-18 18:21:06 +0000
committerpeb <unknown>2005-02-18 18:21:06 +0000
commit9568d7a844ba6a1872a8e8f6ef002860057e62ab (patch)
tree9e25c6ed62e48101a2782d5fb8dcba68462dc613 /src/GF/Grammar/PatternMatch.hs
parent1c4f025320900897ae3acdab6982f7d595b98dd1 (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Grammar/PatternMatch.hs')
-rw-r--r--src/GF/Grammar/PatternMatch.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/GF/Grammar/PatternMatch.hs b/src/GF/Grammar/PatternMatch.hs
index 88e0f0441..2fcf4440a 100644
--- a/src/GF/Grammar/PatternMatch.hs
+++ b/src/GF/Grammar/PatternMatch.hs
@@ -1,18 +1,21 @@
----------------------------------------------------------------------
-- |
--- Module : (Module)
--- Maintainer : (Maintainer)
+-- Module : PatternMatch
+-- Maintainer : AR
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date $
--- > CVS $Author $
--- > CVS $Revision $
+-- > CVS $Date: 2005/02/18 19:21:13 $
+-- > CVS $Author: peb $
+-- > CVS $Revision: 1.5 $
--
--- (Description of the module)
+-- pattern matching for both concrete and abstract syntax. AR -- 16\/6\/2003
-----------------------------------------------------------------------------
-module PatternMatch where
+module PatternMatch (matchPattern,
+ testOvershadow,
+ findMatch
+ ) where
import Operations
import Grammar
@@ -23,8 +26,6 @@ import PrGrammar
import List
import Monad
--- pattern matching for both concrete and abstract syntax. AR -- 16/6/2003
-
matchPattern :: [(Patt,Term)] -> Term -> Err (Term, Substitution)
matchPattern pts term =
@@ -105,7 +106,7 @@ varsOfPatt p = case p of
PT _ q -> varsOfPatt q
_ -> []
--- to search matching parameter combinations in tables
+-- | to search matching parameter combinations in tables
isMatchingForms :: [Patt] -> [Term] -> Bool
isMatchingForms ps ts = all match (zip ps ts') where
match (PC c cs, (Cn d, ds)) = c == d && isMatchingForms cs ds