Skip to content

Commit

Permalink
Fix indentation/labelling when encountering keyword-like names.
Browse files Browse the repository at this point in the history
* verilog-mode.el (verilog-calculate-indent, verilog-label-be):  Enable
  case-sensitive regular expression parsing when looking for keywords.
  • Loading branch information
Alex Reed committed Jun 26, 2015
1 parent 56fe426 commit 832636e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/indent_typedef.sv
@@ -0,0 +1,5 @@
package p;
typedef enum {a, b} type_t;
typedef enum {TASK, TASK2} type2_t;
typedef enum {Package, Class} type3_t;
endpackage
5 changes: 5 additions & 0 deletions tests_ok/indent_typedef.sv
@@ -0,0 +1,5 @@
package p;
typedef enum {a, b} type_t;
typedef enum {TASK, TASK2} type2_t;
typedef enum {Package, Class} type3_t;
endpackage
2 changes: 2 additions & 0 deletions verilog-mode.el
Expand Up @@ -4219,6 +4219,7 @@ Uses `verilog-scan' cache."
"Label matching begin ... end, fork ... join and case ... endcase statements."
(interactive)
(let ((cnt 0)
(case-fold-search nil)
(oldpos (point))
(b (progn
(verilog-beg-of-defun)
Expand Down Expand Up @@ -5397,6 +5398,7 @@ type of the current line, return that lines' indent level and its type.
Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
(save-excursion
(let* ((starting_position (point))
(case-fold-search nil)
(par 0)
(begin (looking-at "[ \t]*begin\\>"))
(lim (save-excursion (verilog-re-search-backward "\\(\\<begin\\>\\)\\|\\(\\<module\\>\\)" nil t)))
Expand Down

0 comments on commit 832636e

Please sign in to comment.