Skip to content

Commit 3c163a7

Browse files
committed
A bug of Repeat statement parsing is fixed.
1 parent 966d8d4 commit 3c163a7

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

testcode/test.v

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module TOP(CLK, RST_X, IN, OUT);
66
reg [7:0] state;
77
reg [7:0] nstate;
88
reg [7:0] cnt;
9-
reg [7:0] ncnt;
109

1110
integer i;
1211

@@ -30,11 +29,9 @@ module TOP(CLK, RST_X, IN, OUT);
3029
cnt <= 0;
3130
end else begin
3231
state <= nstate;
33-
cnt <= ncnt;
32+
cnt <= cnt + 1;
3433
end
3534
end
3635

3736
endmodule
38-
3937

40-

vparser/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,8 @@ def p_concatlist_one(self, p):
884884
p[0] = (p[1],)
885885

886886
def p_repeat(self, p):
887-
'repeat : expression concat'
888-
p[0] = Repeat(p[2], p[1])
887+
'repeat : LBRACE expression concat RBRACE'
888+
p[0] = Repeat(p[3], p[2])
889889

890890
def p_partselect(self, p):
891891
'partselect : identifier LBRACKET expression COLON expression RBRACKET'

0 commit comments

Comments
 (0)