summaryrefslogtreecommitdiff
path: root/src/AST
diff options
context:
space:
mode:
Diffstat (limited to 'src/AST')
-rw-r--r--src/AST/Count.hs1
-rw-r--r--src/AST/Pretty.hs6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/AST/Count.hs b/src/AST/Count.hs
index a928743..f3e3d74 100644
--- a/src/AST/Count.hs
+++ b/src/AST/Count.hs
@@ -130,6 +130,7 @@ occCountGeneral onehot unpush alter many = go WId
EAccum _ a b e -> re a <> re b <> re e
EZero _ -> mempty
EPlus _ a b -> re a <> re b
+ EOneHot _ _ a b -> re a <> re b
EError{} -> mempty
where
re :: Monoid (r env') => Expr x env' t'' -> r env'
diff --git a/src/AST/Pretty.hs b/src/AST/Pretty.hs
index a05b49e..677c767 100644
--- a/src/AST/Pretty.hs
+++ b/src/AST/Pretty.hs
@@ -204,6 +204,12 @@ ppExpr' d val = \case
b' <- ppExpr' 11 val b
return $ showParen (d > 10) $ showString "plus " . a' . showString " " . b'
+ EOneHot _ i a b -> do
+ a' <- ppExpr' 11 val a
+ b' <- ppExpr' 11 val b
+ return $ showParen (d > 10) $
+ showString ("onehot " ++ show (fromSNat i) ++ " ") . a' . showString " " . b'
+
EError _ s -> return $ showParen (d > 10) $ showString ("error " ++ show s)
ppExprLet :: Int -> SVal env -> Expr x env t -> M ShowS