diff options
| author | aarne <unknown> | 2003-10-07 15:17:55 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2003-10-07 15:17:55 +0000 |
| commit | 889e5a92e4e0c40ab249f9f86d0fa2647132d87a (patch) | |
| tree | d9dd9687ee2d8a735b65f9b617f3f1a607666615 /src/GF/Grammar/MMacros.hs | |
| parent | 0988010e33fabc02090490b4a562a53fa9a08780 (diff) | |
Updates for editor. Dummies for hugs.
Diffstat (limited to 'src/GF/Grammar/MMacros.hs')
| -rw-r--r-- | src/GF/Grammar/MMacros.hs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/GF/Grammar/MMacros.hs b/src/GF/Grammar/MMacros.hs index cea8af11a..15e9b3c45 100644 --- a/src/GF/Grammar/MMacros.hs +++ b/src/GF/Grammar/MMacros.hs @@ -255,14 +255,20 @@ identVar (Vr x) = return x identVar _ = Bad "not a variable" --- light-weight rename for user interaction +-- light-weight rename for user interaction; also change names of internal vars qualifTerm :: Ident -> Term -> Term qualifTerm m = qualif [] where qualif xs t = case t of - Abs x b -> Abs x $ qualif (x:xs) b + Abs x b -> let x' = chV x in Abs x' $ qualif (x':xs) b Prod x a b -> Prod x (qualif xs a) $ qualif (x:xs) b - Vr x | notElem x xs -> Q m x + Vr x -> let x' = chV x in if (elem x' xs) then (Vr x') else (Q m x) Cn c -> Q m c Con c -> QC m c _ -> composSafeOp (qualif xs) t + chV x = string2var $ prIdent x + +string2var :: String -> Ident +string2var s = case s of + c:'_':i -> identV (readIntArg i,[c]) --- + _ -> zIdent s |
