diff options
| author | Reto Zimmermann | 2015-02-20 19:35:25 -0500 |
|---|---|---|
| committer | Glenn Morris | 2015-02-20 19:35:25 -0500 |
| commit | 80e67e434cce67417453b0d8ac66e061b279e4e7 (patch) | |
| tree | d4a44f0939f4e5eb75c8e77551b2dc933fa693a5 | |
| parent | 226c1224b5805e5dfc8dd0939b93de2a2bf1e103 (diff) | |
| download | emacs-80e67e434cce67417453b0d8ac66e061b279e4e7.tar.gz emacs-80e67e434cce67417453b0d8ac66e061b279e4e7.zip | |
Sync with upstream vhdl mode v3.37.1. Add VHDL'08 support.
* lisp/progmodes/vhdl-mode.el (vhdl-version, vhdl-time-stamp)
(vhdl-doc-release-notes): Update.
(vhdl-standard): Add VHDL'08 option.
(vhdl-sensitivity-list-all): New option.
(vhdl-directive-keywords): Add psl.
(vhdl-offsets-alist-default, vhdl-mode-abbrev-table-init)
(vhdl-template-construct-alist-init, vhdl-create-mode-menu):
(vhdl-imenu-generic-expression): Add context, directive.
(vhdl-offsets-alist, vhdl-mode, vhdl-doc-keywords): Doc fixes.
(vhdl-template-map-init): Add vhdl-template-context.
(vhdl-mode-syntax-table): Support VHDL'08 block comments.
(vhdl-create-mode-menu): Add some entries.
(vhdl-08-keywords, vhdl-08-types, vhdl-08-attributes)
(vhdl-08-functions, vhdl-08-packages, vhdl-08-directives): New constants.
(vhdl-directives): New variable.
(vhdl-words-init, vhdl-template-process)
(vhdl-template-replace-header-keywords): Support VHDL'08.
(vhdl-abbrev-list-init): Add vhdl-directives.
(vhdl-in-comment-p, vhdl-in-literal, vhdl-win-il)
(vhdl-forward-syntactic-ws, vhdl-get-syntactic-context)
(vhdl-lineup-comment): Handle block comments and directives.
(vhdl-beginning-of-directive, vhdl-template-context)
(vhdl-template-context-hook): New functions.
(vhdl-libunit-re, vhdl-defun-re, vhdl-begin-p)
(vhdl-corresponding-begin, vhdl-get-library-unit, vhdl-regress-line)
(vhdl-align-declarations, vhdl-beginning-of-block, vhdl-end-of-block)
(vhdl-font-lock-keywords-2, vhdl-get-end-of-unit)
(vhdl-scan-context-clause): Add context.
* etc/NEWS: Mention this.
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 33 | ||||
| -rw-r--r-- | lisp/progmodes/vhdl-mode.el | 273 |
3 files changed, 262 insertions, 46 deletions
| @@ -467,6 +467,8 @@ allows to customize this. | |||
| 467 | *** Two new faces `compare-windows-removed' and `compare-windows-added' | 467 | *** Two new faces `compare-windows-removed' and `compare-windows-added' |
| 468 | replace the obsolete face `compare-windows'. | 468 | replace the obsolete face `compare-windows'. |
| 469 | 469 | ||
| 470 | ** VHDL mode supports VHDL'08. | ||
| 471 | |||
| 470 | ** Calculator: decimal display mode uses "," groups, so it's more | 472 | ** Calculator: decimal display mode uses "," groups, so it's more |
| 471 | fitting for use in money calculations; factorial works with | 473 | fitting for use in money calculations; factorial works with |
| 472 | non-integer inputs. | 474 | non-integer inputs. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc62555a471..ce1a8c2c0f9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,36 @@ | |||
| 1 | 2015-02-21 Reto Zimmermann <reto@gnu.org> | ||
| 2 | |||
| 3 | Sync with upstream vhdl mode v3.37.1. Add VHDL'08 support. | ||
| 4 | * progmodes/vhdl-mode.el (vhdl-version, vhdl-time-stamp) | ||
| 5 | (vhdl-doc-release-notes): Update. | ||
| 6 | (vhdl-standard): Add VHDL'08 option. | ||
| 7 | (vhdl-sensitivity-list-all): New option. | ||
| 8 | (vhdl-directive-keywords): Add psl. | ||
| 9 | (vhdl-offsets-alist-default, vhdl-mode-abbrev-table-init) | ||
| 10 | (vhdl-template-construct-alist-init, vhdl-create-mode-menu): | ||
| 11 | (vhdl-imenu-generic-expression): Add context, directive. | ||
| 12 | (vhdl-offsets-alist, vhdl-mode, vhdl-doc-keywords): Doc fixes. | ||
| 13 | (vhdl-template-map-init): Add vhdl-template-context. | ||
| 14 | (vhdl-mode-syntax-table): Support VHDL'08 block comments. | ||
| 15 | (vhdl-create-mode-menu): Add some entries. | ||
| 16 | (vhdl-08-keywords, vhdl-08-types, vhdl-08-attributes) | ||
| 17 | (vhdl-08-functions, vhdl-08-packages, vhdl-08-directives): | ||
| 18 | New constants. | ||
| 19 | (vhdl-directives): New variable. | ||
| 20 | (vhdl-words-init, vhdl-template-process) | ||
| 21 | (vhdl-template-replace-header-keywords): Support VHDL'08. | ||
| 22 | (vhdl-abbrev-list-init): Add vhdl-directives. | ||
| 23 | (vhdl-in-comment-p, vhdl-in-literal, vhdl-win-il) | ||
| 24 | (vhdl-forward-syntactic-ws, vhdl-get-syntactic-context) | ||
| 25 | (vhdl-lineup-comment): Handle block comments and directives. | ||
| 26 | (vhdl-beginning-of-directive, vhdl-template-context) | ||
| 27 | (vhdl-template-context-hook): New functions. | ||
| 28 | (vhdl-libunit-re, vhdl-defun-re, vhdl-begin-p) | ||
| 29 | (vhdl-corresponding-begin, vhdl-get-library-unit, vhdl-regress-line) | ||
| 30 | (vhdl-align-declarations, vhdl-beginning-of-block, vhdl-end-of-block) | ||
| 31 | (vhdl-font-lock-keywords-2, vhdl-get-end-of-unit) | ||
| 32 | (vhdl-scan-context-clause): Add context. | ||
| 33 | |||
| 1 | 2015-02-20 Glenn Morris <rgm@gnu.org> | 34 | 2015-02-20 Glenn Morris <rgm@gnu.org> |
| 2 | 35 | ||
| 3 | * calendar/solar.el (solar-sunrise-sunset-string): | 36 | * calendar/solar.el (solar-sunrise-sunset-string): |
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 875de3b865c..8d6d2a29293 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el | |||
| @@ -13,10 +13,10 @@ | |||
| 13 | ;; filed in the Emacs bug reporting system against this file, a copy | 13 | ;; filed in the Emacs bug reporting system against this file, a copy |
| 14 | ;; of the bug report be sent to the maintainer's email address. | 14 | ;; of the bug report be sent to the maintainer's email address. |
| 15 | 15 | ||
| 16 | (defconst vhdl-version "3.36.1" | 16 | (defconst vhdl-version "3.37.1" |
| 17 | "VHDL Mode version number.") | 17 | "VHDL Mode version number.") |
| 18 | 18 | ||
| 19 | (defconst vhdl-time-stamp "2014-11-27" | 19 | (defconst vhdl-time-stamp "2015-01-15" |
| 20 | "VHDL Mode time stamp for last update.") | 20 | "VHDL Mode time stamp for last update.") |
| 21 | 21 | ||
| 22 | ;; This file is part of GNU Emacs. | 22 | ;; This file is part of GNU Emacs. |
| @@ -59,7 +59,7 @@ | |||
| 59 | ;; - Block commenting | 59 | ;; - Block commenting |
| 60 | ;; - Code fixing/alignment/beautification | 60 | ;; - Code fixing/alignment/beautification |
| 61 | ;; - PostScript printing | 61 | ;; - PostScript printing |
| 62 | ;; - VHDL'87/'93 and VHDL-AMS supported | 62 | ;; - VHDL'87/'93/'02/'08 and VHDL-AMS supported |
| 63 | ;; - Comprehensive menu | 63 | ;; - Comprehensive menu |
| 64 | ;; - Fully customizable | 64 | ;; - Fully customizable |
| 65 | ;; - Works under GNU Emacs (recommended) and XEmacs | 65 | ;; - Works under GNU Emacs (recommended) and XEmacs |
| @@ -716,6 +716,7 @@ A project setup file can be obtained by exporting a project (see menu). | |||
| 716 | Basic standard: | 716 | Basic standard: |
| 717 | VHDL'87 : IEEE Std 1076-1987 | 717 | VHDL'87 : IEEE Std 1076-1987 |
| 718 | VHDL'93/02 : IEEE Std 1076-1993/2002 | 718 | VHDL'93/02 : IEEE Std 1076-1993/2002 |
| 719 | VHDL'08 : IEEE Std 1076-2008 | ||
| 719 | Additional standards: | 720 | Additional standards: |
| 720 | VHDL-AMS : IEEE Std 1076.1 (analog-mixed-signal) | 721 | VHDL-AMS : IEEE Std 1076.1 (analog-mixed-signal) |
| 721 | Math packages: IEEE Std 1076.2 (`math_real', `math_complex') | 722 | Math packages: IEEE Std 1076.2 (`math_real', `math_complex') |
| @@ -724,7 +725,8 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry | |||
| 724 | \"Activate Options\"." | 725 | \"Activate Options\"." |
| 725 | :type '(list (choice :tag "Basic standard" | 726 | :type '(list (choice :tag "Basic standard" |
| 726 | (const :tag "VHDL'87" 87) | 727 | (const :tag "VHDL'87" 87) |
| 727 | (const :tag "VHDL'93/02" 93)) | 728 | (const :tag "VHDL'93/02" 93) |
| 729 | (const :tag "VHDL'08" 08)) | ||
| 728 | (set :tag "Additional standards" :indent 2 | 730 | (set :tag "Additional standards" :indent 2 |
| 729 | (const :tag "VHDL-AMS" ams) | 731 | (const :tag "VHDL-AMS" ams) |
| 730 | (const :tag "Math packages" math))) | 732 | (const :tag "Math packages" math))) |
| @@ -942,6 +944,12 @@ If nil, only a list of actual parameters is entered." | |||
| 942 | :type 'boolean | 944 | :type 'boolean |
| 943 | :group 'vhdl-template) | 945 | :group 'vhdl-template) |
| 944 | 946 | ||
| 947 | (defcustom vhdl-sensitivity-list-all t | ||
| 948 | "Non-nil means use 'all' keyword in sensitivity list." | ||
| 949 | :version "25.1" | ||
| 950 | :type 'boolean | ||
| 951 | :group 'vhdl-template) | ||
| 952 | |||
| 945 | (defcustom vhdl-zero-string "'0'" | 953 | (defcustom vhdl-zero-string "'0'" |
| 946 | "String to use for a logic zero." | 954 | "String to use for a logic zero." |
| 947 | :type 'string | 955 | :type 'string |
| @@ -1728,7 +1736,7 @@ NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | |||
| 1728 | 'vhdl-words-init 'vhdl-font-lock-init)) | 1736 | 'vhdl-words-init 'vhdl-font-lock-init)) |
| 1729 | :group 'vhdl-highlight) | 1737 | :group 'vhdl-highlight) |
| 1730 | 1738 | ||
| 1731 | (defcustom vhdl-directive-keywords '("pragma" "synopsys") | 1739 | (defcustom vhdl-directive-keywords '("psl" "pragma" "synopsys") |
| 1732 | "List of compiler directive keywords recognized for highlighting. | 1740 | "List of compiler directive keywords recognized for highlighting. |
| 1733 | 1741 | ||
| 1734 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | 1742 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
| @@ -2001,6 +2009,8 @@ reported and the syntactic symbol is ignored.") | |||
| 2001 | (package . 0) | 2009 | (package . 0) |
| 2002 | (architecture . 0) | 2010 | (architecture . 0) |
| 2003 | (package-body . 0) | 2011 | (package-body . 0) |
| 2012 | (context . 0) | ||
| 2013 | (directive . 0) | ||
| 2004 | ) | 2014 | ) |
| 2005 | "Default settings for offsets of syntactic elements. | 2015 | "Default settings for offsets of syntactic elements. |
| 2006 | Do not change this constant! See the variable `vhdl-offsets-alist' for | 2016 | Do not change this constant! See the variable `vhdl-offsets-alist' for |
| @@ -2065,7 +2075,8 @@ Here is the current list of valid syntactic element symbols: | |||
| 2065 | configuration -- inside a configuration declaration | 2075 | configuration -- inside a configuration declaration |
| 2066 | package -- inside a package declaration | 2076 | package -- inside a package declaration |
| 2067 | architecture -- inside an architecture body | 2077 | architecture -- inside an architecture body |
| 2068 | package-body -- inside a package body") | 2078 | package-body -- inside a package body |
| 2079 | context -- inside a context declaration") | ||
| 2069 | 2080 | ||
| 2070 | (defvar vhdl-comment-only-line-offset 0 | 2081 | (defvar vhdl-comment-only-line-offset 0 |
| 2071 | "Extra offset for line which contains only the start of a comment. | 2082 | "Extra offset for line which contains only the start of a comment. |
| @@ -2684,6 +2695,7 @@ elements > `vhdl-menu-max-size'." | |||
| 2684 | (define-key vhdl-template-map "Cd" 'vhdl-template-configuration-decl) | 2695 | (define-key vhdl-template-map "Cd" 'vhdl-template-configuration-decl) |
| 2685 | (define-key vhdl-template-map "Cs" 'vhdl-template-configuration-spec) | 2696 | (define-key vhdl-template-map "Cs" 'vhdl-template-configuration-spec) |
| 2686 | (define-key vhdl-template-map "co" 'vhdl-template-constant) | 2697 | (define-key vhdl-template-map "co" 'vhdl-template-constant) |
| 2698 | (define-key vhdl-template-map "ct" 'vhdl-template-context) | ||
| 2687 | (define-key vhdl-template-map "di" 'vhdl-template-disconnect) | 2699 | (define-key vhdl-template-map "di" 'vhdl-template-disconnect) |
| 2688 | (define-key vhdl-template-map "el" 'vhdl-template-else) | 2700 | (define-key vhdl-template-map "el" 'vhdl-template-else) |
| 2689 | (define-key vhdl-template-map "ei" 'vhdl-template-elsif) | 2701 | (define-key vhdl-template-map "ei" 'vhdl-template-elsif) |
| @@ -2963,7 +2975,7 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 2963 | (modify-syntax-entry ?\* "." st) | 2975 | (modify-syntax-entry ?\* "." st) |
| 2964 | (modify-syntax-entry ?\+ "." st) | 2976 | (modify-syntax-entry ?\+ "." st) |
| 2965 | (modify-syntax-entry ?\. "." st) | 2977 | (modify-syntax-entry ?\. "." st) |
| 2966 | (modify-syntax-entry ?\/ "." st) | 2978 | ;;; (modify-syntax-entry ?\/ "." st) |
| 2967 | (modify-syntax-entry ?\: "." st) | 2979 | (modify-syntax-entry ?\: "." st) |
| 2968 | (modify-syntax-entry ?\; "." st) | 2980 | (modify-syntax-entry ?\; "." st) |
| 2969 | (modify-syntax-entry ?\< "." st) | 2981 | (modify-syntax-entry ?\< "." st) |
| @@ -2975,11 +2987,13 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 2975 | (modify-syntax-entry ?\" "\"" st) | 2987 | (modify-syntax-entry ?\" "\"" st) |
| 2976 | ;; define underscore | 2988 | ;; define underscore |
| 2977 | (modify-syntax-entry ?\_ (if vhdl-underscore-is-part-of-word "w" "_") st) | 2989 | (modify-syntax-entry ?\_ (if vhdl-underscore-is-part-of-word "w" "_") st) |
| 2978 | ;; a single hyphen is punctuation, but a double hyphen starts a comment | 2990 | ;; single-line comments |
| 2979 | (modify-syntax-entry ?\- ". 12" st) | 2991 | (modify-syntax-entry ?\- ". 12b" st) |
| 2980 | ;; and \n and \^M end a comment | 2992 | ;; multi-line comments |
| 2981 | (modify-syntax-entry ?\n ">" st) | 2993 | (modify-syntax-entry ?\/ ". 14b" st) |
| 2982 | (modify-syntax-entry ?\^M ">" st) | 2994 | (modify-syntax-entry ?* ". 23" st) |
| 2995 | (modify-syntax-entry ?\n "> b" st) | ||
| 2996 | (modify-syntax-entry ?\^M "> b" st) | ||
| 2983 | ;; define parentheses to match | 2997 | ;; define parentheses to match |
| 2984 | (modify-syntax-entry ?\( "()" st) | 2998 | (modify-syntax-entry ?\( "()" st) |
| 2985 | (modify-syntax-entry ?\) ")(" st) | 2999 | (modify-syntax-entry ?\) ")(" st) |
| @@ -3044,6 +3058,7 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3044 | ("configuration" . vhdl-template-configuration-hook) | 3058 | ("configuration" . vhdl-template-configuration-hook) |
| 3045 | ("cons" . vhdl-template-constant-hook) | 3059 | ("cons" . vhdl-template-constant-hook) |
| 3046 | ("constant" . vhdl-template-constant-hook) | 3060 | ("constant" . vhdl-template-constant-hook) |
| 3061 | ("context" . vhdl-template-context-hook) | ||
| 3047 | ("disconnect" . vhdl-template-disconnect-hook) | 3062 | ("disconnect" . vhdl-template-disconnect-hook) |
| 3048 | ("downto" . vhdl-template-default-hook) | 3063 | ("downto" . vhdl-template-default-hook) |
| 3049 | ("else" . vhdl-template-else-hook) | 3064 | ("else" . vhdl-template-else-hook) |
| @@ -3191,6 +3206,7 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3191 | ("configuration declaration" vhdl-template-configuration-decl) | 3206 | ("configuration declaration" vhdl-template-configuration-decl) |
| 3192 | ("configuration specification" vhdl-template-configuration-spec) | 3207 | ("configuration specification" vhdl-template-configuration-spec) |
| 3193 | ("constant declaration" vhdl-template-constant) | 3208 | ("constant declaration" vhdl-template-constant) |
| 3209 | ("context declaration" vhdl-template-context) | ||
| 3194 | ("disconnection specification" vhdl-template-disconnect) | 3210 | ("disconnection specification" vhdl-template-disconnect) |
| 3195 | ("entity declaration" vhdl-template-entity) | 3211 | ("entity declaration" vhdl-template-entity) |
| 3196 | ("exit statement" vhdl-template-exit) | 3212 | ("exit statement" vhdl-template-exit) |
| @@ -3367,6 +3383,7 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3367 | ["Configuration (Decl)" vhdl-template-configuration-decl t] | 3383 | ["Configuration (Decl)" vhdl-template-configuration-decl t] |
| 3368 | ["Configuration (Spec)" vhdl-template-configuration-spec t] | 3384 | ["Configuration (Spec)" vhdl-template-configuration-spec t] |
| 3369 | ["Constant" vhdl-template-constant t] | 3385 | ["Constant" vhdl-template-constant t] |
| 3386 | ["Context" vhdl-template-context t] | ||
| 3370 | ["Disconnect" vhdl-template-disconnect t] | 3387 | ["Disconnect" vhdl-template-disconnect t] |
| 3371 | ["Else" vhdl-template-else t] | 3388 | ["Else" vhdl-template-else t] |
| 3372 | ["Elsif" vhdl-template-elsif t] | 3389 | ["Elsif" vhdl-template-elsif t] |
| @@ -3708,6 +3725,11 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3708 | (list '93 (cadr vhdl-standard))) | 3725 | (list '93 (cadr vhdl-standard))) |
| 3709 | (vhdl-activate-customizations)) | 3726 | (vhdl-activate-customizations)) |
| 3710 | :style radio :selected (eq '93 (car vhdl-standard))] | 3727 | :style radio :selected (eq '93 (car vhdl-standard))] |
| 3728 | ["VHDL'08" | ||
| 3729 | (progn (customize-set-variable 'vhdl-standard | ||
| 3730 | (list '08 (cadr vhdl-standard))) | ||
| 3731 | (vhdl-activate-customizations)) | ||
| 3732 | :style radio :selected (eq '08 (car vhdl-standard))] | ||
| 3711 | "--" | 3733 | "--" |
| 3712 | ["VHDL-AMS" | 3734 | ["VHDL-AMS" |
| 3713 | (progn (customize-set-variable | 3735 | (progn (customize-set-variable |
| @@ -3830,6 +3852,10 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3830 | (customize-set-variable 'vhdl-conditions-in-parenthesis | 3852 | (customize-set-variable 'vhdl-conditions-in-parenthesis |
| 3831 | (not vhdl-conditions-in-parenthesis)) | 3853 | (not vhdl-conditions-in-parenthesis)) |
| 3832 | :style toggle :selected vhdl-conditions-in-parenthesis] | 3854 | :style toggle :selected vhdl-conditions-in-parenthesis] |
| 3855 | ["Sensitivity List uses 'all'" | ||
| 3856 | (customize-set-variable 'vhdl-sensitivity-list-all | ||
| 3857 | (not vhdl-sensitivity-list-all)) | ||
| 3858 | :style toggle :selected vhdl-sensitivity-list-all] | ||
| 3833 | ["Zero String..." (customize-option 'vhdl-zero-string) t] | 3859 | ["Zero String..." (customize-option 'vhdl-zero-string) t] |
| 3834 | ["One String..." (customize-option 'vhdl-one-string) t] | 3860 | ["One String..." (customize-option 'vhdl-one-string) t] |
| 3835 | ("File Header" | 3861 | ("File Header" |
| @@ -4224,6 +4250,9 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 4224 | ("Entity" | 4250 | ("Entity" |
| 4225 | "^\\s-*\\(entity\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)" | 4251 | "^\\s-*\\(entity\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)" |
| 4226 | 2) | 4252 | 2) |
| 4253 | ("Context" | ||
| 4254 | "^\\s-*\\(context\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)" | ||
| 4255 | 2) | ||
| 4227 | ) | 4256 | ) |
| 4228 | "Imenu generic expression for VHDL Mode. See `imenu-generic-expression'.") | 4257 | "Imenu generic expression for VHDL Mode. See `imenu-generic-expression'.") |
| 4229 | 4258 | ||
| @@ -4677,7 +4706,7 @@ Usage: | |||
| 4677 | 4706 | ||
| 4678 | VHDL STANDARDS: | 4707 | VHDL STANDARDS: |
| 4679 | The VHDL standards to be used are specified in option `vhdl-standard'. | 4708 | The VHDL standards to be used are specified in option `vhdl-standard'. |
| 4680 | Available standards are: VHDL'87/'93(02), VHDL-AMS, and Math Packages. | 4709 | Available standards are: VHDL'87/'93(02)/'08, VHDL-AMS, and Math Packages. |
| 4681 | 4710 | ||
| 4682 | 4711 | ||
| 4683 | KEYWORD CASE: | 4712 | KEYWORD CASE: |
| @@ -4987,6 +5016,12 @@ Key bindings: | |||
| 4987 | ) | 5016 | ) |
| 4988 | "List of VHDL'02 keywords.") | 5017 | "List of VHDL'02 keywords.") |
| 4989 | 5018 | ||
| 5019 | (defconst vhdl-08-keywords | ||
| 5020 | '( | ||
| 5021 | "context" "force" "property" "release" "sequence" | ||
| 5022 | ) | ||
| 5023 | "List of VHDL'08 keywords.") | ||
| 5024 | |||
| 4990 | (defconst vhdl-ams-keywords | 5025 | (defconst vhdl-ams-keywords |
| 4991 | '( | 5026 | '( |
| 4992 | "across" "break" "limit" "nature" "noise" "procedural" "quantity" | 5027 | "across" "break" "limit" "nature" "noise" "procedural" "quantity" |
| @@ -5028,6 +5063,12 @@ Key bindings: | |||
| 5028 | ) | 5063 | ) |
| 5029 | "List of VHDL'02 standardized types.") | 5064 | "List of VHDL'02 standardized types.") |
| 5030 | 5065 | ||
| 5066 | (defconst vhdl-08-types | ||
| 5067 | '( | ||
| 5068 | "boolean_vector" "integer_vector" "real_vector" "time_vector" | ||
| 5069 | ) | ||
| 5070 | "List of VHDL'08 standardized types.") | ||
| 5071 | |||
| 5031 | (defconst vhdl-ams-types | 5072 | (defconst vhdl-ams-types |
| 5032 | ;; standards: IEEE Std 1076.1-2007, IEEE Std 1076.1.1-2004 | 5073 | ;; standards: IEEE Std 1076.1-2007, IEEE Std 1076.1.1-2004 |
| 5033 | '( | 5074 | '( |
| @@ -5103,6 +5144,12 @@ Key bindings: | |||
| 5103 | ) | 5144 | ) |
| 5104 | "List of VHDL'02 standardized attributes.") | 5145 | "List of VHDL'02 standardized attributes.") |
| 5105 | 5146 | ||
| 5147 | (defconst vhdl-08-attributes | ||
| 5148 | '( | ||
| 5149 | "instance_name" "path_name" | ||
| 5150 | ) | ||
| 5151 | "List of VHDL'08 standardized attributes.") | ||
| 5152 | |||
| 5106 | (defconst vhdl-ams-attributes | 5153 | (defconst vhdl-ams-attributes |
| 5107 | '( | 5154 | '( |
| 5108 | "across" "through" | 5155 | "across" "through" |
| @@ -5174,6 +5221,15 @@ Key bindings: | |||
| 5174 | ) | 5221 | ) |
| 5175 | "List of VHDL'02 standardized functions.") | 5222 | "List of VHDL'02 standardized functions.") |
| 5176 | 5223 | ||
| 5224 | (defconst vhdl-08-functions | ||
| 5225 | '( | ||
| 5226 | "finish" "flush" "justify" "maximum" "minimum" | ||
| 5227 | "resolution_limit" "rising_edge" "stop" "swrite" | ||
| 5228 | "tee" "to_binarystring" "to_bstring" "to_hexstring" "to_hstring" | ||
| 5229 | "to_octalstring" "to_ostring" "to_string" | ||
| 5230 | ) | ||
| 5231 | "List of VHDL'08 standardized functions.") | ||
| 5232 | |||
| 5177 | (defconst vhdl-ams-functions | 5233 | (defconst vhdl-ams-functions |
| 5178 | '( | 5234 | '( |
| 5179 | ;; package `standard' | 5235 | ;; package `standard' |
| @@ -5202,6 +5258,13 @@ Key bindings: | |||
| 5202 | ) | 5258 | ) |
| 5203 | "List of VHDL'02 standardized packages and libraries.") | 5259 | "List of VHDL'02 standardized packages and libraries.") |
| 5204 | 5260 | ||
| 5261 | (defconst vhdl-08-packages | ||
| 5262 | '( | ||
| 5263 | "env" "numeric_std_signed" "numeric_std_unsigned" | ||
| 5264 | "ieee_bit_context" "ieee_std_context" ;; contexts | ||
| 5265 | ) | ||
| 5266 | "List of VHDL'08 standardized packages and libraries.") | ||
| 5267 | |||
| 5205 | (defconst vhdl-ams-packages | 5268 | (defconst vhdl-ams-packages |
| 5206 | '( | 5269 | '( |
| 5207 | "fundamental_constants" "material_constants" "energy_systems" | 5270 | "fundamental_constants" "material_constants" "energy_systems" |
| @@ -5216,6 +5279,18 @@ Key bindings: | |||
| 5216 | ) | 5279 | ) |
| 5217 | "List of Math Packages standardized packages and libraries.") | 5280 | "List of Math Packages standardized packages and libraries.") |
| 5218 | 5281 | ||
| 5282 | (defconst vhdl-08-directives | ||
| 5283 | '( | ||
| 5284 | "author" "author_info" "begin" "begin_protected" "comment" | ||
| 5285 | "data_block" "data_keyname" "data_keyowner" "data_method" | ||
| 5286 | "decrypt_license" "digest_block" "digest_key_method" "digest_keyname" | ||
| 5287 | "digest_keyowner" "digest_method" | ||
| 5288 | "encoding" "encrypt_agent" "encrypt_agent_info" "end" "end_protected" | ||
| 5289 | "key_block" "key_keyname" "key_keyowner" "key_method" | ||
| 5290 | "runtime_license" "viewport" | ||
| 5291 | ) | ||
| 5292 | "List of VHDL'08 standardized tool directives.") | ||
| 5293 | |||
| 5219 | (defvar vhdl-keywords nil | 5294 | (defvar vhdl-keywords nil |
| 5220 | "List of VHDL keywords.") | 5295 | "List of VHDL keywords.") |
| 5221 | 5296 | ||
| @@ -5237,6 +5312,9 @@ Key bindings: | |||
| 5237 | (defvar vhdl-packages nil | 5312 | (defvar vhdl-packages nil |
| 5238 | "List of VHDL standardized packages and libraries.") | 5313 | "List of VHDL standardized packages and libraries.") |
| 5239 | 5314 | ||
| 5315 | (defvar vhdl-directives nil | ||
| 5316 | "List of VHDL standardized packages and libraries.") | ||
| 5317 | |||
| 5240 | (defvar vhdl-reserved-words nil | 5318 | (defvar vhdl-reserved-words nil |
| 5241 | "List of additional reserved words.") | 5319 | "List of additional reserved words.") |
| 5242 | 5320 | ||
| @@ -5282,17 +5360,20 @@ Key bindings: | |||
| 5282 | (vhdl-upcase-list | 5360 | (vhdl-upcase-list |
| 5283 | (and vhdl-highlight-case-sensitive vhdl-upper-case-keywords) | 5361 | (and vhdl-highlight-case-sensitive vhdl-upper-case-keywords) |
| 5284 | (append vhdl-02-keywords | 5362 | (append vhdl-02-keywords |
| 5363 | (when (vhdl-standard-p '08) vhdl-08-keywords) | ||
| 5285 | (when (vhdl-standard-p 'ams) vhdl-ams-keywords)))) | 5364 | (when (vhdl-standard-p 'ams) vhdl-ams-keywords)))) |
| 5286 | (setq vhdl-types | 5365 | (setq vhdl-types |
| 5287 | (vhdl-upcase-list | 5366 | (vhdl-upcase-list |
| 5288 | (and vhdl-highlight-case-sensitive vhdl-upper-case-types) | 5367 | (and vhdl-highlight-case-sensitive vhdl-upper-case-types) |
| 5289 | (append vhdl-02-types | 5368 | (append vhdl-02-types |
| 5369 | (when (vhdl-standard-p '08) vhdl-08-types) | ||
| 5290 | (when (vhdl-standard-p 'ams) vhdl-ams-types) | 5370 | (when (vhdl-standard-p 'ams) vhdl-ams-types) |
| 5291 | (when (vhdl-standard-p 'math) vhdl-math-types)))) | 5371 | (when (vhdl-standard-p 'math) vhdl-math-types)))) |
| 5292 | (setq vhdl-attributes | 5372 | (setq vhdl-attributes |
| 5293 | (vhdl-upcase-list | 5373 | (vhdl-upcase-list |
| 5294 | (and vhdl-highlight-case-sensitive vhdl-upper-case-attributes) | 5374 | (and vhdl-highlight-case-sensitive vhdl-upper-case-attributes) |
| 5295 | (append vhdl-02-attributes | 5375 | (append vhdl-02-attributes |
| 5376 | (when (vhdl-standard-p '08) vhdl-08-attributes) | ||
| 5296 | (when (vhdl-standard-p 'ams) vhdl-ams-attributes)))) | 5377 | (when (vhdl-standard-p 'ams) vhdl-ams-attributes)))) |
| 5297 | (setq vhdl-enum-values | 5378 | (setq vhdl-enum-values |
| 5298 | (vhdl-upcase-list | 5379 | (vhdl-upcase-list |
| @@ -5307,12 +5388,16 @@ Key bindings: | |||
| 5307 | '("")))) | 5388 | '("")))) |
| 5308 | (setq vhdl-functions | 5389 | (setq vhdl-functions |
| 5309 | (append vhdl-02-functions | 5390 | (append vhdl-02-functions |
| 5391 | (when (vhdl-standard-p '08) vhdl-08-functions) | ||
| 5310 | (when (vhdl-standard-p 'ams) vhdl-ams-functions) | 5392 | (when (vhdl-standard-p 'ams) vhdl-ams-functions) |
| 5311 | (when (vhdl-standard-p 'math) vhdl-math-functions))) | 5393 | (when (vhdl-standard-p 'math) vhdl-math-functions))) |
| 5312 | (setq vhdl-packages | 5394 | (setq vhdl-packages |
| 5313 | (append vhdl-02-packages | 5395 | (append vhdl-02-packages |
| 5396 | (when (vhdl-standard-p '08) vhdl-08-packages) | ||
| 5314 | (when (vhdl-standard-p 'ams) vhdl-ams-packages) | 5397 | (when (vhdl-standard-p 'ams) vhdl-ams-packages) |
| 5315 | (when (vhdl-standard-p 'math) vhdl-math-packages))) | 5398 | (when (vhdl-standard-p 'math) vhdl-math-packages))) |
| 5399 | (setq vhdl-directives | ||
| 5400 | (append (when (vhdl-standard-p '08) vhdl-08-directives))) | ||
| 5316 | (setq vhdl-reserved-words | 5401 | (setq vhdl-reserved-words |
| 5317 | (append (when vhdl-highlight-forbidden-words vhdl-forbidden-words) | 5402 | (append (when vhdl-highlight-forbidden-words vhdl-forbidden-words) |
| 5318 | (when vhdl-highlight-verilog-keywords vhdl-verilog-keywords) | 5403 | (when vhdl-highlight-verilog-keywords vhdl-verilog-keywords) |
| @@ -5357,7 +5442,8 @@ Key bindings: | |||
| 5357 | (list vhdl-upper-case-enum-values) vhdl-enum-values | 5442 | (list vhdl-upper-case-enum-values) vhdl-enum-values |
| 5358 | (list vhdl-upper-case-constants) vhdl-constants | 5443 | (list vhdl-upper-case-constants) vhdl-constants |
| 5359 | (list nil) vhdl-functions | 5444 | (list nil) vhdl-functions |
| 5360 | (list nil) vhdl-packages))) | 5445 | (list nil) vhdl-packages |
| 5446 | (list nil) vhdl-directives))) | ||
| 5361 | 5447 | ||
| 5362 | ;; initialize reserved words for VHDL Mode | 5448 | ;; initialize reserved words for VHDL Mode |
| 5363 | (vhdl-words-init) | 5449 | (vhdl-words-init) |
| @@ -5598,9 +5684,24 @@ the offset is simply returned." | |||
| 5598 | 5684 | ||
| 5599 | ;; Syntactic support functions: | 5685 | ;; Syntactic support functions: |
| 5600 | 5686 | ||
| 5601 | (defun vhdl-in-comment-p () | 5687 | (defun vhdl-in-comment-p (&optional pos) |
| 5602 | "Check if point is in a comment." | 5688 | "Check if point is in a comment (include multi-line comments)." |
| 5603 | (eq (vhdl-in-literal) 'comment)) | 5689 | (let ((parse (lambda (p) |
| 5690 | (let ((c (char-after p))) | ||
| 5691 | (or (and c (eq (char-syntax c) ?<)) | ||
| 5692 | (nth 4 (parse-partial-sexp | ||
| 5693 | (save-excursion | ||
| 5694 | (beginning-of-defun) | ||
| 5695 | (point)) p))))))) | ||
| 5696 | (save-excursion | ||
| 5697 | (goto-char (or pos (point))) | ||
| 5698 | (or (funcall parse (point)) | ||
| 5699 | ;; `parse-partial-sexp's notion of comments doesn't span lines | ||
| 5700 | (progn | ||
| 5701 | (back-to-indentation) | ||
| 5702 | (unless (eolp) | ||
| 5703 | (forward-char) | ||
| 5704 | (funcall parse (point)))))))) | ||
| 5604 | 5705 | ||
| 5605 | (defun vhdl-in-string-p () | 5706 | (defun vhdl-in-string-p () |
| 5606 | "Check if point is in a string." | 5707 | "Check if point is in a string." |
| @@ -5625,6 +5726,9 @@ the offset is simply returned." | |||
| 5625 | ((nth 3 state) 'string) | 5726 | ((nth 3 state) 'string) |
| 5626 | ((nth 4 state) 'comment) | 5727 | ((nth 4 state) 'comment) |
| 5627 | ((vhdl-beginning-of-macro) 'pound) | 5728 | ((vhdl-beginning-of-macro) 'pound) |
| 5729 | ((vhdl-beginning-of-directive) 'directive) | ||
| 5730 | ;; for multi-line comments | ||
| 5731 | ((and (vhdl-standard-p '08) (vhdl-in-comment-p)) 'comment) | ||
| 5628 | (t nil))))) | 5732 | (t nil))))) |
| 5629 | 5733 | ||
| 5630 | (defun vhdl-in-extended-identifier-p () | 5734 | (defun vhdl-in-extended-identifier-p () |
| @@ -5675,7 +5779,7 @@ negative, skip forward otherwise." | |||
| 5675 | (goto-char lim ) | 5779 | (goto-char lim ) |
| 5676 | (while (< (point) here) | 5780 | (while (< (point) here) |
| 5677 | (setq match | 5781 | (setq match |
| 5678 | (and (re-search-forward "--\\|[\"']" | 5782 | (and (re-search-forward "--\\|[\"']\\|`" |
| 5679 | here 'move) | 5783 | here 'move) |
| 5680 | (buffer-substring (match-beginning 0) (match-end 0)))) | 5784 | (buffer-substring (match-beginning 0) (match-end 0)))) |
| 5681 | (setq state | 5785 | (setq state |
| @@ -5685,6 +5789,9 @@ negative, skip forward otherwise." | |||
| 5685 | ;; looking at the opening of a VHDL style comment | 5789 | ;; looking at the opening of a VHDL style comment |
| 5686 | ((string= "--" match) | 5790 | ((string= "--" match) |
| 5687 | (if (<= here (progn (end-of-line) (point))) 'comment)) | 5791 | (if (<= here (progn (end-of-line) (point))) 'comment)) |
| 5792 | ;; looking at a directive | ||
| 5793 | ((string= "`" match) | ||
| 5794 | (if (<= here (progn (end-of-line) (point))) 'directive)) | ||
| 5688 | ;; looking at the opening of a double quote string | 5795 | ;; looking at the opening of a double quote string |
| 5689 | ((string= "\"" match) | 5796 | ((string= "\"" match) |
| 5690 | (if (not (save-restriction | 5797 | (if (not (save-restriction |
| @@ -5729,7 +5836,7 @@ negative, skip forward otherwise." | |||
| 5729 | (setq here (point)) | 5836 | (setq here (point)) |
| 5730 | (vhdl-forward-comment hugenum) | 5837 | (vhdl-forward-comment hugenum) |
| 5731 | ;; skip preprocessor directives | 5838 | ;; skip preprocessor directives |
| 5732 | (when (and (eq (char-after) ?#) | 5839 | (when (and (or (eq (char-after) ?#) (eq (char-after) ?`)) |
| 5733 | (= (vhdl-point 'boi) (point))) | 5840 | (= (vhdl-point 'boi) (point))) |
| 5734 | (while (and (eq (char-before (vhdl-point 'eol)) ?\\) | 5841 | (while (and (eq (char-before (vhdl-point 'eol)) ?\\) |
| 5735 | (= (forward-line 1) 0))) | 5842 | (= (forward-line 1) 0))) |
| @@ -5766,6 +5873,19 @@ negative, skip forward otherwise." | |||
| 5766 | (goto-char here) | 5873 | (goto-char here) |
| 5767 | nil))) | 5874 | nil))) |
| 5768 | 5875 | ||
| 5876 | (defun vhdl-beginning-of-directive (&optional lim) | ||
| 5877 | "Go to the beginning of a directive (nicked from `cc-engine')." | ||
| 5878 | (let ((here (point))) | ||
| 5879 | (beginning-of-line) | ||
| 5880 | (while (eq (char-before (1- (point))) ?\\) | ||
| 5881 | (forward-line -1)) | ||
| 5882 | (back-to-indentation) | ||
| 5883 | (if (and (<= (point) here) | ||
| 5884 | (eq (char-after) ?`)) | ||
| 5885 | t | ||
| 5886 | (goto-char here) | ||
| 5887 | nil))) | ||
| 5888 | |||
| 5769 | (defun vhdl-backward-syntactic-ws (&optional lim) | 5889 | (defun vhdl-backward-syntactic-ws (&optional lim) |
| 5770 | "Backward skip over syntactic whitespace." | 5890 | "Backward skip over syntactic whitespace." |
| 5771 | (let* ((here (point-min)) | 5891 | (let* ((here (point-min)) |
| @@ -5822,7 +5942,7 @@ that point, else nil." | |||
| 5822 | ;; Core syntactic evaluation functions: | 5942 | ;; Core syntactic evaluation functions: |
| 5823 | 5943 | ||
| 5824 | (defconst vhdl-libunit-re | 5944 | (defconst vhdl-libunit-re |
| 5825 | "\\b\\(architecture\\|configuration\\|entity\\|package\\)\\b[^_]") | 5945 | "\\b\\(architecture\\|configuration\\|context\\|entity\\|package\\)\\b[^_]") |
| 5826 | 5946 | ||
| 5827 | (defun vhdl-libunit-p () | 5947 | (defun vhdl-libunit-p () |
| 5828 | (and | 5948 | (and |
| @@ -5840,7 +5960,7 @@ that point, else nil." | |||
| 5840 | )) | 5960 | )) |
| 5841 | 5961 | ||
| 5842 | (defconst vhdl-defun-re | 5962 | (defconst vhdl-defun-re |
| 5843 | "\\b\\(architecture\\|block\\|configuration\\|entity\\|package\\|process\\|procedural\\|procedure\\|function\\)\\b[^_]") | 5963 | "\\b\\(architecture\\|block\\|configuration\\|context\\|entity\\|package\\|process\\|procedural\\|procedure\\|function\\)\\b[^_]") |
| 5844 | 5964 | ||
| 5845 | (defun vhdl-defun-p () | 5965 | (defun vhdl-defun-p () |
| 5846 | (save-excursion | 5966 | (save-excursion |
| @@ -5849,7 +5969,7 @@ that point, else nil." | |||
| 5849 | (save-excursion | 5969 | (save-excursion |
| 5850 | (backward-sexp) | 5970 | (backward-sexp) |
| 5851 | (not (looking-at "end\\s-+\\w"))) | 5971 | (not (looking-at "end\\s-+\\w"))) |
| 5852 | ;; "architecture", "configuration", "entity", | 5972 | ;; "architecture", "configuration", "context", "entity", |
| 5853 | ;; "package", "procedure", "function": | 5973 | ;; "package", "procedure", "function": |
| 5854 | t))) | 5974 | t))) |
| 5855 | 5975 | ||
| @@ -5863,7 +5983,7 @@ corresponding \"begin\" keyword, else return nil." | |||
| 5863 | (if (looking-at "block\\|process\\|procedural") | 5983 | (if (looking-at "block\\|process\\|procedural") |
| 5864 | ;; "block", "process". "procedural: | 5984 | ;; "block", "process". "procedural: |
| 5865 | (buffer-substring (match-beginning 0) (match-end 0)) | 5985 | (buffer-substring (match-beginning 0) (match-end 0)) |
| 5866 | ;; "architecture", "configuration", "entity", "package", | 5986 | ;; "architecture", "configuration", "context", "entity", "package", |
| 5867 | ;; "procedure", "function": | 5987 | ;; "procedure", "function": |
| 5868 | "is")))) | 5988 | "is")))) |
| 5869 | 5989 | ||
| @@ -5884,7 +6004,7 @@ vhdl-begin-fwd-re, and are not inside a literal, and that we are not in | |||
| 5884 | the middle of an identifier that just happens to contain a \"begin\" | 6004 | the middle of an identifier that just happens to contain a \"begin\" |
| 5885 | keyword." | 6005 | keyword." |
| 5886 | (cond | 6006 | (cond |
| 5887 | ;; "[architecture|case|configuration|entity|package| | 6007 | ;; "[architecture|case|configuration|context|entity|package| |
| 5888 | ;; procedure|function] ... is": | 6008 | ;; procedure|function] ... is": |
| 5889 | ((and (looking-at "i") | 6009 | ((and (looking-at "i") |
| 5890 | (save-excursion | 6010 | (save-excursion |
| @@ -5897,7 +6017,7 @@ keyword." | |||
| 5897 | (let (foundp) | 6017 | (let (foundp) |
| 5898 | (while (and (not foundp) | 6018 | (while (and (not foundp) |
| 5899 | (re-search-backward | 6019 | (re-search-backward |
| 5900 | ";\\|\\b\\(architecture\\|case\\|configuration\\|entity\\|package\\|procedure\\|return\\|is\\|begin\\|process\\|procedural\\|block\\)\\b[^_]" | 6020 | ";\\|\\b\\(architecture\\|case\\|configuration\\|context\\|entity\\|package\\|procedure\\|return\\|is\\|begin\\|process\\|procedural\\|block\\)\\b[^_]" |
| 5901 | lim 'move)) | 6021 | lim 'move)) |
| 5902 | (if (or (= (preceding-char) ?_) | 6022 | (if (or (= (preceding-char) ?_) |
| 5903 | (vhdl-in-literal)) | 6023 | (vhdl-in-literal)) |
| @@ -6092,7 +6212,7 @@ of an identifier that just happens to contain an \"end\" keyword." | |||
| 6092 | (vector "for" (vhdl-first-word pos) nil nil)) | 6212 | (vector "for" (vhdl-first-word pos) nil nil)) |
| 6093 | ;; "end [id]": | 6213 | ;; "end [id]": |
| 6094 | (t | 6214 | (t |
| 6095 | (vector "begin\\|architecture\\|configuration\\|entity\\|package\\|procedure\\|function" | 6215 | (vector "begin\\|architecture\\|configuration\\|context\\|entity\\|package\\|procedure\\|function" |
| 6096 | (vhdl-first-word pos) | 6216 | (vhdl-first-word pos) |
| 6097 | ;; return an alist of (statement . keyword) mappings | 6217 | ;; return an alist of (statement . keyword) mappings |
| 6098 | '( | 6218 | '( |
| @@ -6102,6 +6222,8 @@ of an identifier that just happens to contain an \"end\" keyword." | |||
| 6102 | ("architecture" . "is") | 6222 | ("architecture" . "is") |
| 6103 | ;; "configuration ... is ... end [id]": | 6223 | ;; "configuration ... is ... end [id]": |
| 6104 | ("configuration" . "is") | 6224 | ("configuration" . "is") |
| 6225 | ;; "context ... is ... end [id]": | ||
| 6226 | ("context" . "is") | ||
| 6105 | ;; "entity ... is ... end [id]": | 6227 | ;; "entity ... is ... end [id]": |
| 6106 | ("entity" . "is") | 6228 | ("entity" . "is") |
| 6107 | ;; "package ... is ... end [id]": | 6229 | ;; "package ... is ... end [id]": |
| @@ -6716,7 +6838,8 @@ keyword at PLACEHOLDER, then return the library unit type." | |||
| 6716 | (cond | 6838 | (cond |
| 6717 | ((looking-at "e") 'entity) | 6839 | ((looking-at "e") 'entity) |
| 6718 | ((looking-at "a") 'architecture) | 6840 | ((looking-at "a") 'architecture) |
| 6719 | ((looking-at "c") 'configuration) | 6841 | ((looking-at "conf") 'configuration) |
| 6842 | ((looking-at "cont") 'context) | ||
| 6720 | ((looking-at "p") | 6843 | ((looking-at "p") |
| 6721 | (save-excursion | 6844 | (save-excursion |
| 6722 | (goto-char bod) | 6845 | (goto-char bod) |
| @@ -6992,7 +7115,7 @@ is not moved." | |||
| 6992 | (goto-char (1+ containing-sexp)) | 7115 | (goto-char (1+ containing-sexp)) |
| 6993 | (skip-chars-forward " \t") | 7116 | (skip-chars-forward " \t") |
| 6994 | (not (eolp)) | 7117 | (not (eolp)) |
| 6995 | (not (looking-at "--"))) | 7118 | (not (looking-at "--\\|`"))) |
| 6996 | (save-excursion | 7119 | (save-excursion |
| 6997 | (vhdl-beginning-of-statement-1 containing-sexp) | 7120 | (vhdl-beginning-of-statement-1 containing-sexp) |
| 6998 | (skip-chars-backward " \t(") | 7121 | (skip-chars-backward " \t(") |
| @@ -7141,8 +7264,10 @@ is not moved." | |||
| 7141 | ;; now we need to look at any modifiers | 7264 | ;; now we need to look at any modifiers |
| 7142 | (goto-char indent-point) | 7265 | (goto-char indent-point) |
| 7143 | (skip-chars-forward " \t") | 7266 | (skip-chars-forward " \t") |
| 7144 | (if (looking-at "--") | 7267 | (if (or (looking-at "--") (looking-at "/\\*")) |
| 7145 | (vhdl-add-syntax 'comment)) | 7268 | (vhdl-add-syntax 'comment)) |
| 7269 | (if (looking-at "`") | ||
| 7270 | (vhdl-add-syntax 'directive)) | ||
| 7146 | (if (eq literal 'pound) | 7271 | (if (eq literal 'pound) |
| 7147 | (vhdl-add-syntax 'cpp-macro)) | 7272 | (vhdl-add-syntax 'cpp-macro)) |
| 7148 | ;; return the syntax | 7273 | ;; return the syntax |
| @@ -7216,8 +7341,12 @@ only-lines." | |||
| 7216 | (vhdl-comment-indent) | 7341 | (vhdl-comment-indent) |
| 7217 | ;; otherwise, indent as specified by vhdl-comment-only-line-offset | 7342 | ;; otherwise, indent as specified by vhdl-comment-only-line-offset |
| 7218 | (if (not (bolp)) | 7343 | (if (not (bolp)) |
| 7344 | ;; inside multi-line comment | ||
| 7345 | (if (looking-at "\\*") | ||
| 7346 | 1 | ||
| 7347 | ;; otherwise | ||
| 7219 | (or (car-safe vhdl-comment-only-line-offset) | 7348 | (or (car-safe vhdl-comment-only-line-offset) |
| 7220 | vhdl-comment-only-line-offset) | 7349 | vhdl-comment-only-line-offset)) |
| 7221 | (or (cdr-safe vhdl-comment-only-line-offset) | 7350 | (or (cdr-safe vhdl-comment-only-line-offset) |
| 7222 | (car-safe vhdl-comment-only-line-offset) | 7351 | (car-safe vhdl-comment-only-line-offset) |
| 7223 | -1000 ;jam it against the left side | 7352 | -1000 ;jam it against the left side |
| @@ -7457,7 +7586,7 @@ ENDPOS is encountered." | |||
| 7457 | (mapc | 7586 | (mapc |
| 7458 | (function | 7587 | (function |
| 7459 | (lambda (elt) | 7588 | (lambda (elt) |
| 7460 | (if (memq (car elt) '(entity configuration package | 7589 | (if (memq (car elt) '(entity configuration context package |
| 7461 | package-body architecture)) | 7590 | package-body architecture)) |
| 7462 | nil | 7591 | nil |
| 7463 | (setq expurgated (append expurgated (list elt)))))) | 7592 | (setq expurgated (append expurgated (list elt)))))) |
| @@ -7787,7 +7916,7 @@ the token in MATCH." | |||
| 7787 | (vhdl-prepare-search-2 | 7916 | (vhdl-prepare-search-2 |
| 7788 | (save-excursion | 7917 | (save-excursion |
| 7789 | ;; search for declarative part | 7918 | ;; search for declarative part |
| 7790 | (when (and (re-search-backward "^\\(architecture\\|begin\\|configuration\\|end\\|entity\\|package\\)\\>" nil t) | 7919 | (when (and (re-search-backward "^\\(architecture\\|begin\\|configuration\\|context\\|end\\|entity\\|package\\)\\>" nil t) |
| 7791 | (not (member (upcase (match-string 1)) '("BEGIN" "END")))) | 7920 | (not (member (upcase (match-string 1)) '("BEGIN" "END")))) |
| 7792 | (setq beg (point)) | 7921 | (setq beg (point)) |
| 7793 | (re-search-forward "^\\(begin\\|end\\)\\>" nil t) | 7922 | (re-search-forward "^\\(begin\\|end\\)\\>" nil t) |
| @@ -9137,6 +9266,27 @@ a configuration declaration if not within a design unit." | |||
| 9137 | (insert ";") | 9266 | (insert ";") |
| 9138 | (vhdl-comment-insert-inline)))))) | 9267 | (vhdl-comment-insert-inline)))))) |
| 9139 | 9268 | ||
| 9269 | (defun vhdl-template-context () | ||
| 9270 | "Insert a context declaration." | ||
| 9271 | (interactive) | ||
| 9272 | (let ((margin (current-indentation)) | ||
| 9273 | (start (point)) | ||
| 9274 | entity-exists string name position) | ||
| 9275 | (vhdl-insert-keyword "CONTEXT ") | ||
| 9276 | (when (setq name (vhdl-template-field "name" nil t start (point))) | ||
| 9277 | (vhdl-insert-keyword " IS\n") | ||
| 9278 | (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n")) | ||
| 9279 | (indent-to (+ margin vhdl-basic-offset)) | ||
| 9280 | (setq position (point)) | ||
| 9281 | (insert "\n") | ||
| 9282 | (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n")) | ||
| 9283 | (indent-to margin) | ||
| 9284 | (vhdl-insert-keyword "END ") | ||
| 9285 | (unless (vhdl-standard-p '87) | ||
| 9286 | (vhdl-insert-keyword "CONTEXT ")) | ||
| 9287 | (insert name ";") | ||
| 9288 | (goto-char position)))) | ||
| 9289 | |||
| 9140 | (defun vhdl-template-default () | 9290 | (defun vhdl-template-default () |
| 9141 | "Insert nothing." | 9291 | "Insert nothing." |
| 9142 | (interactive) | 9292 | (interactive) |
| @@ -9798,8 +9948,10 @@ otherwise." | |||
| 9798 | (forward-char 1)) | 9948 | (forward-char 1)) |
| 9799 | (insert "(") | 9949 | (insert "(") |
| 9800 | (if (not seq) | 9950 | (if (not seq) |
| 9801 | (unless (setq input-signals | 9951 | (unless (or (and (vhdl-standard-p '08) vhdl-sensitivity-list-all |
| 9802 | (vhdl-template-field "[sensitivity list]" ")" t)) | 9952 | (progn (insert "all)") (setq input-signals "all"))) |
| 9953 | (setq input-signals | ||
| 9954 | (vhdl-template-field "[sensitivity list]" ")" t))) | ||
| 9803 | (setq input-signals "") | 9955 | (setq input-signals "") |
| 9804 | (delete-char -2)) | 9956 | (delete-char -2)) |
| 9805 | (setq clock (or (and (not (equal "" vhdl-clock-name)) | 9957 | (setq clock (or (and (not (equal "" vhdl-clock-name)) |
| @@ -10533,7 +10685,8 @@ specification, if not already there." | |||
| 10533 | (while (search-forward "<standard>" end t) | 10685 | (while (search-forward "<standard>" end t) |
| 10534 | (replace-match | 10686 | (replace-match |
| 10535 | (concat "VHDL" (cond ((vhdl-standard-p '87) "'87") | 10687 | (concat "VHDL" (cond ((vhdl-standard-p '87) "'87") |
| 10536 | ((vhdl-standard-p '93) "'93/02")) | 10688 | ((vhdl-standard-p '93) "'93/02") |
| 10689 | ((vhdl-standard-p '08) "'08")) | ||
| 10537 | (when (vhdl-standard-p 'ams) ", VHDL-AMS") | 10690 | (when (vhdl-standard-p 'ams) ", VHDL-AMS") |
| 10538 | (when (vhdl-standard-p 'math) ", Math Packages")) t t)) | 10691 | (when (vhdl-standard-p 'math) ", Math Packages")) t t)) |
| 10539 | (goto-char beg) | 10692 | (goto-char beg) |
| @@ -11071,7 +11224,7 @@ else insert tab (used for word completion in VHDL minibuffer)." | |||
| 11071 | (save-excursion | 11224 | (save-excursion |
| 11072 | (beginning-of-line) | 11225 | (beginning-of-line) |
| 11073 | ;; search backward for block beginning or end | 11226 | ;; search backward for block beginning or end |
| 11074 | (while (or (while (and (setq pos (re-search-backward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n\r\f]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|entity\\|package\\(\\s-+body\\)?\\|type[ \t\n\r\f]+\\w+[ \t\n\r\f]+is[ \t\n\r\f]+\\(record\\|protected\\(\\s-+body\\)?\\)\\|units\\)\\|\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(postponed[ \t\n\r\f]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\|loop\\)\\)\\>" nil t)) | 11227 | (while (or (while (and (setq pos (re-search-backward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n\r\f]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|context\\|entity\\|package\\(\\s-+body\\)?\\|type[ \t\n\r\f]+\\w+[ \t\n\r\f]+is[ \t\n\r\f]+\\(record\\|protected\\(\\s-+body\\)?\\)\\|units\\)\\|\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(postponed[ \t\n\r\f]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\|loop\\)\\)\\>" nil t)) |
| 11075 | ;; not consider subprogram declarations | 11228 | ;; not consider subprogram declarations |
| 11076 | (or (and (match-string 5) | 11229 | (or (and (match-string 5) |
| 11077 | (save-match-data | 11230 | (save-match-data |
| @@ -11102,7 +11255,7 @@ else insert tab (used for word completion in VHDL minibuffer)." | |||
| 11102 | (save-excursion | 11255 | (save-excursion |
| 11103 | (end-of-line) | 11256 | (end-of-line) |
| 11104 | ;; search forward for block beginning or end | 11257 | ;; search forward for block beginning or end |
| 11105 | (while (or (while (and (setq pos (re-search-forward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n\r\f]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|entity\\|package\\(\\s-+body\\)?\\|type[ \t\n\r\f]+\\w+[ \t\n\r\f]+is[ \t\n\r\f]+\\(record\\|protected\\(\\s-+body\\)?\\)\\|units\\)\\|\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(postponed[ \t\n\r\f]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\|loop\\)\\)\\>" nil t)) | 11258 | (while (or (while (and (setq pos (re-search-forward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n\r\f]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|context\\|entity\\|package\\(\\s-+body\\)?\\|type[ \t\n\r\f]+\\w+[ \t\n\r\f]+is[ \t\n\r\f]+\\(record\\|protected\\(\\s-+body\\)?\\)\\|units\\)\\|\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(postponed[ \t\n\r\f]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\|loop\\)\\)\\>" nil t)) |
| 11106 | ;; not consider subprogram declarations | 11259 | ;; not consider subprogram declarations |
| 11107 | (or (and (match-string 5) | 11260 | (or (and (match-string 5) |
| 11108 | (save-match-data | 11261 | (save-match-data |
| @@ -11203,6 +11356,8 @@ but not if inside a comment or quote." | |||
| 11203 | (vhdl-hooked-abbrev 'vhdl-template-configuration)) | 11356 | (vhdl-hooked-abbrev 'vhdl-template-configuration)) |
| 11204 | (defun vhdl-template-constant-hook () | 11357 | (defun vhdl-template-constant-hook () |
| 11205 | (vhdl-hooked-abbrev 'vhdl-template-constant)) | 11358 | (vhdl-hooked-abbrev 'vhdl-template-constant)) |
| 11359 | (defun vhdl-template-context-hook () | ||
| 11360 | (vhdl-hooked-abbrev 'vhdl-template-context)) | ||
| 11206 | (defun vhdl-template-disconnect-hook () | 11361 | (defun vhdl-template-disconnect-hook () |
| 11207 | (vhdl-hooked-abbrev 'vhdl-template-disconnect)) | 11362 | (vhdl-hooked-abbrev 'vhdl-template-disconnect)) |
| 11208 | (defun vhdl-template-display-comment-hook () | 11363 | (defun vhdl-template-display-comment-hook () |
| @@ -13190,7 +13345,8 @@ This does highlighting of keywords and standard identifiers.") | |||
| 13190 | (list | 13345 | (list |
| 13191 | (concat | 13346 | (concat |
| 13192 | "^\\s-*\\(" | 13347 | "^\\s-*\\(" |
| 13193 | "architecture\\|configuration\\|entity\\|package\\(\\s-+body\\)?\\|" | 13348 | "architecture\\|configuration\\|context\\|entity\\|package" |
| 13349 | "\\(\\s-+body\\)?\\|" | ||
| 13194 | "\\(\\(impure\\|pure\\)\\s-+\\)?function\\|procedure\\|component" | 13350 | "\\(\\(impure\\|pure\\)\\s-+\\)?function\\|procedure\\|component" |
| 13195 | "\\)\\s-+\\(\\w+\\)") | 13351 | "\\)\\s-+\\(\\w+\\)") |
| 13196 | 5 'font-lock-function-name-face) | 13352 | 5 'font-lock-function-name-face) |
| @@ -13232,9 +13388,9 @@ This does highlighting of keywords and standard identifiers.") | |||
| 13232 | (list | 13388 | (list |
| 13233 | (concat | 13389 | (concat |
| 13234 | "^\\s-*end\\s-+\\(\\(" | 13390 | "^\\s-*end\\s-+\\(\\(" |
| 13235 | "architecture\\|block\\|case\\|component\\|configuration\\|entity\\|" | 13391 | "architecture\\|block\\|case\\|component\\|configuration\\|context\\|" |
| 13236 | "for\\|function\\|generate\\|if\\|loop\\|package\\(\\s-+body\\)?\\|" | 13392 | "entity\\|for\\|function\\|generate\\|if\\|loop\\|package" |
| 13237 | "procedure\\|\\(postponed\\s-+\\)?process\\|" | 13393 | "\\(\\s-+body\\)?\\|procedure\\|\\(postponed\\s-+\\)?process\\|" |
| 13238 | (when (vhdl-standard-p 'ams) "procedural\\|") | 13394 | (when (vhdl-standard-p 'ams) "procedural\\|") |
| 13239 | "units" | 13395 | "units" |
| 13240 | "\\)\\s-+\\)?\\(\\w*\\)") | 13396 | "\\)\\s-+\\)?\\(\\w*\\)") |
| @@ -13266,10 +13422,10 @@ This does highlighting of keywords and standard identifiers.") | |||
| 13266 | ;; highlight names in use clauses | 13422 | ;; highlight names in use clauses |
| 13267 | (list | 13423 | (list |
| 13268 | (concat | 13424 | (concat |
| 13269 | "\\<use\\s-+\\(\\(entity\\|configuration\\)\\s-+\\)?" | 13425 | "\\<\\(context\\|use\\)\\s-+\\(\\(entity\\|configuration\\)\\s-+\\)?" |
| 13270 | "\\(\\w+\\)\\(\\.\\(\\w+\\)\\)?\\((\\(\\w+\\))\\)?") | 13426 | "\\(\\w+\\)\\(\\.\\(\\w+\\)\\)?\\((\\(\\w+\\))\\)?") |
| 13271 | '(3 font-lock-function-name-face) '(5 font-lock-function-name-face nil t) | 13427 | '(4 font-lock-function-name-face) '(6 font-lock-function-name-face nil t) |
| 13272 | '(7 font-lock-function-name-face nil t)) | 13428 | '(8 font-lock-function-name-face nil t)) |
| 13273 | 13429 | ||
| 13274 | ;; highlight attribute name in attribute declarations/specifications | 13430 | ;; highlight attribute name in attribute declarations/specifications |
| 13275 | (list | 13431 | (list |
| @@ -13316,6 +13472,12 @@ This does highlighting of keywords and standard identifiers.") | |||
| 13316 | '(vhdl-font-lock-match-item | 13472 | '(vhdl-font-lock-match-item |
| 13317 | (progn (goto-char (match-end 1)) (match-beginning 2)) | 13473 | (progn (goto-char (match-end 1)) (match-beginning 2)) |
| 13318 | nil (1 font-lock-variable-name-face))) | 13474 | nil (1 font-lock-variable-name-face))) |
| 13475 | |||
| 13476 | ;; highlight tool directives | ||
| 13477 | (list | ||
| 13478 | (concat | ||
| 13479 | "^\\s-*\\(`\\w+\\)") | ||
| 13480 | 1 'font-lock-preprocessor-face) | ||
| 13319 | ) | 13481 | ) |
| 13320 | "For consideration as a value of `vhdl-font-lock-keywords'. | 13482 | "For consideration as a value of `vhdl-font-lock-keywords'. |
| 13321 | This does context sensitive highlighting of names and labels.") | 13483 | This does context sensitive highlighting of names and labels.") |
| @@ -13661,7 +13823,7 @@ hierarchy otherwise.") | |||
| 13661 | "Return position of end of current unit." | 13823 | "Return position of end of current unit." |
| 13662 | (let ((pos (point))) | 13824 | (let ((pos (point))) |
| 13663 | (save-excursion | 13825 | (save-excursion |
| 13664 | (while (and (re-search-forward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil 1) | 13826 | (while (and (re-search-forward "^[ \t]*\\(architecture\\|configuration\\|context\\|entity\\|package\\)\\>" nil 1) |
| 13665 | (save-excursion | 13827 | (save-excursion |
| 13666 | (goto-char (match-beginning 0)) | 13828 | (goto-char (match-beginning 0)) |
| 13667 | (vhdl-backward-syntactic-ws) | 13829 | (vhdl-backward-syntactic-ws) |
| @@ -13682,7 +13844,7 @@ hierarchy otherwise.") | |||
| 13682 | "Scan the context clause that precedes a design unit." | 13844 | "Scan the context clause that precedes a design unit." |
| 13683 | (let (lib-alist) | 13845 | (let (lib-alist) |
| 13684 | (save-excursion | 13846 | (save-excursion |
| 13685 | (when (re-search-backward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil t) | 13847 | (when (re-search-backward "^[ \t]*\\(architecture\\|configuration\\|context\\|entity\\|package\\)\\>" nil t) |
| 13686 | (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t) | 13848 | (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t) |
| 13687 | (equal "USE" (upcase (match-string 1)))) | 13849 | (equal "USE" (upcase (match-string 1)))) |
| 13688 | (when (looking-at "^[ \t]*use[ \t\n\r\f]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+") | 13850 | (when (looking-at "^[ \t]*use[ \t\n\r\f]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+") |
| @@ -17502,6 +17664,7 @@ specified by a target." | |||
| 17502 | 'vhdl-argument-list-indent | 17664 | 'vhdl-argument-list-indent |
| 17503 | 'vhdl-association-list-with-formals | 17665 | 'vhdl-association-list-with-formals |
| 17504 | 'vhdl-conditions-in-parenthesis | 17666 | 'vhdl-conditions-in-parenthesis |
| 17667 | 'vhdl-sensitivity-list-all | ||
| 17505 | 'vhdl-zero-string | 17668 | 'vhdl-zero-string |
| 17506 | 'vhdl-one-string | 17669 | 'vhdl-one-string |
| 17507 | 'vhdl-file-header | 17670 | 'vhdl-file-header |
| @@ -17606,6 +17769,17 @@ specified by a target." | |||
| 17606 | 17769 | ||
| 17607 | (defconst vhdl-doc-release-notes nil | 17770 | (defconst vhdl-doc-release-notes nil |
| 17608 | "\ | 17771 | "\ |
| 17772 | Release Notes for VHDL Mode 3.37 | ||
| 17773 | ================================ | ||
| 17774 | |||
| 17775 | - Added support for VHDL'08: | ||
| 17776 | - New keywords, types, functions, attributes, operators, packages | ||
| 17777 | - Context declaration | ||
| 17778 | - Block comments | ||
| 17779 | - Directives | ||
| 17780 | - 'all' keyword in sensitivity list | ||
| 17781 | |||
| 17782 | |||
| 17609 | Release Notes for VHDL Mode 3.34 | 17783 | Release Notes for VHDL Mode 3.34 |
| 17610 | ================================ | 17784 | ================================ |
| 17611 | 17785 | ||
| @@ -17667,6 +17841,13 @@ User Options | |||
| 17667 | Reserved words in VHDL | 17841 | Reserved words in VHDL |
| 17668 | ---------------------- | 17842 | ---------------------- |
| 17669 | 17843 | ||
| 17844 | VHDL'08 (IEEE Std 1076-2008): | ||
| 17845 | `vhdl-08-keywords' : keywords | ||
| 17846 | `vhdl-08-types' : standardized types | ||
| 17847 | `vhdl-08-attributes' : standardized attributes | ||
| 17848 | `vhdl-08-functions' : standardized functions | ||
| 17849 | `vhdl-08-packages' : standardized packages and libraries | ||
| 17850 | |||
| 17670 | VHDL'93/02 (IEEE Std 1076-1993/2002): | 17851 | VHDL'93/02 (IEEE Std 1076-1993/2002): |
| 17671 | `vhdl-02-keywords' : keywords | 17852 | `vhdl-02-keywords' : keywords |
| 17672 | `vhdl-02-types' : standardized types | 17853 | `vhdl-02-types' : standardized types |