diff options
| author | aarne <unknown> | 2004-08-13 13:21:46 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-08-13 13:21:46 +0000 |
| commit | 69aa3248d2ea878ef45e9e8c177381730d949c32 (patch) | |
| tree | b412e7238c9690fab1867159b5c6a1e4336fb59a /src/GF/Grammar/LookAbs.hs | |
| parent | a7605447420a6acdde087a6bd7be6ef2d0dd12cd (diff) | |
unique ref
Diffstat (limited to 'src/GF/Grammar/LookAbs.hs')
| -rw-r--r-- | src/GF/Grammar/LookAbs.hs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/GF/Grammar/LookAbs.hs b/src/GF/Grammar/LookAbs.hs index cc414596f..06e3ce3a5 100644 --- a/src/GF/Grammar/LookAbs.hs +++ b/src/GF/Grammar/LookAbs.hs @@ -81,15 +81,15 @@ lookupRef gr binds at = case at of K _ -> return valAbsString _ -> prtBad "cannot refine with complex term" at --- -refsForType :: (Val -> Type -> Bool) -> GFCGrammar -> Binds -> Val -> [(Term,Val)] -refsForType compat gr binds val = - -- bound variables - [(vr i, t) | (i,t) <- binds, Ok ty <- [val2exp t], compat val ty] ++ - -- integer and string literals - [(EInt i, val) | val == valAbsInt, i <- [0,1,2,5,11,1978]] ++ - [(K s, val) | val == valAbsString, s <- ["foo", "NN", "x"]] ++ - -- functions defined in the current abstract syntax - [(qq f, vClos t) | (f,t) <- funsForType compat gr val] +refsForType :: (Val -> Type -> Bool) -> GFCGrammar -> Binds -> Val -> [(Term,(Val,Bool))] +refsForType compat gr binds val = + -- bound variables --- never recursive? + [(vr i, (t,False)) | (i,t) <- binds, Ok ty <- [val2exp t], compat val ty] ++ + -- integer and string literals + [(EInt i, (val,False)) | val == valAbsInt, i <- [0,1,2,5,11,1978]] ++ + [(K s, (val,False)) | val == valAbsString, s <- ["foo", "NN", "x"]] ++ + -- functions defined in the current abstract syntax + [(qq f, (vClos t,isRecursiveType t)) | (f,t) <- funsForType compat gr val] funRulesOf :: GFCGrammar -> [(Fun,Type)] |
