Skip to content

Commit 5fd4c8a

Browse files
committed
Fix parsing "@ (* )" (#1829).
* verilog-mode.el (verilog-read-decls): Fix parsing "@ (* )" (#1829).
1 parent c81dda0 commit 5fd4c8a

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

tests/autoarg_starparen.v

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// bug #1829
2+
module dut (/*autoarg*/);
3+
input clk;
4+
input rst_n;
5+
output logic d;
6+
7+
always @(* )
8+
begin
9+
d = 1'b0;
10+
end
11+
12+
endmodule

tests_ok/autoarg_starparen.v

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// bug #1829
2+
module dut (/*autoarg*/
3+
// Outputs
4+
d,
5+
// Inputs
6+
clk, rst_n
7+
);
8+
input clk;
9+
input rst_n;
10+
output logic d;
11+
12+
always @(* )
13+
begin
14+
d = 1'b0;
15+
end
16+
17+
endmodule

verilog-mode.el

+2-1
Original file line numberDiff line numberDiff line change
@@ -9323,7 +9323,8 @@ Return an array of [outputs inouts inputs wire reg assign const gparam intf]."
93239323
((looking-at "(\\*")
93249324
;; To advance past either "(*)" or "(* ... *)" don't forward past first *
93259325
(forward-char 1)
9326-
(or (search-forward "*)")
9326+
(or (looking-at "\\*\\s-*)") ; (* )
9327+
(search-forward "*)") ; end attribute
93279328
(error "%s: Unmatched (* *), at char %d" (verilog-point-text) (point))))
93289329
((eq ?\" (following-char))
93299330
(or (re-search-forward "[^\\]\"" nil t) ; don't forward-char first, since we look for a non backslash first

0 commit comments

Comments
 (0)