branch: elpa/evil-matchit
commit 1a5c4454a74d59122b5eeffa33725aceecaa05d7
Author: Chen Bin <[email protected]>
Commit: Chen Bin <[email protected]>
support verilog
---
README.org | 3 +-
evil-matchit-pkg.el | 2 +-
evil-matchit-verilog.el | 98 +++++++++++++++++++++++++++++++++++++++++++++++++
evil-matchit.el | 9 ++++-
pkg.sh | 2 +-
5 files changed, 109 insertions(+), 5 deletions(-)
diff --git a/README.org b/README.org
index 01d759f79b..0ac27a2e58 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-matchit (v2.1.7)
+* evil-matchit (v2.1.8)
[[http://melpa.org/#/evil-matchit][file:http://melpa.org/packages/evil-matchit-badge.svg]]
[[http://stable.melpa.org/#/evil-matchit][file:http://stable.melpa.org/packages/evil-matchit-badge.svg]]
@@ -26,6 +26,7 @@ Many modern languages are supported:
- SQL
- Laravel Blade Templating
- Vim script
+- Verilog
- Emacs email (mesage-mode)
This package uses Evil as its vi layer!
diff --git a/evil-matchit-pkg.el b/evil-matchit-pkg.el
index af1d5155f1..3b1b30756a 100644
--- a/evil-matchit-pkg.el
+++ b/evil-matchit-pkg.el
@@ -1,2 +1,2 @@
-(define-package "evil-matchit" "2.1.7"
+(define-package "evil-matchit" "2.1.8"
"Vim matchit ported into Emacs (requires EVIL)")
diff --git a/evil-matchit-verilog.el b/evil-matchit-verilog.el
new file mode 100644
index 0000000000..b03a0b3c54
--- /dev/null
+++ b/evil-matchit-verilog.el
@@ -0,0 +1,98 @@
+;;; evil-matchit-verilog.el ---verilog plugin of evil-matchit
+
+;; Copyright (C) 2014-2016 Chen Bin <[email protected]>
+
+;; Author: Chen Bin <[email protected]>
+
+;; This file is not part of GNU Emacs.
+
+;;; License:
+
+;; This file is part of evil-matchit
+;;
+;; evil-matchit is free software: you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as published
+;; by the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; evil-matchit is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+;;; Code:
+
+;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
+;; but SDK don make you write less code, isn't it?
+;; All you need to do is just define the match-tags for SDK algorithm to
lookup.
+(require 'evil-matchit-sdk)
+
+;; {{ Sample verilog code:
+;; module dff_lab;
+;; reg data,rst;
+;; // Connecting ports by name.(map)
+;; dff d1 (.qb(outb), .q(out),
+;; .clk(clk),.d(data),.rst(rst));
+;; // overriding module parameters
+;; defparam
+;; dff_lab.dff.n1.delay1 = 5 ,
+;; dff_lab.dff.n2.delay2 = 6 ;
+;; // full-path referencing is used
+;; // over-riding by using #(8,9) delay1=8..
+;; dff d2 #(8,9) (outc, outd, clk, outb, rst);
+;; // clock generator
+;; always clk = #10 ~clk ;
+;; // stimulus ... contd
+;; initial begin: stimuli // named block stimulus
+;; clk = 1; data = 1; rst = 0;
+;; #20 rst = 1;
+;; #20 data = 0;
+;; #600 $finish;
+;; end
+;; initial // hierarchy: downward path referencing
+;; begin
+;; #100 force dff.n2.rst = 0 ;
+;; #200 release dff.n2.rst;
+;; end
+;; endmodule
+;; }}
+
+;; should try next howto, the purpose is avoid missing any howto
+(defvar evilmi-verilog-extract-keyword-howtos
+ '(("^[
\t]*\\(while\\|module\\|primitive\\|case\\|function\\|specify\\|table\\)" 1)
+ ("^[
\t]*\\(endmodule\\|endprimitive\\|endcase\\|endfunction\\|endspecify\\|endtable\\)"
1)
+ ("^[ \t]*\\(if\\) .*[^; ][ \t]*$" 1) ; if ...; is one complete statement
+ ("\\(begin\\)[ \t]*\\(//.*\\)?[ \t]*$$" 1)
+ ("\\(begin\\):" 1)
+ ("^[ \t]*\\(else *\\(if\\)?\\).*" 1)
+ ("^[ \t]*end \\(else *\\(if\\)?\\).*" 1)
+ ("^[ \t]*\\(end\\|begin\\)[ \t]*\\(//.*\\)?[ \t]*$" 1)
+ ))
+
+(defvar evilmi-verilog-match-tags
+ '(("module" () "endmodule" "MONOGAMY")
+ ("primitive" () "endprimitive" "MONOGAMY")
+ ("case" () "endcase" "MONOGAMY")
+ ("function" () "endfunction" "MONOGAMY")
+ ("table" () "endtable" "MONOGAMY")
+ ("specify" () "endspecify" "MONOGAMY")
+ ("if" ("else" "else if") "end")
+ (("while" "begin") () "end")
+ ))
+
+
+;;;###autoload
+(defun evilmi-verilog-get-tag ()
+ (let* ((rlt (evilmi-sdk-get-tag evilmi-verilog-match-tags
evilmi-verilog-extract-keyword-howtos)))
+ rlt))
+
+;;;###autoload
+(defun evilmi-verilog-jump (rlt NUM)
+ (evilmi-sdk-jump rlt NUM evilmi-verilog-match-tags
evilmi-verilog-extract-keyword-howtos))
+
+(provide 'evil-matchit-verilog)
+;;; evil-matchit-verilog.el ends here
\ No newline at end of file
diff --git a/evil-matchit.el b/evil-matchit.el
index 0e80a4d3b1..2e42480edf 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -4,7 +4,7 @@
;; Author: Chen Bin <[email protected]>
;; URL: http://github.com/redguardtoo/evil-matchit
-;; Version: 2.1.7
+;; Version: 2.1.8
;; Keywords: matchit vim evil
;; Package-Requires: ((evil "1.0.7"))
;;
@@ -341,6 +341,11 @@ If font-face-under-cursor is NOT nil, the quoted string is
being processed"
(autoload 'evilmi-sh-jump "evil-matchit-sh" nil)
(plist-put evilmi-plugins 'sh-mode '((evilmi-sh-get-tag evilmi-sh-jump)))
+ ;; verilog-mode
+ (autoload 'evilmi-verilog-get-tag "evil-matchit-verilog" nil)
+ (autoload 'evilmi-verilog-jump "evil-matchit-verilog" nil)
+ (plist-put evilmi-plugins 'verilog-mode '((evilmi-verilog-get-tag
evilmi-verilog-jump)))
+
;; Lua or any fine script
(autoload 'evilmi-script-get-tag "evil-matchit-script" nil)
(autoload 'evilmi-script-jump "evil-matchit-script" nil)
@@ -449,7 +454,7 @@ If font-face-under-cursor is NOT nil, the quoted string is
being processed"
(evilmi--operate-on-item NUM))))
;;;###autoload
-(defun evilmi-version() (interactive) (message "2.1.7"))
+(defun evilmi-version() (interactive) (message "2.1.8"))
;;;###autoload
(define-minor-mode evil-matchit-mode
diff --git a/pkg.sh b/pkg.sh
index 69e3291d81..b2a4bc257e 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-pkg=evil-matchit-2.1.7
+pkg=evil-matchit-2.1.8
mkdir $pkg
cp README.org $pkg
cp *.el $pkg