--- /dev/null
+# -*- 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
-- 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
-- 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
--
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
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]
("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
--