Handle the RHS type of A.Counted consistently.
Previously the parser set it to the element type, but everything that used it set it to the type of the whole array. Now it's documented in AST.hs, and the parser makes it the type of the whole array, since that's almost always what you really want later on.
This commit is contained in:
parent
37b5735de1
commit
475a77404c
|
@ -137,6 +137,8 @@ data Type =
|
|||
-- | A channel of the specified type.
|
||||
| Chan Direction ChanAttributes Type
|
||||
-- | A counted input or output.
|
||||
-- The first type is that of the count; the second is that of the array.
|
||||
-- (For example, @INT::[]BYTE@ would be @A.Counted A.Int (A.Array ...)@).
|
||||
| Counted Type Type
|
||||
| Any
|
||||
| Timer TimerType
|
||||
|
|
|
@ -1229,7 +1229,7 @@ protocol
|
|||
|
||||
simpleProtocol :: OccParser A.Type
|
||||
simpleProtocol
|
||||
= do { l <- tryVX dataType sColons; sLeft; sRight; r <- dataType; return $ A.Counted l r }
|
||||
= do { l <- tryVX dataType sColons; sLeft; sRight; r <- dataType; return $ A.Counted l (addDimensions [A.UnknownDimension] r) }
|
||||
<|> dataType
|
||||
<|> do { sANY; return $ A.Any }
|
||||
<?> "simple protocol"
|
||||
|
|
Loading…
Reference in New Issue
Block a user