From 08a728799a8920fc3d82cdb8c1bdba99a0d1afdf Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 30 Aug 2017 15:59:43 +0200 Subject: change tabularLinearize in the Haskell binding to return a list instead of map this preserves the order --- src/runtime/haskell-bind/PGF2.hsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/runtime/haskell-bind') diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc index 104d06cb1..7ebba4846 100644 --- a/src/runtime/haskell-bind/PGF2.hsc +++ b/src/runtime/haskell-bind/PGF2.hsc @@ -648,7 +648,7 @@ linearizeAll lang e = unsafePerformIO $ throwIO (PGFError "The abstract tree cannot be linearized") -- | Generates a table of linearizations for an expression -tabularLinearize :: Concr -> Expr -> Map.Map String String +tabularLinearize :: Concr -> Expr -> [(String, String)] tabularLinearize lang e = unsafePerformIO $ withGuPool $ \tmpPl -> do exn <- gu_new_exn tmpPl @@ -660,7 +660,7 @@ tabularLinearize lang e = unsafePerformIO $ peek ptr if ctree == nullPtr then do touchExpr e - return Map.empty + return [] else do labels <- alloca $ \p_n_lins -> alloca $ \p_labels -> do pgf_lzr_get_table (concr lang) ctree p_n_lins p_labels @@ -670,7 +670,7 @@ tabularLinearize lang e = unsafePerformIO $ labels <- mapM peekCString labels return labels lins <- collect lang ctree 0 labels exn tmpPl - return (Map.fromList lins) + return lins where collect lang ctree lin_idx [] exn tmpPl = return [] collect lang ctree lin_idx (label:labels) exn tmpPl = do -- cgit v1.2.3