forked from GitHub/gf-core
String pattern handling
This commit is contained in:
@@ -416,6 +416,8 @@ inferLType gr trm = case trm of
|
|||||||
PP _ _ ps -> True --- all isConstPatt ps
|
PP _ _ ps -> True --- all isConstPatt ps
|
||||||
PR ps -> all (isConstPatt . snd) ps
|
PR ps -> all (isConstPatt . snd) ps
|
||||||
PT _ p -> isConstPatt p
|
PT _ p -> isConstPatt p
|
||||||
|
PString _ -> True
|
||||||
|
PInt _ -> True
|
||||||
_ -> False
|
_ -> False
|
||||||
|
|
||||||
inferPatt p = case p of
|
inferPatt p = case p of
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import Ident
|
|||||||
import PrGrammar (prt)
|
import PrGrammar (prt)
|
||||||
---- import PGrammar (pTrm)
|
---- import PGrammar (pTrm)
|
||||||
|
|
||||||
-- predefined function definitions. AR 12/3/2003.
|
-- predefined function type signatures and definitions. AR 12/3/2003.
|
||||||
-- Type checker looks at signatures in predefined.gf
|
|
||||||
|
---- typPredefined :: Term -> Err Type
|
||||||
|
|
||||||
appPredefined :: Term -> Term
|
appPredefined :: Term -> Term
|
||||||
appPredefined t = case t of
|
appPredefined t = case t of
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ isInConstantForm trm = case trm of
|
|||||||
Abs _ _ -> True
|
Abs _ _ -> True
|
||||||
App c a -> isInConstantForm c && isInConstantForm a
|
App c a -> isInConstantForm c && isInConstantForm a
|
||||||
R r -> all (isInConstantForm . snd . snd) r
|
R r -> all (isInConstantForm . snd . snd) r
|
||||||
|
K _ -> True
|
||||||
Alias _ _ t -> isInConstantForm t
|
Alias _ _ t -> isInConstantForm t
|
||||||
_ -> False ---- isInArgVarForm trm
|
_ -> False ---- isInArgVarForm trm
|
||||||
|
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ trp p = case p of
|
|||||||
PP p c [] -> P.PQ (tri p) (tri c)
|
PP p c [] -> P.PQ (tri p) (tri c)
|
||||||
PP p c a -> P.PQC (tri p) (tri c) (map trp a)
|
PP p c a -> P.PQC (tri p) (tri c) (map trp a)
|
||||||
PR r -> P.PR [P.PA [trLabelIdent l] (trp p) | (l,p) <- r]
|
PR r -> P.PR [P.PA [trLabelIdent l] (trp p) | (l,p) <- r]
|
||||||
|
PString s -> P.PStr s
|
||||||
---- PT t p -> prt p ---- prParenth (prt p +++ ":" +++ prt t)
|
---- PT t p -> prt p ---- prParenth (prt p +++ ":" +++ prt t)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
module Today where today = "Mon Mar 1 10:50:38 CET 2004"
|
module Today where today = "Tue Mar 23 10:59:42 CET 2004"
|
||||||
|
|||||||
Reference in New Issue
Block a user