summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF/Parse.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-05-19 13:32:39 +0000
committerkrasimir <krasimir@chalmers.se>2010-05-19 13:32:39 +0000
commite0dc9c80a6cbb45254f7e20d50894267aa2a3532 (patch)
tree07f02914c96664da1e57fcb2558f84ced6cc05ff /src/runtime/haskell/PGF/Parse.hs
parent1743e88192d3395221d8a023aee319182055191d (diff)
now every BracketedString also has reference to the source expression(s)
Diffstat (limited to 'src/runtime/haskell/PGF/Parse.hs')
-rw-r--r--src/runtime/haskell/PGF/Parse.hs17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/runtime/haskell/PGF/Parse.hs b/src/runtime/haskell/PGF/Parse.hs
index ce195f752..f48fab097 100644
--- a/src/runtime/haskell/PGF/Parse.hs
+++ b/src/runtime/haskell/PGF/Parse.hs
@@ -27,7 +27,7 @@ import PGF.Data
import PGF.Expr(Tree)
import PGF.Macros
import PGF.TypeCheck
-import PGF.Forest(Forest(Forest), linearizeWithBrackets)
+import PGF.Forest(Forest(Forest), linearizeWithBrackets, foldForest)
-- | This data type encodes the different outcomes which you could get from the parser.
data ParseResult
@@ -380,21 +380,6 @@ insertPC key fcat chart = Map.insert key fcat chart
----------------------------------------------------------------
--- Forest
-----------------------------------------------------------------
-
-foldForest :: (FunId -> [FId] -> b -> b) -> (Expr -> [String] -> b -> b) -> b -> FId -> IntMap.IntMap (Set.Set Production) -> b
-foldForest f g b fcat forest =
- case IntMap.lookup fcat forest of
- Nothing -> b
- Just set -> Set.fold foldProd b set
- where
- foldProd (PCoerce fcat) b = foldForest f g b fcat forest
- foldProd (PApply funid args) b = f funid args b
- foldProd (PConst _ const toks) b = g const toks b
-
-
-----------------------------------------------------------------
-- Parse State
----------------------------------------------------------------