Commit 46242aac by Zachary Snow

fix combined array declarations (resolves #34)

parent a0068f60
......@@ -314,6 +314,10 @@ tripLookahead l0 =
-- know we must have a valid triplet ahead
else if null l1 || asgn /= Nothing then
True
-- if there is an ident followed by some number of ranges, and that's it,
-- then there is a trailing declaration of an array ahead
else if (not $ null l1) && (null l2) then
True
-- if there is a comma after the identifier (and optional ranges and
-- assignment) that we're looking at, then we know this identifier is not a
-- type name, as type names must be followed by a first identifier before a
......
module top;
typedef struct packed {
logic f1;
logic f2;
} T;
T a[1:0];
T b[1:0];
T c[1:0], d[1:0];
T e[1:0], f[1:0], g;
T h, i[1:0];
T j;
struct packed {
logic f1;
logic f2;
} k;
endmodule
module top;
reg [1:0] a[1:0];
reg [1:0] b[1:0];
reg [1:0] c[1:0], d[1:0];
reg [1:0] e[1:0], f[1:0], g;
reg [1:0] h, i[1:0];
reg [1:0] j;
reg [1:0] k;
endmodule
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