Skip to content

Commit c4ab916

Browse files
committed
Fix comments before AUTOINST confusing scanner.
* verilog-mode.el (verilog-scan): Fix comments before AUTOINST confusing scanner, broke in r598. git-svn-id: file:///verilog-mode-svn/trunk@605 db5bb42b-8904-0410-88e9-aa7026cf2ec3
1 parent 5434784 commit c4ab916

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

tests/autoinst_cmtcell_msg270.v

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module ex;
2+
3+
subwidth u_a2 // commented
4+
(/*AUTOINST*/
5+
// Outputs
6+
.bus4a (bus4a[0:3]));
7+
8+
endmodule
9+
10+
module subwidth (/*AUTOARG*/
11+
// Outputs
12+
bus4a
13+
);
14+
output [0:3] bus4a;
15+
endmodule

tests_ok/autoinst_cmtcell_msg270.v

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module ex;
2+
3+
subwidth u_a2 // commented
4+
(/*AUTOINST*/
5+
// Outputs
6+
.bus4a (bus4a[0:3]));
7+
8+
endmodule
9+
10+
module subwidth (/*AUTOARG*/
11+
// Outputs
12+
bus4a
13+
);
14+
output [0:3] bus4a;
15+
endmodule

verilog-mode.el

+5-3
Original file line numberDiff line numberDiff line change
@@ -2579,15 +2579,17 @@ and `verilog-scan'.")
25792579
Also assumes any text inserted since `verilog-scan-cache-tick'
25802580
either is ok to parse as a non-comment, or `verilog-insert' was used."
25812581
(unless (or (and verilog-scan-cache-preserving
2582-
(eq verilog-scan-cache-preserving (current-buffer)))
2582+
(eq verilog-scan-cache-preserving (current-buffer))
2583+
verilog-scan-cache-tick)
25832584
(equal verilog-scan-cache-tick (buffer-modified-tick)))
2584-
(setq verilog-scan-cache-tick (buffer-modified-tick))
25852585
(save-excursion
25862586
(let ((was-mod (buffer-modified-p))
25872587
(buffer-read-only nil))
25882588
(remove-text-properties (point-min) (point-max) '(v-cmt nil))
25892589
(verilog-scan-region (point-min) (point-max))
2590-
(unless was-mod (set-buffer-modified-p nil))))))
2590+
(unless was-mod (set-buffer-modified-p nil))
2591+
;; Set tick last, as the property adds modify the buffer
2592+
(setq verilog-scan-cache-tick (buffer-modified-tick))))))
25912593

25922594
(defun verilog-inside-comment-p ()
25932595
"Check if point inside a comment.

0 commit comments

Comments
 (0)