summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/CFGtoPGF.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2016-03-21 13:26:32 +0000
committerkrasimir <krasimir@chalmers.se>2016-03-21 13:26:32 +0000
commitda10bb33c73e0742d6aa3aa77d71b2804b2ed673 (patch)
tree2cbc16539ed8665b2a10ff3a2420a96ba43f9c14 /src/compiler/GF/Compile/CFGtoPGF.hs
parent07cf4d6509563036e3b4d6d9794562f0221d8468 (diff)
bugfix: GF.Compile.CFGtoPGF now supports literal categories
Diffstat (limited to 'src/compiler/GF/Compile/CFGtoPGF.hs')
-rw-r--r--src/compiler/GF/Compile/CFGtoPGF.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/GF/Compile/CFGtoPGF.hs b/src/compiler/GF/Compile/CFGtoPGF.hs
index 5f8ddebb6..5bf1d1be1 100644
--- a/src/compiler/GF/Compile/CFGtoPGF.hs
+++ b/src/compiler/GF/Compile/CFGtoPGF.hs
@@ -60,7 +60,10 @@ cf2concr cfg = Concr Map.empty Map.empty
lbls = listArray (0,0) ["s"]
(totalCats,cnccats0) = mapAccumL mkCncCat 0 (Map.toList (cfgRules cfg))
- cnccats = Map.fromList cnccats0
+ cnccats = Map.fromList ((mkCId "Int", CncCat fidInt fidInt lbls) :
+ (mkCId "Float", CncCat fidFloat fidFloat lbls) :
+ (mkCId "String", CncCat fidString fidString lbls) :
+ cnccats0)
lindefsrefs =
IntMap.fromList (map mkLinDefRef (Map.keys (cfgRules cfg)))
@@ -81,7 +84,7 @@ cf2concr cfg = Concr Map.empty Map.empty
where
syms = snd $ mapAccumL convertSymbol 0 (ruleRhs rule)
- convertSymbol d (NonTerminal _) = (d+1,SymCat d 0)
+ convertSymbol d (NonTerminal c) = (d+1,if c `elem` ["Int","Float","String"] then SymLit d 0 else SymCat d 0)
convertSymbol d (Terminal t) = (d, SymKS t)
mkCncCat fid (cat,_) = (fid+1, (mkCId cat,CncCat fid fid lbls))