diff options
| author | krasimir <krasimir@chalmers.se> | 2008-10-14 15:29:50 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2008-10-14 15:29:50 +0000 |
| commit | 57ee52103dcccbcda75b895ea399e230e18d0a92 (patch) | |
| tree | eb9cde804d4cdeb4fd6c8ff0deea585908d0da0a /src/GF/Compile/GeneratePMCFG.hs | |
| parent | e4dc63f6657153da1a8c906f669581905f054e4a (diff) | |
literal categories in the incremental parser
Diffstat (limited to 'src/GF/Compile/GeneratePMCFG.hs')
| -rw-r--r-- | src/GF/Compile/GeneratePMCFG.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/GF/Compile/GeneratePMCFG.hs b/src/GF/Compile/GeneratePMCFG.hs index c3e6e8cb4..870396255 100644 --- a/src/GF/Compile/GeneratePMCFG.hs +++ b/src/GF/Compile/GeneratePMCFG.hs @@ -262,10 +262,18 @@ type FunSet = Map.Map FFun FunId type CoerceSet= Map.Map [FCat] FCat emptyFRulesEnv cnc_defs lincats = - let (last_id,catSet) = Map.mapAccum computeCatRange 0 lincats + let (last_id,catSet) = Map.mapAccumWithKey computeCatRange 0 lincats in GrammarEnv last_id catSet Map.empty Map.empty Map.empty IntMap.empty where - computeCatRange index ctype = (index+size,(index,index+size-1,poly)) + cidString = mkCId "String" + cidInt = mkCId "Int" + cidFloat = mkCId "Float" + + computeCatRange index cat ctype + | cat == cidString = (index, (fcatString,fcatString,[])) + | cat == cidInt = (index, (fcatInt, fcatInt, [])) + | cat == cidFloat = (index, (fcatFloat, fcatFloat, [])) + | otherwise = (index+size,(index,index+size-1,poly)) where (size,poly) = getMultipliers 1 [] ctype |
