diff --git a/ParseOccam.hs b/ParseOccam.hs index 770b445..509b3f6 100644 --- a/ParseOccam.hs +++ b/ParseOccam.hs @@ -684,8 +684,11 @@ makeLiteral x@(A.Literal m t lr) wantT -- representation. (A.Record _, A.ArrayLiteral ml aes) -> do fs <- recordFields m underT - es <- sequence [makeLiteral e t - | ((_, t), A.ArrayElemExpr e) <- zip fs aes] + es <- sequence [case ae of + A.ArrayElemExpr e -> makeLiteral e t + A.ArrayElemArray aes -> + makeLiteral (A.Literal m t $ A.ArrayLiteral ml aes) t + | ((_, t), ae) <- zip fs aes] return $ A.Literal m wantT (A.RecordLiteral ml es) -- Some other kind of literal (one of the trivial types). _ -> return $ A.Literal m wantT lr diff --git a/testcases/record-literals2.occ b/testcases/record-literals2.occ new file mode 100644 index 0000000..7a1c982 --- /dev/null +++ b/testcases/record-literals2.occ @@ -0,0 +1,13 @@ +-- From cgtest56 + +PROC record.literals() + DATA TYPE contains.array + RECORD + BYTE b : + [3]INT a : + INT i : + : + [2]contains.array aca : + aca := [['a', [2,3,4], 6],['b', [3,4,5], 7]] +: +