From 88030f23db7eba3a6ee98694beca12f643567b4e Mon Sep 17 00:00:00 2001 From: He Yun Date: Thu, 7 Nov 2024 21:00:37 +0800 Subject: [PATCH] Imporve ident of delay control assignments (#1883) (verilog-do-indent) Imporve ident of delay control assignments (#1883) --- tests/indent_delay_assignment.v | 14 ++++++++++++++ tests_ok/indent_delay_assignment.v | 14 ++++++++++++++ verilog-mode.el | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 tests/indent_delay_assignment.v create mode 100644 tests_ok/indent_delay_assignment.v diff --git a/tests/indent_delay_assignment.v b/tests/indent_delay_assignment.v new file mode 100644 index 0000000..6bae887 --- /dev/null +++ b/tests/indent_delay_assignment.v @@ -0,0 +1,14 @@ +module a(); +always(*)begin +a = #1 b | +c | +d; +a <= #1 b | +c | +d; +a <= # 1 b | +c | +d; + +end +endmodule diff --git a/tests_ok/indent_delay_assignment.v b/tests_ok/indent_delay_assignment.v new file mode 100644 index 0000000..f65d339 --- /dev/null +++ b/tests_ok/indent_delay_assignment.v @@ -0,0 +1,14 @@ +module a(); + always(*)begin + a = #1 b | + c | + d; + a <= #1 b | + c | + d; + a <= # 1 b | + c | + d; + + end +endmodule diff --git a/verilog-mode.el b/verilog-mode.el index 90aa975..0bb093e 100644 --- a/verilog-mode.el +++ b/verilog-mode.el @@ -7242,7 +7242,7 @@ Only look at a few lines to determine indent level." (verilog-beg-of-statement-1) (let ((val (if (and (< (point) here) - (verilog-re-search-forward "=[ \t]*" here 'move) + (verilog-re-search-forward "=[ \t]*\\(#[ \t]*[0-9]+[ \t]*\\)?" here 'move) ;; not at a |=>, #=#, or [=n] operator (not (string-match "\\[=.\\|#=#\\||=>" (or (buffer-substring