Commit ba7ffdf1 by Zachary Snow

$bits conversion handles types with more than 1 dimension

parent 86195d9e
...@@ -18,6 +18,13 @@ convert = ...@@ -18,6 +18,13 @@ convert =
convertExpr convertExpr
convertExpr :: Expr -> Expr convertExpr :: Expr -> Expr
convertExpr (Bits (Left (IntegerVector _ _ [r]))) = rangeSize r convertExpr (Bits (Left (IntegerVector _ _ rs))) = size rs
convertExpr (Bits (Left (Implicit _ [r]))) = rangeSize r convertExpr (Bits (Left (Implicit _ rs))) = size rs
convertExpr other = other convertExpr other = other
size :: [Range] -> Expr
size ranges =
simplify $
foldl (BinOp Mul) (Number "1") $
map rangeSize $
ranges
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment