diff --git a/src/FWL/Compile.hs b/src/FWL/Compile.hs index 0fa206a..f4043c1 100644 --- a/src/FWL/Compile.hs +++ b/src/FWL/Compile.hs @@ -257,9 +257,15 @@ renderNftType [t] = A.String (toText t) renderNftType ts = toJSON ts exprToVal :: Expr -> Value -exprToVal (ELit (LPort p)) = toJSON p -exprToVal (ELit (LInt n)) = toJSON n -exprToVal (ELit l) = A.String (toText (renderLit l)) +exprToVal (ELit (LPort p)) = toJSON p +exprToVal (ELit (LInt n)) = toJSON n +exprToVal (ELit (LCIDR ip p))= object + [ "prefix" .= object + [ "addr" .= A.String (toText (renderLit ip)) + , "len" .= p + ] + ] +exprToVal (ELit l) = A.String (toText (renderLit l)) exprToVal (EVar n) = A.String (toText n) exprToVal (EQual ns) = A.String (toText (intercalate "." ns)) exprToVal _ = A.String "_"