From dc13239cc79f15805861e705c68e813f4d922aad Mon Sep 17 00:00:00 2001 From: timv Date: Wed, 28 Nov 2012 22:19:11 -0500 Subject: [PATCH] Insignificant changes to NormalizeParse renamed temporary variable names) Added Makefile (might not really want this...) --- Makefile | 20 ++++++++++++++++++++ src/Dyna/Analysis/NormalizeParse.hs | 13 ++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b793132 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# -*- indent-tabs-mode:t; -*- + +all: deps + +upstream: + git submodule init + git submodule update external/ekmett-parsers external/ekmett-trifecta + (cd external/ekmett-parsers; cabal install --user) + (cd external/ekmett-trifecta; cabal install --user) + +deps: + (cabal install --enable-tests --only-dependencies) + +build: deps + cabal configure --user --enable-tests + cabal build + cabal test + +run-parser: + ghci -isrc Dyna.ParserHS.Parser diff --git a/src/Dyna/Analysis/NormalizeParse.hs b/src/Dyna/Analysis/NormalizeParse.hs index 8f1344c..5652b0e 100644 --- a/src/Dyna/Analysis/NormalizeParse.hs +++ b/src/Dyna/Analysis/NormalizeParse.hs @@ -131,8 +131,8 @@ normTerm_ _ _ _ (P.TVar v) = return $ UVar v -- Numerics also get returned in-place. normTerm_ _ _ _ (P.TNumeric n) = return $ UTerm $ TNumeric n - -- Quote simply disappears having converted the context to - -- a non-evaluation context. + -- FIXME: (nwf) Quote simply disappears having converted the context to a + -- non-evaluation context. normTerm_ _ _ ss (P.TFunctor "&" [t T.:~ st]) = do normTerm_ False True (st:ss) t @@ -140,7 +140,7 @@ normTerm_ _ _ ss (P.TFunctor "&" [t T.:~ st]) = do -- to not be evaluated, thus the sort of odd "normalize in -- nonevaluation context then eval" here. normTerm_ _ _ ss (P.TFunctor "*" [t T.:~ st]) = do - normTerm_ False True (st:ss) t >>= newEval "_normTS_" + normTerm_ False True (st:ss) t >>= newEval "_s" -- Annotations are stripped of their span information -- @@ -156,8 +156,8 @@ normTerm_ c u ss (P.TFunctor f as) = do normas <- mapM (\(a T.:~ s,d) -> normTerm_ d True (s:ss) a) (zip as argdispos) selfdispos <- getSelfDispos (case () of - _ | c && selfdispos -> newEval "_normTF_" - _ | u -> newUnif "_normTU_" + _ | c && selfdispos -> newEval "_f" + _ | u -> newUnif "_u" _ -> return) $ UTerm $ TFunctor f normas where @@ -186,7 +186,6 @@ normRule (P.Rule h a es r T.:~ _) = do return $ Rule nh a nes nr -- XXX ---dynaFunctorArgDispositions :: M.Map (B.ByteString,Int) [Bool] dynaFunctorArgDispositions :: (B.ByteString, Int) -> [Bool] dynaFunctorArgDispositions x = case x of ("is", 2) -> [False,True] @@ -197,7 +196,7 @@ dynaFunctorArgDispositions x = case x of ("and", 2) -> [True, True] ("or", 2) -> [True, True] ("not", 1) -> [True] - (name, arity) -> take arity $ repeat $ C.isAlpha $ head $ BU.toString name + (name, arity) -> take arity $ repeat $ not.C.isAlphaNum $ head $ BU.toString name -- XXX -- -- 2.50.1