You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14357 lines
518 KiB
14357 lines
518 KiB
;;; web-mode.el --- major mode for editing web templates |
|
;;; -*- coding: utf-8; lexical-binding: t; -*- |
|
|
|
;; Copyright 2011-2020 François-Xavier Bois |
|
|
|
;; Version: 17.0.2 |
|
;; Package-Version: 20200826.1954 |
|
;; Package-Commit: da53553fd4e876ac121994cc48e54ab54fa3ace7 |
|
;; Author: François-Xavier Bois <fxbois AT Google Mail Service> |
|
;; Maintainer: François-Xavier Bois |
|
;; Package-Requires: ((emacs "23.1")) |
|
;; URL: http://web-mode.org |
|
;; Repository: http://github.com/fxbois/web-mode |
|
;; Created: July 2011 |
|
;; Keywords: languages |
|
;; License: GNU General Public License >= 2 |
|
;; Distribution: This file is not part of Emacs |
|
|
|
;;; Commentary: |
|
|
|
;;============================================================================== |
|
;; WEB-MODE is sponsored by ** Kernix ** Best Digital Factory & Data Lab (Paris) |
|
;;============================================================================== |
|
|
|
;;; Code: |
|
|
|
;;---- CONSTS ------------------------------------------------------------------ |
|
|
|
(defconst web-mode-version "17.0.1" |
|
"Web Mode version.") |
|
|
|
;;---- GROUPS ------------------------------------------------------------------ |
|
|
|
(defgroup web-mode nil |
|
"Major mode for editing web templates" |
|
:group 'languages |
|
:prefix "web-" |
|
:link '(url-link :tag "Site" "http://web-mode.org") |
|
:link '(url-link :tag "Repository" "https://github.com/fxbois/web-mode")) |
|
|
|
(defgroup web-mode-faces nil |
|
"Faces for syntax highlighting." |
|
:group 'web-mode |
|
:group 'faces) |
|
|
|
;;---- CUSTOMS ----------------------------------------------------------------- |
|
|
|
(defcustom web-mode-block-padding 0 |
|
"Multi-line block (php, ruby, java, python, asp, etc.) left padding. |
|
-1 to have to code aligned on the column 0." |
|
:type '(choice (integer :tags "Number of spaces") |
|
(const :tags "No indent" nil)) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-part-padding 1 |
|
"Part elements (script, style) left padding." |
|
:type '(choice (integer :tags "Number of spaces") |
|
(const :tags "No indent" nil)) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-script-padding web-mode-part-padding |
|
"Script element left padding." |
|
:type '(choice (integer :tags "Number of spaces") |
|
(const :tags "No indent" nil)) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-style-padding web-mode-part-padding |
|
"Style element left padding." |
|
:type '(choice (integer :tags "Number of spaces") |
|
(const :tags "No indent" nil)) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-attr-indent-offset nil |
|
"Html attribute indentation level." |
|
:type '(choice (integer :tags "Number of spaces") |
|
(const :tags "Default" nil)) |
|
:safe #'(lambda (v) (or (integerp v) (booleanp v))) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-attr-value-indent-offset nil |
|
"Html attribute value indentation level." |
|
:type '(choice (integer :tags "Number of spaces") |
|
(const :tags "Default" nil)) |
|
:safe #'(lambda (v) (or (integerp v) (booleanp v))) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-markup-indent-offset |
|
(if (and (boundp 'standard-indent) standard-indent) standard-indent 2) |
|
"Html indentation level." |
|
:type 'integer |
|
:safe #'integerp |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-css-indent-offset |
|
(if (and (boundp 'standard-indent) standard-indent) standard-indent 2) |
|
"CSS indentation level." |
|
:type 'integer |
|
:safe #'integerp |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-code-indent-offset |
|
(if (and (boundp 'standard-indent) standard-indent) standard-indent 2) |
|
"Code (javascript, php, etc.) indentation level." |
|
:type 'integer |
|
:safe #'integerp |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-sql-indent-offset 4 |
|
"Sql (inside strings) indentation level." |
|
:type 'integer |
|
:safe #'integerp |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-css-colorization (display-graphic-p) |
|
"In a CSS part, set background according to the color: #xxx, rgb(x,x,x)." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-comment-interpolation nil |
|
"Enable highlight of keywords like FIXME, TODO, etc. in comments." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-comment-annotation nil |
|
"Enable annotation in comments (jsdoc, phpdoc, etc.)." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-auto-indentation (display-graphic-p) |
|
"Auto-indentation." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-auto-closing (display-graphic-p) |
|
"Auto-closing." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-auto-pairing (display-graphic-p) |
|
"Auto-pairing." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-auto-opening (display-graphic-p) |
|
"Html element auto-opening." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-auto-quoting (display-graphic-p) |
|
"Add double quotes after the character = in a tag." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-auto-expanding nil |
|
"e.g. s/ expands to <span>|</span>." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-control-block-indentation t |
|
"Control blocks increase indentation." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-current-element-highlight nil |
|
"Enable current element highlight." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-current-column-highlight nil |
|
"Show column for current element." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-whitespace-fontification nil |
|
"Enable whitespaces." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-html-entities-fontification nil |
|
"Enable html entities fontification." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-block-face nil |
|
"Enable block face (useful for setting a background for example). |
|
See web-mode-block-face." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-part-face nil |
|
"Enable part face (useful for setting background of <style> or <script> |
|
elements for example). See web-mode-part-face." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-inlays nil |
|
"Enable inlays (e.g. LaTeX) highlighting." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-sexp-functions t |
|
"Enable specific sexp functions." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-string-interpolation t |
|
"Enable string interpolation fontification (php and erb)." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-literal-interpolation t |
|
"Enable template literal fontification. e.g. css` `." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-sql-detection nil |
|
"Enable fontification and indentation of sql queries in strings." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-heredoc-fontification t |
|
"Enable heredoc fontification. The identifier should contain JS, JAVASCRIPT, CSS or HTML." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-element-content-fontification nil |
|
"Enable element content fontification. The content of an element can have a face associated." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-element-tag-fontification nil |
|
"Enable tag name fontification." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-front-matter-block nil |
|
"Enable front matter block (data at the beginning the template between --- and ---)." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-engine-detection nil |
|
"Detect such directive -*- engine: ENGINE -*- at the top of the file." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-enable-optional-tags nil |
|
"Enable omission of certain closing tags (e.g. a li open tag followed by a li open tag is valid)." |
|
:type 'boolean |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-comment-style 1 |
|
"Comment style : 1 = default, 2 = force server comments outside a block." |
|
:group 'web-mode |
|
:type '(choice (const :tag "Default" 1) |
|
(const :tag "Force engine comments" 2))) |
|
|
|
(defcustom web-mode-indent-style 2 |
|
"Indentation style." |
|
:group 'web-mode |
|
:type '(choice (const :tag "Default (all lines are indented)" 2) |
|
(const :tag "Text at the beginning of line is not indented" 1))) |
|
|
|
(defcustom web-mode-auto-close-style 1 |
|
"Auto-close style." |
|
:group 'web-mode |
|
:type '(choice (const :tag "Auto-close on </" 1) |
|
(const :tag "Auto-close on > and </" 2) |
|
(const :tag "Auto-close on < and >/>" 3))) |
|
|
|
(defcustom web-mode-auto-quote-style 1 |
|
"Auto-quoting style." |
|
:group 'web-mode |
|
:type '(choice (const :tag "Auto-quotes with double quote" 1) |
|
(const :tag "Auto-quotes with single quote" 2) |
|
(const :tag "Auto-quotes with paren (for jsx)" 3))) |
|
|
|
(defcustom web-mode-extra-expanders '() |
|
"A list of additional expanders." |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-extra-auto-pairs '() |
|
"A list of additional auto-pairs." |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-extra-snippets '() |
|
"A list of additional snippets." |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-extra-builtins '() |
|
"A list of additional builtins." |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-extra-constants '() |
|
"A list of additional constants." |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-extra-keywords '() |
|
"A list of additional keywords." |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-extra-types '() |
|
"A list of additional types." |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-extra-control-blocks '() |
|
"A list of additional control blocks." |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-tests-directory (concat default-directory "tests/") |
|
"Directory containing all the unit tests." |
|
:type 'directory |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-jsx-depth-faces |
|
nil |
|
;;'(web-mode-jsx-depth-1-face web-mode-jsx-depth-2-face web-mode-jsx-depth-3-face web-mode-jsx-depth-4-face web-mode-jsx-depth-5-face) |
|
"Each jsx depth has is own face." |
|
:type '(repeat face) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-commands-like-expand-region |
|
'(web-mode-mark-and-expand er/expand-region mc/mark-next-like-this) |
|
"Add it to here if you have some wrapper function for er/expand-region" |
|
:type '(repeat function) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-comment-formats |
|
'(("java" . "/*") |
|
("javascript" . "/*") |
|
("typescript" . "//") |
|
("php" . "/*") |
|
("css" . "/*")) |
|
"Default comment format for a language" |
|
:type '(alist :key-type string :value-type string) |
|
:group 'web-mode) |
|
|
|
(defcustom web-mode-script-template-types |
|
'("text/x-handlebars" |
|
"text/x-jquery-tmpl" |
|
"text/x-jsrender" |
|
"text/html" |
|
"text/ng-template" |
|
"text/x-template" |
|
"text/mustache" |
|
"text/x-dust-template") |
|
"<script> block types that are interpreted as HTML." |
|
:type '(repeat string) |
|
:group 'web-mode) |
|
|
|
;;---- FACES ------------------------------------------------------------------- |
|
|
|
(defface web-mode-error-face |
|
'((t :background "red")) |
|
"Face for warning." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-warning-face |
|
'((t :inherit font-lock-warning-face)) |
|
"Face for warning." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-preprocessor-face |
|
'((t :inherit font-lock-preprocessor-face)) |
|
"Face for preprocessor commands." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-preprocessor-face |
|
'((t :inherit font-lock-preprocessor-face)) |
|
"Face for preprocessor." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-block-delimiter-face |
|
'((t :inherit font-lock-preprocessor-face)) |
|
"Face for block delimiters." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-block-control-face |
|
'((t :inherit font-lock-preprocessor-face)) |
|
"Face for preprocessor." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-builtin-face |
|
'((t :inherit font-lock-builtin-face)) |
|
"Face for builtins." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-symbol-face |
|
'((t :foreground "goldenrod2")) |
|
"Face for symbols." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-doctype-face |
|
'((t :foreground "Grey")) |
|
"Face for html doctype." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-tag-face |
|
'((((class color) (min-colors 88) (background dark)) :foreground "Snow4") |
|
(((class color) (min-colors 88) (background light)) :foreground "Snow4") |
|
(((class color) (min-colors 16) (background dark)) :foreground "Snow4") |
|
(((class color) (min-colors 16) (background light)) :foreground "Grey15") |
|
(((class color) (min-colors 8)) :foreground "Snow4") |
|
(((type tty) (class mono)) :inverse-video t) |
|
(t :foreground "Snow4")) |
|
"Face for html tags." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-tag-custom-face |
|
'((t :inherit web-mode-html-tag-face)) |
|
"Face for html custom tags (e.g. <polymer-element>)." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-tag-unclosed-face |
|
'((t :inherit web-mode-html-tag-face :underline t)) |
|
"Face for unclosed tags." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-tag-namespaced-face |
|
'((t :inherit web-mode-block-control-face)) |
|
"Face for html namespaced tags (e.g. <c:forEach>)." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-tag-bracket-face |
|
'((((class color) (min-colors 88) (background dark)) :foreground "Snow3") |
|
(((class color) (min-colors 88) (background light)) :foreground "Grey14") |
|
(((class color) (min-colors 16) (background dark)) :foreground "Snow3") |
|
(((class color) (min-colors 16) (background light)) :foreground "Grey14") |
|
(((class color) (min-colors 8)) :foreground "Snow3") |
|
(((type tty) (class mono)) :inverse-video t) |
|
(t :foreground "Snow3")) |
|
"Face for html tags angle brackets (<, > and />)." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-attr-name-face |
|
'((((class color) (min-colors 88) (background dark)) :foreground "Snow3") |
|
(((class color) (min-colors 88) (background light)) :foreground "Snow4") |
|
(((class color) (min-colors 16) (background dark)) :foreground "Snow3") |
|
(((class color) (min-colors 16) (background light)) :foreground "Grey13") |
|
(((class color) (min-colors 8)) :foreground "Snow3") |
|
(((type tty) (class mono)) :inverse-video t) |
|
(t :foreground "Snow4")) |
|
"Face for html attribute names." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-attr-custom-face |
|
'((t :inherit web-mode-html-attr-name-face)) |
|
"Face for custom attribute names (e.g. data-*)." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-attr-engine-face |
|
'((t :inherit web-mode-block-delimiter-face)) |
|
"Face for custom engine attribute names (e.g. ng-*)." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-attr-equal-face |
|
'((t :inherit web-mode-html-attr-name-face)) |
|
"Face for the = character between name and value." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-attr-value-face |
|
'((t :inherit font-lock-string-face)) |
|
"Face for html attribute values." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-block-attr-name-face |
|
'((t :foreground "#8fbc8f")) |
|
"Face for block attribute names." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-block-attr-value-face |
|
'((t :foreground "#5f9ea0")) |
|
"Face for block attribute values." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-variable-name-face |
|
'((t :inherit font-lock-variable-name-face)) |
|
"Face for variable names." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-selector-face |
|
'((t :inherit font-lock-keyword-face)) |
|
"Face for CSS rules." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-pseudo-class-face |
|
'((t :inherit font-lock-builtin-face)) |
|
"Face for CSS pseudo-classes." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-at-rule-face |
|
'((t :inherit font-lock-constant-face)) |
|
"Face for CSS at-rules." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-property-name-face |
|
'((t :inherit font-lock-variable-name-face)) |
|
"Face for CSS props." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-color-face |
|
'((t :inherit font-lock-builtin-face)) |
|
"Face for CSS colors (#xxx)." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-priority-face |
|
'((t :inherit font-lock-builtin-face)) |
|
"Face for CSS priority (!important)." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-function-face |
|
'((t :inherit font-lock-builtin-face)) |
|
"Face for CSS functions." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-variable-face |
|
'((t :inherit web-mode-variable-name-face :slant italic)) |
|
"Face for CSS vars." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-function-name-face |
|
'((t :inherit font-lock-function-name-face)) |
|
"Face for function names." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-filter-face |
|
'((t :inherit font-lock-function-name-face)) |
|
"Face for function names." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-function-call-face |
|
'((t :inherit font-lock-function-name-face)) |
|
"Face for function calls." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-string-face |
|
'((t :inherit font-lock-string-face)) |
|
"Face for strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-block-string-face |
|
'((t :inherit web-mode-string-face)) |
|
"Face for block strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-part-string-face |
|
'((t :inherit web-mode-string-face)) |
|
"Face for part strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-javascript-string-face |
|
'((t :inherit web-mode-string-face)) |
|
"Face for javascript strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-interpolate-color1-face |
|
'((t :inherit web-mode-string-face)) |
|
"Face for element interpolation strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-interpolate-color2-face |
|
'((t :inherit web-mode-string-face)) |
|
"Face for element interpolation strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-interpolate-color3-face |
|
'((t :inherit web-mode-string-face)) |
|
"Face for element interpolation strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-string-face |
|
'((t :inherit web-mode-string-face)) |
|
"Face for css strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-json-key-face |
|
'((t :foreground "plum")) |
|
"Face for json key strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-json-context-face |
|
'((t :foreground "orchid3")) |
|
"Face for json context strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-json-string-face |
|
'((t :inherit web-mode-string-face)) |
|
"Face for json strings." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-comment-face |
|
'((t :inherit font-lock-comment-face)) |
|
"Face for comments." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-block-comment-face |
|
'((t :inherit web-mode-comment-face)) |
|
"Face for server comments." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-part-comment-face |
|
'((t :inherit web-mode-comment-face)) |
|
"Face for part comments." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-json-comment-face |
|
'((t :inherit web-mode-comment-face)) |
|
"Face for json comments." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-javascript-comment-face |
|
'((t :inherit web-mode-comment-face)) |
|
"Face for javascript comments." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-css-comment-face |
|
'((t :inherit web-mode-comment-face)) |
|
"Face for css comments." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-annotation-face |
|
'((t :inherit web-mode-comment-face)) |
|
"Face for code annotations." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-annotation-tag-face |
|
'((t :inherit web-mode-annotation-face :underline t)) |
|
"Face for @tags in code annotations." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-annotation-type-face |
|
'((t :inherit web-mode-annotation-face :weight bold)) |
|
"Face for types in code annotations." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-annotation-value-face |
|
'((t :inherit web-mode-annotation-face :slant italic)) |
|
"Face for values in code annotations." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-annotation-html-face |
|
'((t :inherit web-mode-annotation-face :slant italic)) |
|
"Face for HTML tags in code annotations." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-constant-face |
|
'((t :inherit font-lock-constant-face)) |
|
"Face for language constants." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-type-face |
|
'((t :inherit font-lock-type-face)) |
|
"Face for language types." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-keyword-face |
|
'((t :inherit font-lock-keyword-face)) |
|
"Face for language keywords." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-param-name-face |
|
'((t :foreground "Snow3")) |
|
"Face for server attribute names." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-whitespace-face |
|
'((t :background "DarkOrchid4")) |
|
"Face for whitespaces." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-inlay-face |
|
'((((class color) (min-colors 88) (background dark)) :background "Black") |
|
(((class color) (min-colors 88) (background light)) :background "LightYellow1") |
|
(((class color) (min-colors 16) (background dark)) :background "Brey18") |
|
(((class color) (min-colors 16) (background light)) :background "LightYellow1") |
|
(((class color) (min-colors 8)) :background "Black") |
|
(((type tty) (class mono)) :inverse-video t) |
|
(t :background "Grey")) |
|
"Face for inlays. Must be used in conjunction with web-mode-enable-inlays." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-block-face |
|
'((((class color) (min-colors 88) (background dark)) :background "Black") |
|
(((class color) (min-colors 88) (background light)) :background "LightYellow1") |
|
(((class color) (min-colors 16) (background dark)) :background "Grey18") |
|
(((class color) (min-colors 16) (background light)) :background "LightYellow1") |
|
(((class color) (min-colors 8)) :background "Black") |
|
(((type tty) (class mono)) :inverse-video t) |
|
(t :background "Grey")) |
|
"Face for blocks (useful for setting a background for example). |
|
Must be used in conjunction with web-mode-enable-block-face." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-part-face |
|
'((t :inherit web-mode-block-face)) |
|
"Face for parts." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-script-face |
|
'((t :inherit web-mode-part-face)) |
|
"Face for javascript inside a script element." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-style-face |
|
'((t :inherit web-mode-part-face)) |
|
"Face for css inside a style element." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-folded-face |
|
'((t :underline t)) |
|
"Overlay face for folded." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-bold-face |
|
'((t :weight bold)) |
|
"bold face." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-italic-face |
|
'((t :slant italic)) |
|
"bold face." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-underline-face |
|
'((t :underline t)) |
|
"bold face." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-current-element-highlight-face |
|
'((t :background "#000000" :foreground "#ffffff")) |
|
"Overlay face for element highlight." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-current-column-highlight-face |
|
'((t :background "#3e3c36")) |
|
"Overlay face for current column." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-comment-keyword-face |
|
'((t :weight bold :box t)) |
|
"Comment keywords." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-sql-keyword-face |
|
'((t :weight bold :slant italic)) |
|
"Sql keywords." |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-html-entity-face |
|
'((t :slant italic)) |
|
"Face html entities (e.g. –, é)." |
|
:group 'web-mode-faces) |
|
|
|
;; https://material.io/tools/color/#!/?view.left=0&view.right=0 |
|
(defface web-mode-jsx-depth-1-face |
|
'((t :background "#000053")) |
|
"jsx depth 1" |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-jsx-depth-2-face |
|
'((t :background "#001970")) |
|
"jsx" |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-jsx-depth-3-face |
|
'((t :background "#002984")) |
|
"jsx" |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-jsx-depth-4-face |
|
'((t :background "#49599a")) |
|
"jsx" |
|
:group 'web-mode-faces) |
|
|
|
(defface web-mode-jsx-depth-5-face |
|
'((t :background "#9499b7")) |
|
"jsx" |
|
:group 'web-mode-faces) |
|
|
|
;;---- VARS -------------------------------------------------------------------- |
|
|
|
(defvar font-lock-beg) |
|
(defvar font-lock-end) |
|
|
|
(defvar web-mode-auto-pairs nil) |
|
(defvar web-mode-block-regexp nil) |
|
(defvar web-mode-change-beg nil) |
|
(defvar web-mode-change-end nil) |
|
(defvar web-mode-chunk-length 64) |
|
(defvar web-mode-column-overlays nil) |
|
(defvar web-mode-comments-invisible nil) |
|
(defvar web-mode-content-type "") |
|
(defvar web-mode-engine nil) |
|
;;(defvar web-mode-engine-attr-regexp nil) |
|
(defvar web-mode-engine-font-lock-keywords nil) |
|
(defvar web-mode-engine-token-regexp nil) |
|
(defvar web-mode-expand-initial-pos nil) |
|
(defvar web-mode-expand-initial-scroll nil) |
|
(defvar web-mode-expand-previous-state "") |
|
;;(defvar web-mode-font-lock-keywords '(web-mode-font-lock-highlight)) |
|
(defvar web-mode-skip-fontification nil) |
|
(defvar web-mode-inlay-regexp nil) |
|
(defvar web-mode-is-scratch nil) |
|
(defvar web-mode-jshint-errors 0) |
|
(defvar web-mode-minor-engine nil) |
|
(defvar web-mode-obarray nil) |
|
(defvar web-mode-overlay-tag-start nil) |
|
(defvar web-mode-overlay-tag-end nil) |
|
(defvar web-mode-part-beg nil) |
|
(defvar web-mode-scan-beg nil) |
|
(defvar web-mode-scan-end nil) |
|
(defvar web-mode-snippets nil) |
|
(defvar web-mode-time nil) |
|
|
|
(defvar web-mode-offsetless-elements |
|
'()) |
|
|
|
(defvar web-mode-indentless-elements |
|
'("code" "pre" "textarea")) |
|
|
|
(defvar web-mode-indentless-attributes |
|
'("onclick" "onmouseover" "onmouseout" "onsubmit")) |
|
|
|
(defvar web-mode-void-elements |
|
'("area" "base" "br" "col" "command" "embed" "hr" "img" "input" "keygen" |
|
"link" "meta" "param" "source" "track" "wbr")) |
|
|
|
(defvar web-mode-part-content-types |
|
'("css" "javascript" "json" "jsx" "markdown" "pug" "ruby" |
|
"sass" "sql" "stylus" "typescript")) |
|
|
|
(defvar web-mode-javascript-languages '("javascript" "jsx" "ejs")) |
|
|
|
;; NOTE: without 'syntax-table forward-word fails (#377) |
|
(defvar web-mode-scan-properties |
|
(list 'tag-beg 'tag-end 'tag-name 'tag-type |
|
'tag-attr 'tag-attr-beg 'tag-attr-end |
|
'part-side 'part-token |
|
'jsx-beg 'jsx-end 'jsx-depth |
|
'block-side 'block-token 'block-controls 'block-beg 'block-end |
|
'syntax-table) |
|
"Text properties used for code regions/tokens and html nodes.") |
|
|
|
(defvar web-mode-start-tag-regexp "<\\([[:alpha:]][[:alnum:].:_-]*\\|>\\)" |
|
"Regular expression for HTML/XML start tag.") |
|
|
|
(defvar web-mode-tag-regexp "</?\\([[:alpha:]][[:alnum:].:_-]*\\)" |
|
"Regular expression for HTML/XML tag.") |
|
|
|
(defvar web-mode-dom-regexp "<\\(/?>\\|/?[[:alpha:]][[:alnum:].:_-]*\\|!--\\|!\\[CDATA\\[\\|!doctype\\|!DOCTYPE\\|\?xml\\)") |
|
|
|
(defvar web-mode-whitespaces-regexp |
|
"^[ \t]\\{2,\\}$\\| \t\\|\t \\|[ \t]+$\\|^[ \n\t]+\\'\\|^[ \t]?[\n]\\{2,\\}" |
|
"Regular expression for whitespaces.") |
|
|
|
(defvar web-mode-imenu-regexp-list |
|
'(("<\\(h[1-9]\\)\\([^>]*\\)>\\([^<]*\\)" 1 3 ">") |
|
("^[ \t]*<\\([@a-z]+\\)[^>]*>? *$" 1 "id=\"\\([a-zA-Z0-9_]+\\)\"" "#" ">")) |
|
"Regexps to match imenu items (see http://web-mode.org/doc/imenu.txt)") |
|
|
|
;; https://www.gnu.org/software/emacs/manual/html_node/ccmode/Syntactic-Symbols.html |
|
(defvar web-mode-indentation-params |
|
'(("lineup-args" . t) |
|
("lineup-calls" . t) |
|
("lineup-concats" . t) |
|
("lineup-quotes" . t) |
|
("lineup-ternary" . t) |
|
("case-extra-offset" . t) |
|
)) |
|
|
|
(defvar web-mode-engines |
|
'(("angular" . ("angularjs")) |
|
("archibus" . ()) |
|
("artanis" . ()) |
|
("asp" . ()) |
|
("aspx" . ()) |
|
("blade" . ("laravel")) |
|
("cl-emb" . ()) |
|
("clip" . ()) |
|
("closure" . ("soy")) |
|
("ctemplate" . ("mustache" "handlebars" "hapax" "ngtemplate" "ember" |
|
"kite" "meteor" "blaze" "ractive" "velvet")) |
|
("django" . ("dtl" "twig" "swig" "jinja" "jinja2" "erlydtl" "liquid" |
|
"clabango" "selmer" "nunjucks")) |
|
("dust" . ("dustjs")) |
|
("ejs" . ()) |
|
("elixir" . ("phoenix")) |
|
("erb" . ("eruby" "erubis")) |
|
("expressionengine" . ("ee")) |
|
("freemarker" . ()) |
|
("go" . ("gtl" "hugo")) |
|
("hero" . ()) |
|
("json-t" . ()) |
|
("jsp" . ("grails")) |
|
("mako" . ()) |
|
("marko" . ()) |
|
("mason" . ("poet")) |
|
("lsp" . ("lisp")) |
|
("mojolicious" . ()) |
|
("php" . ()) |
|
("python" . ()) |
|
("razor" . ("play" "play2")) |
|
("riot" . ()) |
|
("smarty" . ()) |
|
("spip" . ()) |
|
("svelte" . ("svelte")) |
|
("template-toolkit" . ()) |
|
("thymeleaf" . ()) |
|
("underscore" . ("underscore.js")) |
|
("velocity" . ("vtl" "cheetah" "ssp")) |
|
("vue" . ("vuejs" "vue.js")) |
|
("web2py" . ()) |
|
("xoops" . ()) |
|
) |
|
"Engine name aliases") |
|
|
|
(defvar web-mode-content-types |
|
'(("css" . "\\.\\(s?css\\|css\\.erb\\)\\'") |
|
("javascript" . "\\.\\(js\\|js\\.erb\\)\\'") |
|
("typescript" . "\\.\\(ts\\|ts\\.erb\\)\\'") |
|
("json" . "\\.\\(api\\|json\\|jsonld\\)\\'") |
|
("jsx" . "\\.[jt]sx\\'") |
|
("xml" . "\\.xml\\'") |
|
("html" . ".")) |
|
"content types") |
|
|
|
(defvar web-mode-engine-attr-regexps |
|
'(("angular" . "ng-") |
|
("thymeleaf" . "th:") |
|
("vue" . "v-")) |
|
"Engine custom attributes") |
|
|
|
(defvar web-mode-engine-attr-regexp |
|
"^ng[-]\\|^th[:]\\|^v[-]\\|^[@:#(\[*]" |
|
"Engine custom attributes") |
|
|
|
(defvar web-mode-last-enabled-feature nil) |
|
|
|
(defvar web-mode-features |
|
'(("css-colorization" . web-mode-enable-css-colorization) |
|
("element-highlight" . web-mode-enable-current-element-highlight) |
|
("column-highlight" . web-mode-enable-current-column-highlight) |
|
("whitespace-fontification" . web-mode-enable-whitespace-fontification) |
|
("element-tag-fontification" . web-mode-enable-element-tag-fontification) |
|
("block-face" . web-mode-enable-block-face) |
|
("part-face" . web-mode-enable-part-face))) |
|
|
|
(defvar web-mode-comment-prefixing t) |
|
|
|
(defvar web-mode-engine-file-regexps |
|
'(("angular" . "\\.component.html\\'") |
|
("archibus" . "\\.axvw\\'") |
|
("artanis" . "\\.html\\.tpl\\'") |
|
("asp" . "\\.asp\\'") |
|
("aspx" . "\\.as[cp]x\\'") |
|
("blade" . "\\.blade\\.php\\'") |
|
("cl-emb" . "\\.clemb\\'") |
|
("clip" . "\\.ctml\\'") |
|
("closure" . "\\.soy\\'") |
|
("ctemplate" . "\\.\\(chtml\\|mustache\\)\\'") |
|
("django" . "\\.\\(djhtml\\|tmpl\\|dtl\\|liquid\\|j2\\|njk\\)\\'") |
|
("dust" . "\\.dust\\'") |
|
("elixir" . "\\.l?eex\\'") |
|
("ejs" . "\\.ejs\\'") |
|
("erb" . "\\.\\(erb\\|rhtml\\|erb\\.html\\)\\'") |
|
("expressionengine" . "\\.ee\\'") |
|
("freemarker" . "\\.ftl\\'") |
|
("go" . "\\.go\\(html\\|tmpl\\)\\'") |
|
("handlebars" . "\\.\\(hb\\.html\\|hbs\\)\\'") |
|
("hero" . "\\.hero\\'") |
|
("jinja" . "\\.jinja\\'") |
|
("jsp" . "\\.[gj]sp\\'") |
|
("lsp" . "\\.lsp\\'") |
|
("mako" . "\\.mako?\\'") |
|
("marko" . "\\.marko\\'") |
|
("mason" . "\\.mas\\'") |
|
("mojolicious" . "\\.epl?\\'") |
|
("php" . "\\.\\(p[hs]p\\|ctp\\|inc\\)\\'") |
|
("python" . "\\.pml\\'") |
|
("razor" . "\\.\\(cs\\|vb\\)html\\|\\.razor\\'") |
|
("riot" . "\\.tag\\'") |
|
("smarty" . "\\.tpl\\'") |
|
("svelte" . "\\.svelte\\'") |
|
("template-toolkit" . "\\.tt.?\\'") |
|
("thymeleaf" . "\\.thtml\\'") |
|
("velocity" . "\\.v\\(sl\\|tl\\|m\\)\\'") |
|
("vue" . "\\.vue\\'") |
|
("xoops" . "\\.xoops'") |
|
;; regexp on the path, not just the extension |
|
("django" . "[st]wig") |
|
("razor" . "scala") |
|
("spip" . "spip") |
|
) |
|
"Engine file extensions.") |
|
|
|
(defvar web-mode-content-types-alist nil |
|
"A list of filename patterns and corresponding web-mode content types. For example, |
|
(setq web-mode-content-types-alist |
|
'((\"json\" . \"/some/path/.*\\.api\\'\") |
|
(\"jsx\" . \"/some/react/path/.*\\.js[x]?\\'\")))") |
|
|
|
(defvar web-mode-engines-alist nil |
|
"A list of filename patterns and corresponding web-mode engine. For example, |
|
(setq web-mode-engines-alist |
|
'((\"php\" . \"\\\\.phtml\\\\'\") |
|
(\"blade\" . \"\\\\.blade\\\\.\")))") |
|
|
|
(defvar web-mode-smart-quotes |
|
'("«" . "»") |
|
"Preferred smart quotes") |
|
|
|
(defvar web-mode-xml-chars |
|
'((?\& . "&") |
|
(?\< . "<") |
|
(?\> . ">")) |
|
"XML chars") |
|
|
|
(defvar web-mode-html-entities |
|
;; #985 |
|
;; remove ("gt" . 62) ("lt" . 60) ("amp" . 38) |
|
'(("AElig" . 198) ("Aacute" . 193) ("Acirc" . 194) ("Agrave" . 192) |
|
("Alpha" . 913) ("Aring" . 197) ("Atilde" . 195) ("Auml" . 196) |
|
("Beta" . 914) |
|
("Ccedil" . 199) ("Chi" . 935) |
|
("Dagger" . 8225) ("Delta" . 916) |
|
("ETH" . 208) ("Eacute" . 201) ("Ecirc" . 202) ("Egrave" . 200) |
|
("Epsilon" . 917) ("Eta" . 919) ("Euml" . 203) |
|
("Gamma" . 915) |
|
("Iacute" . 205) ("Icirc" . 206) ("Igrave" . 204) ("Iota" . 921) |
|
("Iuml" . 207) |
|
("Kappa" . 922) |
|
("Lambda" . 923) |
|
("Mu" . 924) |
|
("Ntilde" . 209) ("Nu" . 925) |
|
("OElig" . 338) ("Oacute" . 211) ("Ocirc" . 212) ("Ograve" . 210) |
|
("Omega" . 937) ("Omicron" . 927) ("Oslash" . 216) ("Otilde" . 213) |
|
("Ouml" . 214) |
|
("Phi" . 934) ("Pi" . 928) ("Prime" . 8243) ("Psi" . 936) |
|
("Rho" . 929) |
|
("Scaron" . 352) ("Sigma" . 931) |
|
("THORN" . 222) ("Tau" . 932) ("Theta" . 920) |
|
("UArr" . 8657) ("Uacute" . 218) ("Uacute" . 250) ("Ucirc" . 219) |
|
("Ugrave" . 217) ("Upsih" . 978) |
|
("Upsilon" . 933) ("Uuml" . 220) ("Uuml" . 252) |
|
("Xi" . 926) |
|
("Yacute" . 221) ("Yuml" . 376) |
|
("Zeta" . 918) |
|
("aacute" . 225) ("acirc" . 226) ("acute" . 180) ("aelig" . 230) |
|
("agrave" . 224) ("alefsym" . 8501) ("alpha" . 945) |
|
("ang" . 8736) ("apos" . 39) ("aring" . 229) ("asymp" . 8776) |
|
("atilde" . 227) ("auml" . 228) |
|
("bdquo" . 8222) ("beta" . 946) ("brvbar" . 166) ("bull" . 8226) |
|
("cap" . 8745) ("ccedil" . 231) ("cedil" . 184) ("cent" . 162) |
|
("chi" . 967) ("circ" . 710) ("clubs" . 9827) ("cong" . 8773) |
|
("copy" . 169) ("crarr" . 8629) ("cup" . 8746) ("curren" . 164) |
|
("dArr" . 8659) ("dagger" . 8224) ("darr" . 8595) ("deg" . 176) |
|
("delta" . 948) ("diams" . 9830) ("divide" . 247) |
|
("eacute" . 233) ("ecirc" . 234) ("egrave" . 232) ("empty" . 8709) |
|
("emsp" . 8195) ("ensp" . 8194) ("epsilon" . 949) ("equiv" . 8801) |
|
("eta" . 951) ("eth" . 240) ("euml" . 235) ("euro" . 8364) ("exist" . 8707) |
|
("fnof" . 402) ("forall" . 8704) ("frac12" . 189) ("frac14" . 188) |
|
("frac34" . 190) ("frasl" . 8260) |
|
("gamma" . 947) ("ge" . 8805) |
|
("hArr" . 8660) ("harr" . 8596) ("hearts" . 9829) ("hellip" . 8230) |
|
("iacute" . 237) ("icirc" . 238) ("iexcl" . 161) ("igrave" . 236) |
|
("image" . 8465) ("infin" . 8734) ("int" . 8747) ("iota" . 953) |
|
("iquest" . 191) ("isin" . 8712) ("iuml" . 239) |
|
("kappa" . 954) |
|
("lArr" . 8656) ("lambda" . 955) ("lang" . 9001) ("laquo" . 171) |
|
("larr" . 8592) ("lceil" . 8968) ("ldquo" . 8220) ("le" . 8804) |
|
("lfloor" . 8970) ("lowast" . 8727) ("loz" . 9674) ("lrm" . 8206) |
|
("lsaquo" . 8249) ("lsquo" . 8249) |
|
("macr" . 175) ("mdash" . 8212) ("micro" . 181) ("middot" . 183) |
|
("minus" . 8722) ("mu" . 956) |
|
("nabla" . 8711) ("nbsp" . 160) ("ndash" . 8211) ("ne" . 8800) |
|
("ni" . 8715) ("not" . 172) ("notin" . 8713) ("nsub" . 8836) |
|
("ntilde" . 241) ("nu" . 957) ("oacute" . 243) ("ocirc" . 244) |
|
("oelig" . 339) ("ograve" . 242) ("oline" . 8254) ("omega" . 969) |
|
("omicron" . 959) ("oplus" . 8853) ("or" . 8744) ("ordf" . 170) |
|
("ordm" . 186) ("oslash" . 248) ("otilde" . 245) ("otimes" . 8855) |
|
("ouml" . 246) |
|
("para" . 182) ("part" . 8706) ("permil" . 8240) ("perp" . 8869) |
|
("phi" . 966) ("pi" . 960) ("piv" . 982) ("plusmn" . 177) ("pound" . 163) |
|
("prime" . 8242) ("prod" . 8719) ("prop" . 8733) ("psi" . 968) |
|
("quot" . 34) |
|
("rArr" . 8658) ("radic" . 8730) ("rang" . 9002) ("raquo" . 187) |
|
("rarr" . 8594) ("rceil" . 8969) ("rdquo" . 8221) ("real" . 8476) |
|
("reg" . 174) ("rfloor" . 8971) ("rho" . 961) ("rlm" . 8207) |
|
("rsaquo" . 8250) ("rsquo" . 8250) ("sbquo" . 8218) |
|
("scaron" . 353) ("sdot" . 8901) ("sect" . 167) ("shy" . 173) |
|
("sigma" . 963) ("sigmaf" . 962) ("sim" . 8764) ("spades" . 9824) |
|
("sub" . 8834) ("sube" . 8838) ("sum" . 8721) ("sup" . 8835) |
|
("sup1" . 185) ("sup2" . 178) ("sup3" . 179) ("supe" . 8839) |
|
("szlig" . 223) |
|
("tau" . 964) ("there4" . 8756) ("theta" . 952) ("thetasym" . 977) |
|
("thinsp" . 8201) ("thorn" . 254) ("tilde" . 732) ("times" . 215) |
|
("trade" . 8482) |
|
("uarr" . 8593) ("ucirc" . 251) ("ugrave" . 249) ("uml" . 168) |
|
("upsilon" . 965) |
|
("weierp" . 8472) |
|
("xi" . 958) |
|
("yacute" . 253) ("yen" . 165) ("yuml" . 255) |
|
("zeta" . 950) ("zwj" . 8205) ("zwnj" . 8204))) |
|
|
|
;; http://webdesign.about.com/od/localization/l/blhtmlcodes-ascii.htm |
|
(defvar web-mode-display-table |
|
(let ((table (make-display-table))) |
|
(aset table 9 (vector ?\xBB ?\t)) |
|
(aset table 10 (vector ?\xB6 ?\n)) |
|
(aset table 32 (vector ?\xB7)) |
|
table) |
|
"Display table used when switching to the whitespace visualization.") |
|
|
|
(defvar web-mode-expanders |
|
'(("a/" . "<a href=\"|\"></a>") |
|
("b/" . "<table><tbody><tr><td>|</td><td></td></tr></tbody></table>") |
|
("c/" . "<div class=\"|\"></div>") |
|
("d/" . "<div>|</div>") |
|
("e/" . "<em>|</em>") |
|
("f/" . "<form>|</form>") |
|
("g/" . "<strong>|</strong>") |
|
("h/" . "<h1>|</h1>") |
|
("i/" . "<img src=\"|\" />") |
|
("j/" . "<script>|</script>") |
|
("l/" . "<li>|</li>") |
|
("m/" . "<main>|</main>") |
|
("n/" . "<input type=\"|\" />") |
|
("p/" . "<p>|</p>") |
|
("q/" . "<quote>|</quote>") |
|
("s/" . "<span>|</span>") |
|
("t/" . "<td>|</td>") |
|
("u/" . "<ul><li>|</li><li></li></ul>") |
|
("x/" . "<textarea>|</textarea>") |
|
("2/" . "<h2>|</h2>") |
|
("3/" . "<h3>|</h3>") |
|
("?/" . "<?php | ?>"))) |
|
|
|
(defvar web-mode-engines-auto-pairs |
|
'(("angular" . (("{{ " . " }}"))) |
|
("artanis" . (("<% " . " %>") |
|
("<%=" . " | %>") |
|
("<@css" . " | %>") |
|
("<@icon" . " | %>") |
|
("<@include" . " | %>") |
|
("<@js" . " | %>"))) |
|
("asp" . (("<% " . " %>"))) |
|
("aspx" . (("<% " . " %>") |
|
("<%=" . "%>") |
|
("<%#" . "%>") |
|
("<%$" . "%>") |
|
("<%@" . "%>") |
|
("<%:" . "%>") |
|
("<%-" . "- | --%>"))) |
|
("blade" . (("{{{" . " | }}}") |
|
("{{ " . " }}") |
|
("{!!" . " | !!}") |
|
("@{{" . " | }}") |
|
("{{-" . "- | --}}"))) |
|
("cl-emb" . (("<% " . " %>") |
|
("<%=" . " | %>") |
|
("<%#" . " | %>"))) |
|
("ctemplate" . (("{{ " . "| }}") |
|
("{{{" . " | }}}") |
|
("{~{" . " | }}") |
|
("{{~" . "{ | }}}") |
|
("{{!" . "-- | --}}") |
|
("{{^" . "}}") |
|
("{{/" . "}}") |
|
("{{#" . "}}"))) |
|
("django" . (("{{ " . " }}") |
|
("{% " . " %}") |
|
("{%-" . " | %}") |
|
("{# " . " #}"))) |
|
("elixir" . (("<% " . " %>") |
|
("<%=" . " | %>") |
|
("<%%" . " | %>") |
|
("<%#" . " | %>"))) |
|
("ejs" . (("<% " . " %>") |
|
("<%=" . "%>") |
|
("<%#" . "%>") |
|
("<%-" . "%>"))) |
|
("erb" . (("<% " . " %>") |
|
("<%=" . " %>") |
|
("<%#" . "%>") |
|
("<%-" . " %>"))) |
|
("freemarker" . (("<% " . " %>") |
|
("<#-" . "- | -->") |
|
("${ " . " }") |
|
("[% " . " %]") |
|
("[# " . " #]") |
|
("[#-" . "- | --]"))) |
|
("go" . (("{{ " . " }}") |
|
("{{-" . " | -}}"))) |
|
("hero" . (("<% " . " %>") |
|
("<%=" . " | %>") |
|
("<%!" . " | %>") |
|
("<%:" . " | %>") |
|
("<%#" . " | %>") |
|
("<%@" . " | %>") |
|
("<%~" . " | %>") |
|
("<%+" . " | %>"))) |
|
("jsp" . (("<% " . " %>") |
|
("<%-" . "- | --%>") |
|
("<%=" . "%>") |
|
("<%!" . "%>") |
|
("<%@" . "%>") |
|
("${ " . " }"))) |
|
("lsp" . (("<% " . " %>") |
|
("<%%" . " | %>") |
|
("<%#" . " | %>"))) |
|
("mako" . (("<% " . " %>") |
|
("<%!" . " | %>") |
|
("${ " . " }"))) |
|
("marko" . (("${ " . " }"))) |
|
("mason" . (("<% " . " %>") |
|
("<& " . " &>"))) |
|
("mojolicious" . (("<% " . " %>") |
|
("<%=" . " | %>") |
|
("<%%" . " | %>") |
|
("<%#" . " | %>"))) |
|
("php" . (("<?p" . "hp | ?>") |
|
("<? " . " ?>") |
|
("<?=" . "?>"))) |
|
("template-toolkit" . (("[% " . " %]") |
|
("[%-" . " | %]") |
|
("[%#" . " | %]"))) |
|
("riot" . (("={ " . " }"))) |
|
("underscore" . (("<% " . " %>"))) |
|
("vue" . (("{{ " . " }}"))) |
|
("web2py" . (("{{ " . " }}") |
|
("{{=" . "}}"))) |
|
(nil . (("<!-" . "- | -->"))) |
|
)) |
|
|
|
(defvar web-mode-engines-snippets |
|
'(("artanis" . (("if" . "<% (if (|) %>\n\n<% ) %>") |
|
("when" . "<% (when (|) %>\n\n<% ) %>") |
|
("unless" . "<% (unless (|) %>\n\n<% ) %>") |
|
("cond" . "<% (cond %>\n<% [(|) %>\n\n<% ] %>\n<% [else %>\n\n<% ] %>\n<% ) %>") |
|
("let" . "<% (let ([|]) %>\n\n<% ) %>") |
|
("let*" . "<% (let* ([|]) %>\n\n<% ) %>") |
|
("do" . "<% (do ([|]) %>\n<% [()] %>\n\n<% ) %>") |
|
("for-each" . "<% (for-each %>\n|\n\n<% ) %>") |
|
("case" . "<% (case | %>\n<% [() %>\n\n<% ] %>\n<% [() %>\n\n<% ] %>\n<% ) %>"))) |
|
("ejs" . (("for" . "<% for (|) { %>\n\n<% } %>") |
|
("if" . "<% if (|) { %>\n\n<% } %>"))) |
|
("erb" . (("each" . "<% |.each do %>\n\n<% end %>") |
|
("if" . "<% if | %>\n\n<% end %>") |
|
("when" . "<% when | %>\n\n<% end %>") |
|
("unless" . "<% unless | %>\n\n<% end %>"))) |
|
("php" . (("if" . "<?php if (|): ?>\n\n<?php endif; ?>") |
|
("while" . "<?php while (|): ?>\n\n<?php endwhile; ?>") |
|
("for" . "<?php for (| ; ; ): ?>\n\n<?php endfor; ?>") |
|
("foreach" . "<?php foreach (| as ): ?>\n\n<?php endforeach; ?>") |
|
("each" . "<?php foreach (| as ): ?>\n\n<?php endforeach; ?>") |
|
("switch" . "<?php switch (|): ?>\n<?php case 1: ?>\n\n<?php break ;?>\n<?php case 2: ?>\n\n<?php break ;?>\n<?php endswitch;?>"))) |
|
("django" . (("block" . "{% block | %}\n\n{% endblock %}") |
|
("comment" . "{% comment | %}\n\n{% endcomment %}") |
|
("css" . "{% stylesheet %}\n\n{% endstylesheet %}") |
|
("cycle" . "{% cycle | as %}\n\n{% endcycle %}") |
|
("filter" . "{% filter | %}\n\n{% endfilter %}") |
|
("for" . "{% for | in %}\n\n{% endfor %}") |
|
("if" . "{% if | %}\n\n{% endif %}") |
|
("ifequal" . "{% ifequal | %}\n\n{% endifequal %}") |
|
("ifnotequal" . "{% ifnotequal | %}\n\n{% endifnotequal %}") |
|
("js" . "{% javascript | %}\n\n{% endjavascript %}") |
|
("schema" . "{% javascript | %}\n\n{% endschema %}") |
|
("safe" . "{% safe | %}\n\n{% endsafe %}"))) |
|
("mako" . (("if" . "% if |:\n% endif") |
|
("for" . "% for | in :\n% endfor") |
|
("doc" . "<%doc>\n|\n</%doc>") |
|
("inherit" . "<%inherit file=\"|\" />") |
|
("namespace" . "<%namespace name=\"|\" file=\"\" import=\"\"/>") |
|
("block" . "<%block name=\"|\">\n</%block>"))) |
|
("template-toolkit" . (("if" . "[% IF | %]\n\n[% END %]"))) |
|
(nil . (("html5" . "<!doctype html>\n<html>\n<head>\n<title></title>\n<meta charset=\"utf-8\" />\n</head>\n<body>\n|\n</body>\n</html>") |
|
("table" . "<table><tbody>\n<tr>\n<td>|</td>\n<td></td>\n</tr>\n</tbody></table>") |
|
("ul" . "<ul>\n<li>|</li>\n<li></li>\n</ul>"))) |
|
)) |
|
|
|
(defvar web-mode-engine-token-regexps |
|
(list |
|
'("artanis" . "\"\\|#|\\|;") |
|
'("asp" . "//\\|/\\*\\|\"\\|'") |
|
'("ejs" . "//\\|/\\*\\|\"\\|'") |
|
'("erb" . "\"\\|'\\|#\\|<<[-]?['\"]?\\([[:alnum:]_]+\\)['\"]?") |
|
'("lsp" . "\"\\|#|\\|;") |
|
'("mako" . "\"\\|'\\|#") |
|
'("mason" . "\"\\|'\\|#") |
|
'("mojolicious" . "\"\\|'") |
|
'("php" . "//\\|/\\*\\|#\\|\"\\|'\\|<<<['\"]?\\([[:alnum:]]+\\)['\"]?") |
|
'("python" . "\"\\|'\\|#") |
|
'("web2py" . "\"\\|'")) |
|
"Engine regexps used to identify tokens (strings / comments) in blocks.") |
|
|
|
(defvar web-mode-engine-open-delimiter-regexps |
|
(list |
|
'("angular" . "{{") |
|
'("artanis" . "<%\\|<@\\(css\\|icon\\|include\\|js\\)") |
|
'("asp" . "<%\\|</?[[:alpha:]]+:[[:alpha:]]+\\|</?[[:alpha:]]+Template") |
|
'("aspx" . "<%.") |
|
'("blade" . "{{.\\|{!!\\|@{{\\|@[[:alpha:]]") |
|
'("cl-emb" . "<%") |
|
'("closure" . "{.\\|/\\*\\| //") |
|
'("clip" . "</?c:[[:alpha:]-]+") |
|
'("ctemplate" . "[$]?{[{~].") |
|
'("django" . "{[#{%]") |
|
'("dust" . "{.") |
|
'("elixir" . "<%") |
|
'("ejs" . "<%") |
|
'("erb" . "<%\\|^%.") |
|
'("expressionengine" . "{.") |
|
'("freemarker" . "<%\\|${\\|</?[[:alpha:]]+:[[:alpha:]]\\|</?[@#]\\|\\[/?[@#].") |
|
'("go" . "{{.") |
|
'("hero" . "<%") |
|
'("jsp" . "<%\\|${") |
|
'("lsp" . "<%") |
|
'("mako" . "</?%\\|${\\|^[ \t]*%.\\|^[ \t]*##") |
|
'("marko" . "${") |
|
'("mason" . "</?[&%]\\|^%.") |
|
'("mojolicious" . "<%\\|^[ \t]*%.") |
|
'("php" . "<\\?") |
|
'("python" . "<\\?") |
|
'("razor" . "@.\\|^[ \t]*}") |
|
'("riot" . "{.\\|/// begin script") |
|
'("smarty" . "{[[:alpha:]#$/*\"]") |
|
'("spip" . "\\[(#REM)\\|(\\|#[A-Z0-9_]\\|{\\|<:") |
|
'("template-toolkit" . "\\[%.\\|%%#") |
|
'("underscore" . "<%") |
|
'("velocity" . "#[[:alpha:]#*]\\|$[[:alpha:]!{]") |
|
'("vue" . "{{\\|[:@][-[:alpha:]]+=\"") |
|
'("web2py" . "{{") |
|
'("xoops" . "<{[[:alpha:]#$/*\"]") |
|
'("svelte" . "{.") |
|
) |
|
"Engine regexps used to identify blocks.") |
|
|
|
(defvar web-mode-normalization-rules |
|
'(("tag-case" . "lower-case") |
|
("attr-case" . "lower-case") |
|
("special-chars" . "unicode") ;"unicode" "entities" |
|
("css-indentation" . t) |
|
("smart-apostrophes" . t) |
|
("smart-quotes" . t) |
|
("whitespaces" . t) |
|
("indentation" . t)) |
|
"Normalization rules") |
|
|
|
(defvar web-mode-element-tag-faces |
|
(list |
|
'("h1" . web-mode-underline-face) |
|
'("h2" . web-mode-underline-face) |
|
'("h3" . web-mode-underline-face) |
|
'("h4" . web-mode-underline-face) |
|
'("title" . web-mode-underline-face) |
|
'("em" . web-mode-italic-face) |
|
'("strong" . web-mode-bold-face) |
|
)) |
|
|
|
(defvar web-mode-element-content-faces |
|
(list |
|
'("h1" . web-mode-underline-face) |
|
'("h2" . web-mode-underline-face) |
|
'("h3" . web-mode-underline-face) |
|
'("h4" . web-mode-underline-face) |
|
'("title" . web-mode-underline-face) |
|
'("em" . web-mode-italic-face) |
|
'("strong" . web-mode-bold-face) |
|
)) |
|
|
|
(defvar web-mode-comment-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "comment" web-mode-extra-keywords)) |
|
'("FIXME" "TODO" "BUG" "KLUDGE" "WORKAROUND" "OPTIMIZE" "HACK" "REFACTOR" "REVIEW")))) |
|
|
|
(defvar web-mode-links |
|
'(("\\.\\(png\\|jpe?g\\|gif\\|webp\\)$" "<img src=\"%s\" alt=\"\" />" nil 4) |
|
("\\.svg$" "<object data=\"%s\" type=\"image/svg+xml\"></object>" nil 0) |
|
("\\.js$" "<script type=\"text/javascript\" src=\"%s\"></script>" t 0) |
|
("\\.css$" "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />" t 0) |
|
("\\.html?$" "<a href=\"%s\"></a>" nil 4)) |
|
"List of elements and extensions for `web-mode-file-link'. It |
|
consists of a string that contains the regular expression that |
|
matches the appropriate files, a format string with element that |
|
contains the link (%s should be put where the path goes,) a bool |
|
that tells if the element belongs in the <head> element, and |
|
number of characters to move back if needed (or 0 if point |
|
shouldn't be moved back.)") |
|
|
|
(defvar web-mode-sql-queries |
|
(regexp-opt |
|
'("SELECT" "INSERT" "UPDATE" "DELETE" "select" "insert" "update" "delete"))) |
|
|
|
(defvar web-mode-sql-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "sql" web-mode-extra-keywords)) |
|
'("SELECT" "INSERT" "UPDATE" "DELETE" |
|
"FROM" "WHERE" "GROUP BY" "LIKE" "LIMIT" "HAVING" "JOIN" "LEFT" "INNER" |
|
"FULL" "OUTER" "VALUES" "ORDER BY" "SEPARATOR" "ASC" "DESC" |
|
"AND" "OR" "ON" "WHEN" "ELSE" "END" "THEN")))) |
|
|
|
(defvar web-mode-python-constants |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "python" web-mode-extra-constants)) |
|
'("True" "False" "None" "__debug__" "NotImplemented" "Ellipsis")))) |
|
|
|
(defvar web-mode-elixir-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "elixir" web-mode-extra-keywords)) |
|
'("do" "end" "case" "bc" "lc" "for" "if" "cond" "with" "unless" "try" "receive" "fn" "defmodule" "defprotocol" "defimpl" "defrecord" "defrecordp" "defstruct" "defdelegate" "defcallback" "defexception" "defoverridable" "defguard" "defgaurdp" "exit" "after" "rescue" "catch" "else" "raise" "throw" "quote" "unquote" "super" "when" "and" "or" "not" "in")))) |
|
|
|
|
|
(defvar web-mode-elixir-constants |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "elixir" web-mode-extra-constants)) |
|
'("nil" "true" "false")))) |
|
|
|
(defvar web-mode-erlang-constants |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "erlang" web-mode-extra-constants)) |
|
'("true" "false")))) |
|
|
|
(defvar web-mode-erlang-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "erlang" web-mode-extra-keywords)) |
|
'("else" "if" "do" "end")))) |
|
|
|
(defvar web-mode-cl-emb-constants |
|
(regexp-opt |
|
'("nil" "t" "raw" "escape"))) |
|
|
|
(defvar web-mode-cl-emb-keywords |
|
(regexp-opt |
|
'("if" "else" "endif" "unless" "endunless" "var" "repeat" |
|
"endrepeat" "loop" "endloop" "include" "call" "with" |
|
"endwith" "set" "genloop" "endgenloop" "insert"))) |
|
|
|
(defvar web-mode-artanis-constants |
|
(regexp-opt |
|
'("#f" "#t"))) |
|
|
|
(defvar web-mode-artanis-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "artanis" web-mode-extra-keywords)) |
|
'("begin" "cut" "cute" "if" "when" "unless" "cond" "case" |
|
"do" "quote" "syntax" "lambda" "lambda*" "and" "and-let*" |
|
"or" "else" "delay" "receive" "use-modules" "match" |
|
"match-lambda" "match-lambda*" "match-let" "match-let*" |
|
"match-letrec" "let" "let*" "letrec" "letrec*" "and-let*" |
|
"let-syntax" "letrec-syntax" "syntax-rules" "syntax-case" |
|
"define" "define-syntax" "define-macro" |
|
"define-condition-type" "define-immutable-record-type" |
|
"define-record-type" "define-values" "parameterize" "for-each" |
|
"require-extension" "set!" "test-approximate" "test-assert" |
|
"test-begin" "test-end" "test-eq" "test-equal" "test-eqv" |
|
"test-error" "test-group" "test-group-with-cleanup" "test-with-runner")))) |
|
|
|
(defvar web-mode-lsp-constants |
|
(regexp-opt |
|
'("nil" "t"))) |
|
|
|
(defvar web-mode-lsp-keywords |
|
(regexp-opt |
|
'("dolist" "let" "while" "cond" "when" "progn" "if" |
|
"dotimes" "unless" "lambda" |
|
"loop" "for" "and" "or" "in" "do" "defun"))) |
|
|
|
(defvar web-mode-php-constants |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "php" web-mode-extra-constants)) |
|
'("TRUE" "FALSE" "NULL" "true" "false" "null" |
|
"STR_PAD_LEFT" "STR_PAD_RIGHT" |
|
"ENT_COMPAT" "ENT_QUOTES" "ENT_NOQUOTES" "ENT_IGNORE" |
|
"ENT_SUBSTITUTE" "ENT_DISALLOWED" "ENT_HTML401" "ENT_XML1" |
|
"ENT_XHTML" "ENT_HTML5" "JSON_PRETTY_PRINT" |
|
"LIBXML_NOBLANKS")))) |
|
|
|
(defvar web-mode-php-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "php" web-mode-extra-keywords)) |
|
'("abstract" "and" "array" "as" "break" "case" "catch" "class" "clone" |
|
"const" "continue" "declare" "default" "die" "do" "echo" "else" "elseif" |
|
"empty" "enddeclare" "endfor" "endforeach" "endif" "endswitch" "endwhile" |
|
"eval" "exit" "extends" "final" "finally" "fn" "for" "foreach" "function" |
|
"global" "goto" "if" "implements" "include" "include_once" "instanceof" |
|
"insteadof" "interface" "isset" "list" "namespace" "new" "or" "parent" |
|
"print" "private" "protected" "public" "require" "require_once" "return" |
|
"self" "static" "switch" "trait" "try" "throw" "unset" "use" "var" |
|
"while" "xor" "yield" "yield from")))) |
|
|
|
(defvar web-mode-php-types |
|
(eval-when-compile |
|
(regexp-opt |
|
'("array" "bool" "boolean" "callable" "float" "int" "integer" |
|
"iterable" "mixed" "object" "resource" "string" "void")))) |
|
|
|
(defvar web-mode-css-at-rules |
|
(eval-when-compile |
|
(regexp-opt |
|
'("charset" "import" "media" "page" "font-face" |
|
"namespace" "supports" "document" |
|
"keyframes" "-moz-keyframes" "-webkit-keyframes" |
|
"mixin" "viewport")))) |
|
|
|
(defvar web-mode-css-pseudo-classes |
|
(eval-when-compile |
|
(regexp-opt |
|
'("active" "after" "before" "checked" "disabled" "empty" "enabled" |
|
"first" "first-child" "first-letter" "first-line" "first-of-type" "focus" |
|
"hover" "lang" "last-child" "last-of-type" "left" "link" |
|
"not" "nth-child" "nth-last-child" "nth-last-of-type" "nth-of-type" |
|
"only-child" "only-of-type" |
|
"right" "root" "selection" "target" "visited")))) |
|
|
|
(defvar web-mode-python-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "python" web-mode-extra-keywords)) |
|
'("and" "as" "assert" "break" "class" "continue" "def" "del" |
|
"elif" "else" "except" "finally" "for" "from" "global" |
|
"if" "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" |
|
"raise" "return" "try" "while" "with" "yield")))) |
|
|
|
(defvar web-mode-jsp-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "jsp" web-mode-extra-keywords)) |
|
'("case" "catch" "do" "else" "end" "false" "for" "function" |
|
"if" "in" "include" |
|
"new" "package" "page" "private" "protected" "public" |
|
"return" "tag" "taglib" "throw" "throws" "true" "try" "void" "while")))) |
|
|
|
(defvar web-mode-erb-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "erb" web-mode-extra-keywords)) |
|
'("alias" "and" "begin" "break" "case" "class" "def" "defined?" "do" |
|
"elsif" "else" "end" "ensure" "fail" "for" "if" "in" |
|
"module" "next" "not" "or" "redo" "rescue" "retry" "return" |
|
"then" "super" "unless" "undef" "until" "when" "while" "yield" |
|
"__ENCODING__" "__FILE__" "__LINE__")))) |
|
|
|
(defvar web-mode-mason-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "mason" web-mode-extra-keywords)) |
|
'("and" "base" "close" "die" "each" "else" "elsif" "eval" "exists" |
|
"foreach" "grep" "if" "length" "local" "my" "next" "open" "or" |
|
"package" "pop" "ref" "return" "stat" "sub" "tie" |
|
"undef" "unless" "use" "while")))) |
|
|
|
(defvar web-mode-erb-builtins |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "erb" web-mode-extra-builtins)) |
|
|
|
'("__callee__" "__dir__" "__method__" |
|
"abort" "at_exit" "autoload" "autoload?" |
|
"binding" "block_given?" "caller" "catch" |
|
"eval" "exec" "exit" "exit!" "fail" "fork" "format" |
|
"lambda" "load" "loop" "open" |
|
"p" "print" "printf" "proc" "putc" "puts" |
|
"raise" "rand" "readline" "readlines" "require" "require_relative" |
|
"sleep" "spawn" "sprintf" "srand" "syscall" "system" |
|
"throw" "trap" "warn" |
|
"alias_method" "attr" "attr_accessor" "attr_reader" "attr_writer" |
|
"define_method" "extend" "include" "module_function" |
|
"prepend" "private" "protected" "public" |
|
"refine" "using" |
|
|
|
"error_message_on" "error_messages_for" "form" "input" |
|
"auto_discovery_link_tag" "image_tag" "javascript_include_tag" |
|
"stylesheet_link_tag" "image_path" "path_to_image"" " |
|
"javascript_path" "path_to_javascript" "register_javascript_expansion" |
|
"register_javascript_include_default" "register_stylesheet_expansion" |
|
"stylesheet_path" "path_to_stylesheet" "atom_feed" "entry" "updated" |
|
"benchmark" "cache" "capture" "content_for" "distance_of_time_in_words" |
|
"distance_of_time_in_words_to_now" "time_ago_in_words" "date_select" |
|
"datetime_select" "time_select" "select_date" "select_datetime" |
|
"select_day" "select_hour" "select_minute" "select_month" "select_second" |
|
"select_time" "select_year" "debug" |
|
"check_box" "fields_for" "file_field" "form_for" "hidden_field" |
|
"label" "password_field" "radio_button" "text_area" "text_field" |
|
"check_box_tag" "field_set_tag" "file_field_tag" "form_tag" |
|
"hidden_field_tag" "image_submit_tag" "label_tag" "password_field_tag" |
|
"radio_button_tag" "select_tag" "submit_tag" "text_area_tag" |
|
"text_field_tag" |
|
"collection_select" "country_options_for_select" "country_select" |
|
"option_groups_from_collection_for_select" "options_for_select" |
|
"options_from_collection_for_select" "select" |
|
"time_zone_options_for_select" |
|
"time_zone_select" "button_to_function" "define_javascript_functions" |
|
"escape_javascript" "javascript_tag" "link_to_function"" " |
|
"number_to_currency" "number_to_human_size" "number_to_percentage" |
|
"number_to_phone" "number_with_delimiter" "number_with_precision" |
|
"evaluate_remote_response" "form_remote_for" "form_remote_tag" |
|
"link_to_remote" "observe_field" "observe_field" |
|
"periodically_call_remote" |
|
"remote_form_for" "remote_function" "submit_to_remote" "update_page" |
|
"update_page_tag" "dom_class" "dom_id" "partial_path" "sanitize" |
|
"sanitize_css" "strip_links" "strip_tags" |
|
"cdata_section" "content_tag" "escape_once" "tag" |
|
"auto_link" "concat" "cycle" "excerpt" "highlight" "markdown" "pluralize" |
|
"reset_cycle" "simple_format" "textilize" "textilize_without_paragraph" |
|
"truncate" "word_wrap" "button_to" "current_page?" "link_to" "link_to_if" |
|
"link_to_unless" "link_to_unless_current" "mail_to" "url_for" |
|
"action_name" "atom_feed" "audio_path" "audio_tag" |
|
"content_tag_for" "controller" "controller_name" "action_name" |
|
"controller_path" "convert_to_model" "cookies" "csrf_meta_tag" |
|
"csrf_meta_tags" "headers" |
|
"current_cycle" "div_for" "email_field" "email_field_tag" |
|
"favicon_link_tag" "flash" "l" "button_tag" |
|
"grouped_collection_select" "grouped_options_for_select" |
|
"image_alt" "j" "javascript_cdata_section" |
|
"localize" "logger" "number_field" |
|
"number_field_tag" "number_to_human" "params" "path_to_audio" |
|
"path_to_video" "phone_field" "phone_field_tag" "provide" |
|
"range_field" "range_field_tag" "raw" "render" "request" |
|
"request_forgery_protection_token" "response" "safe_concat" |
|
"safe_join" "search_field" "search_field_tag" |
|
"session" "t" "telephone_field" "telephone_field_tag" |
|
"time_tag" "translate" "url_field" "url_field_tag" |
|
"url_options" "video_path" "video_tag" "simple_form_for" |
|
"javascript_pack_tag" "stylesheet_pack_tag" "csp_meta_tag" |
|
|
|
)))) |
|
|
|
(defvar web-mode-asp-constants |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "asp" web-mode-extra-constants)) |
|
'("adAsyncExecute" "adAsyncFetch" "adAsyncFetchNonBlocking" "adCmdFile" |
|
"adCmdStoredProc" "adCmdTable" "adCmdTableDirect" "adCmdText" "adCmdUnknown" |
|
"adCmdUnspecified" "adExecuteNoRecords" "adExecuteRecord" "adExecuteStream" |
|
"adLockBatchOptimistic" "adLockOptimistic" "adLockPessimistic" |
|
"adLockReadOnly" "adLockUnspecified" "adOpenDynamic" "adOpenForwardOnly" |
|
"adOpenKeyset" "adOpenStatic" "adOpenUnspecified" "adOptionUnspecified" |
|
"Empty" "Nothing" "Null" "True" "False" |
|
"vbBack" "vbCr" "vbCrLf" "vbFormFeed" "vbLf" "vbNewLine" "vbNullChar" |
|
"vbNullString" "vbObjectError" "vbScript" "vbTab" "vbVerticalTab")))) |
|
|
|
(defvar web-mode-asp-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "asp" web-mode-extra-keywords)) |
|
'("Abs" "And" "Array" "Asc" "Atn" |
|
"CBool" "CByte" "CCur" "CDate" "CDbl" "CInt" "CLng" "CSng" "CStr" |
|
"Call" "Case" "Chr" "Class" "Const" "Cos" "CreateObject" |
|
"Date" "DateAdd" "DateDiff" "DatePart" "DateSerial" "DateValue" |
|
"Day" "Dim" "Do" |
|
"Each" "Else" "ElseIf" "End" "Erase" "Err" "Eval" "Exit" "Exp" |
|
"Explicit" |
|
"Filter" "Fix" "For" "FormatCurrency" "FormatDateTime" |
|
"FormatNumber" "FormatPercent" "Function" |
|
"GetLocale" "GetObject" "GetRef" "Hex" "Hour" |
|
"If" "In" "InStr" "InStrRev" "InputBox" "Int" "IsArray" "IsDate" |
|
"IsEmpty" "IsNull" "IsNumeric" "IsObject" "Join" |
|
"LBound" "LCase" "LTrim" "Language" "Left" "Len" "Let" |
|
"LoadPicture" "Log" "Loop" |
|
"Mid" "Minute" "Month" "MonthName" "MsgBox" |
|
"New" "Next" "Not" "Now" |
|
"Oct" "On" "Option" "Or" "Preserve" "Private" "Public" |
|
"RGB" "RTrim" "Redim" "Rem" "Replace" "Right" "Rnd" "Round" |
|
"ScriptEngine" "ScriptEngineBuildVersion" |
|
"ScriptEngineMajorVersion" "ScriptEngineMinorVersion" |
|
"Second" "Select" "Set" "SetLocale" "Sgn" "Sin" "Space" "Split" |
|
"Sqr" "StrComp" "StrReverse" "String" "Sub" |
|
"Tan" "Then" "Time" "TimeSerial" "TimeValue" "Timer" "To" "Trim" |
|
"TypeName" |
|
"UBound" "UCase" "Until" "VarType" |
|
"Weekday" "WeekdayName" "Wend" "With" "While" "Year")))) |
|
|
|
(defvar web-mode-asp-types |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "asp" web-mode-extra-types)) |
|
'("Application" "ASPError" "Request" "Response" "Server" "Session")))) |
|
|
|
(defvar web-mode-aspx-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "aspx" web-mode-extra-keywords)) |
|
'("case" "catch" "do" "else" "end" "for" "foreach" "function" |
|
"if" "in" "include" "new" "package" "page" "return" |
|
"tag" "throw" "throws" "try" "while")))) |
|
|
|
(defvar web-mode-smarty-keywords |
|
(regexp-opt '("as"))) |
|
|
|
(defvar web-mode-velocity-keywords |
|
(eval-when-compile |
|
(regexp-opt '("in" "true" "false")))) |
|
|
|
(defvar web-mode-freemarker-keywords |
|
(eval-when-compile |
|
(regexp-opt '("as" "list")))) |
|
|
|
(defvar web-mode-go-keywords |
|
(eval-when-compile |
|
(regexp-opt |
|
'("const" "define" "else" "end" |
|
"for" "func" "if" "import" |
|
"pipeline" "range" "return" "struct" |
|
"template" "type" "var" "with")))) |
|
|
|
(defvar web-mode-go-functions |
|
(eval-when-compile |
|
(regexp-opt |
|
'("and" "call" "ge" "html" "index" "js" "len" "not" "or" |
|
"print" "printf" "println" "urlquery" "where")))) |
|
|
|
(defvar web-mode-go-types |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "go" web-mode-extra-types)) |
|
'("int" "string")))) |
|
|
|
(defvar web-mode-closure-keywords |
|
(eval-when-compile |
|
(regexp-opt '("in" "and" "not" "or")))) |
|
|
|
(defvar web-mode-svelte-keywords |
|
(regexp-opt '("as"))) |
|
|
|
(defvar web-mode-django-control-blocks |
|
(append |
|
(cdr (assoc "django" web-mode-extra-control-blocks)) |
|
'( |
|
|
|
"assets" "autoescape" |
|
"block" "blocktrans" |
|
"cache" "call" "capture" "comment" |
|
"draw" |
|
"embed" |
|
"filter" "for" "foreach" "form" |
|
"if" "ifchanged" "ifequal" "ifnotequal" |
|
"macro" |
|
"random" "raw" |
|
"safe" "sandbox" "spaceless" |
|
"tablerow" |
|
"unless" |
|
"verbatim" |
|
"with" |
|
|
|
"endassets" "endautoescape" |
|
"endblock" "endblocktrans" |
|
"endcache" "endcall" "endcapture" "endcomment" |
|
"draw" |
|
"endembed" |
|
"endfilter" "endfor" "endforeach" "endform" |
|
"endif" "endifchanged" "endifequal" "endifnotequal" |
|
"endmacro" |
|
"endrandom" "endraw" |
|
"endsafe" "endsandbox" "endspaceless" |
|
"endtablerow" |
|
"endunless" |
|
"endverbatim" |
|
"endwith" |
|
|
|
;; "set" "endset" ;#504 |
|
|
|
"csrf_token" "cycle" "debug" |
|
"elif" "else" "elseif" "elsif" "empty" "extends" |
|
"firstof" "include" "load" "lorem" "now" "regroup" "ssi" |
|
"trans" "templatetag" "url" "widthratio" |
|
|
|
;; #805 |
|
"graph" "endgraph" |
|
"javascript" "endjavascript" |
|
"schema" "endschema" |
|
"stylesheet" "endstylesheet" |
|
|
|
))) |
|
|
|
(defvar web-mode-django-control-blocks-regexp |
|
(regexp-opt web-mode-django-control-blocks t)) |
|
|
|
(defvar web-mode-django-keywords |
|
(eval-when-compile |
|
(regexp-opt |
|
'("and" "as" "assign" |
|
"break" |
|
"cache" "call" "case" "context" "continue" |
|
"do" |
|
"flush" "from" |
|
"ignore" "import" "in" "is" |
|
"layout" "load" |
|
"missing" |
|
"none" "not" |
|
"or" |
|
"pluralize" |
|
"random" |
|
"set" ;#504 |
|
"unless" "use" |
|
"var" |
|
)))) |
|
|
|
(defvar web-mode-django-types |
|
(eval-when-compile |
|
(regexp-opt '("null" "false" "true")))) |
|
|
|
(defvar web-mode-blade-control-blocks |
|
(append |
|
(cdr (assoc "blade" web-mode-extra-control-blocks)) |
|
'("component" "foreach" "forelse" "for" "if" "section" "slot" "switch" "unless" "while") |
|
)) |
|
|
|
(defvar web-mode-blade-control-blocks-regexp |
|
(regexp-opt web-mode-blade-control-blocks t)) |
|
|
|
(defvar web-mode-directives |
|
(eval-when-compile |
|
(regexp-opt |
|
'("include" "page" "taglib" |
|
"Assembly" "Control" "Implements" "Import" |
|
"Master" "OutputCache" "Page" "Reference" "Register")))) |
|
|
|
(defvar web-mode-template-toolkit-keywords |
|
(regexp-opt |
|
'("block" "call" "case" "catch" "clear" "default" "do" |
|
"else" "elsif" "end" "filter" "final" "for" |
|
"foreach" "get" "if" "in" "include" "insert" "is" "last" |
|
"macro" "meta" "or" "perl" "process" "rawperl" "return" |
|
"set" "stop" "switch" "tags" "throw" "try" |
|
"unless" "use" "while" "wrapper"))) |
|
|
|
(defvar web-mode-perl-keywords |
|
(regexp-opt |
|
'("__DATA__" "__END__" "__FILE__" "__LINE__" "__PACKAGE__" |
|
"and" "cmp" "continue" "CORE" "do" "else" "elsif" "eq" "exp" |
|
"for" "foreach" "ge" "gt" "if" "le" "lock" "lt" "m" "ne" "no" |
|
"or" "package" "q" "qq" "qr" "qw" "qx" "s" "sub" |
|
"tr" "unless" "until" "while" "xor" "y" |
|
"my" "use" "print" "say"))) |
|
|
|
(defvar web-mode-javascript-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "javascript" web-mode-extra-keywords)) |
|
'("as" "async" "await" "break" "case" "catch" "class" "const" "continue" |
|
"debugger" "default" "delete" "do" "else" "enum" "eval" |
|
"export" "extends" "finally" "for" "from" "function" "get" "if" |
|
"implements" "import" "in" "instanceof" "interface" "let" |
|
"new" "of" "package" "private" "protected" "public" |
|
"return" "set" "static" "super" "switch" |
|
"throw" "try" "type" "typeof" "var" "void" "while" "with" "yield")))) |
|
|
|
(defvar web-mode-javascript-constants |
|
(regexp-opt |
|
'("false" "null" "undefined" "Infinity" "NaN" "true" "arguments" "this"))) |
|
|
|
(defvar web-mode-razor-keywords |
|
(regexp-opt |
|
(append |
|
(cdr (assoc "razor" web-mode-extra-keywords)) |
|
'("false" "true" "foreach" "if" "else" "in" "var" "for" "display" |
|
"match" "case" "to" |
|
"Html")))) |
|
|
|
(defvar web-mode-selector-font-lock-keywords |
|
(list |
|
'("$[[:alnum:]-]+" 0 'web-mode-css-variable-face) |
|
(cons (concat "@\\(" web-mode-css-at-rules "\\)\\_>") |
|
'(0 'web-mode-css-at-rule-face)) |
|
'("\\_<\\(all\|braille\\|embossed\\|handheld\\|print\\|projection\\|screen\\|speech\\|tty\\|tv\\|and\\|or\\)\\_>" |
|
1 'web-mode-keyword-face) |
|
'("[^,]+" 0 'web-mode-css-selector-face) |
|
(cons (concat ":\\([ ]*[[:alpha:]][^,{]*\\)") '(0 'web-mode-css-pseudo-class-face t t)) |
|
)) |
|
|
|
(defvar web-mode-declaration-font-lock-keywords |
|
(list |
|
'("--[[:alnum:]-]+" 0 'web-mode-css-variable-face) |
|
'("$[[:alnum:]-]+" 0 'web-mode-css-variable-face) |
|
(cons (concat "@\\(" web-mode-css-at-rules "\\)\\_>") '(1 'web-mode-css-at-rule-face)) |
|
'("\\([[:alpha:]-]+\\)[ ]?:" 0 'web-mode-css-property-name-face) |
|
'("\\([[:alpha:]-]+\\)[ ]?(" 1 'web-mode-css-function-face) |
|
'("#[[:alnum:]]\\{1,6\\}" 0 'web-mode-css-color-face t t) |
|
'("![ ]?important" 0 'web-mode-css-priority-face t t) |
|
'("\\([^,]+\\)[ ]+{" 1 'web-mode-css-selector-face) |
|
'("'[^']*'\\|\"[^\"]*\"" 0 'web-mode-string-face t t) |
|
)) |
|
|
|
(defvar web-mode-html-font-lock-keywords |
|
(list |
|
'("</?[[:alnum:]]+[ >]\\|>" 0 'web-mode-html-tag-face t) |
|
'(" \\([[:alnum:]-]+=\\)\\(\"[^\"]+\"\\)" |
|
(1 'web-mode-html-attr-name-face) |
|
(2 'web-mode-html-attr-value-face)) |
|
)) |
|
|
|
;; voir https://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html |
|
(defvar web-mode-javascript-font-lock-keywords |
|
(list |
|
'("@\\([[:alnum:]_]+\\)\\_>" 0 'web-mode-keyword-face) |
|
'("\\([[:alnum:]]+\\)[`]" 0 'web-mode-preprocessor-face) |
|
(cons (concat "\\_<\\(function\\*\\)\\_>") '(1 'web-mode-keyword-face)) |
|
(cons (concat "\\([ \t}{(]\\|^\\)\\(" web-mode-javascript-keywords "\\)\\_>") '(2 'web-mode-keyword-face)) |
|
(cons (concat "\\_<\\(" web-mode-javascript-constants "\\)\\_>") '(0 'web-mode-constant-face)) |
|
'("\\_<\\([$]\\)(" 1 'web-mode-type-face) |
|
'("\\_<\\(new\\|instanceof\\|class\\|extends\\) \\([[:alnum:]_.]+\\)\\_>" 2 'web-mode-type-face) |
|
'("\\_<\\([[:alnum:]_]+\\):[ ]*function[ ]*(" 1 'web-mode-function-name-face) |
|
'("\\_<\\(function\\|get\\|set\\)[ ]+\\([[:alnum:]_]+\\)" |
|
(1 'web-mode-keyword-face) |
|
(2 'web-mode-function-name-face)) |
|
'("\\([[:alnum:]_]+\\)[ ]*([^)]*)[ \n]*{" 1 'web-mode-function-name-face) |
|
'("([ ]*\\([[:alnum:]_]+\\)[ ]*=>" 1 'web-mode-function-name-face) |
|
'("[ ]*\\([[:alnum:]_]+\\)[ ]*=[ ]*([^)]*)[ ]*=>[ ]*{" 1 'web-mode-function-name-face) |
|
'("\\_<\\(var\\|let\\|const\\)[ ]+\\([[:alnum:]_]+\\)" 2 'web-mode-variable-name-face) |
|
'("({" "\\([[:alnum:]_]+\\)[, }]+" nil nil (1 'web-mode-variable-name-face)) ;#738 |
|
'("\\([[:alnum:]_]+\\)[ ]*=> [{(]" 1 'web-mode-variable-name-face) |
|
;; #989 |
|
;; '("\\(function\\|[,=]\\|^\\)[ ]*(" |
|
;; ("\\([[:alnum:]_]+\\)\\([ ]*=[^,)]*\\)?[,)]" nil nil (1 'web-mode-variable-name-face))) |
|
'("\\([[:alnum:]_]+\\):" 1 'web-mode-variable-name-face) |
|
'("\\_<\\([[:alnum:]_-]+\\)[ ]?(" 1 'web-mode-function-call-face) |
|
'("[a-zA-Z]<\\([a-zA-Z]+\\)[,>]" 1 'web-mode-type-face) |
|
)) |
|
|
|
(defvar web-mode-stylus-font-lock-keywords |
|
(list |
|
'("^[ \t]*\\([[:alnum:]().-]+\\)$" 1 'web-mode-css-selector-face) |
|
'("^[ \t]*\\([[:alnum:]-]+[ ]*:\\)" 1 'web-mode-css-property-name-face) |
|
)) |
|
|
|
(defvar web-mode-sass-font-lock-keywords |
|
(list |
|
'("^[ \t]*\\([[:alnum:]().-]+\\|&:\\(before\\|after\\)\\)$" 1 'web-mode-css-selector-face) |
|
'("^[ \t]*\\([[:alnum:]-]+[ ]*:\\)" 1 'web-mode-css-property-name-face) |
|
)) |
|
|
|
(defvar web-mode-pug-font-lock-keywords |
|
(list |
|
'("#[[:alnum:]-]+" 0 'web-mode-css-selector-face) |
|
'(" \\([@:]?\\sw+[ ]?=\\)" 1 'web-mode-param-name-face) |
|
)) |
|
|
|
(defvar web-mode-sql-font-lock-keywords |
|
(list |
|
(cons (concat "\\_<\\(" web-mode-sql-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) |
|
'("\\_<\\([[:alnum:]_-]+\\)[ ]?(" 1 'web-mode-function-call-face) |
|
)) |
|
|
|
(defvar web-mode-markdown-font-lock-keywords |
|
(list |
|
'("^[ ]*[*].*$" 0 'web-mode-variable-name-face) |
|
'("^[ ]*#.*$" 0 'web-mode-comment-face) |
|
)) |
|
|
|
(defvar web-mode-html-tag-font-lock-keywords |
|
(list |
|
'("\\(</?\\)\\([[:alnum:]]+\\)" |
|
(1 'web-mode-html-tag-bracket-face) |
|
(2 'web-mode-html-tag-face)) |
|
'("\"[^\"]*\"" 0 'web-mode-html-attr-value-face) |
|
'("\\([[:alnum:]]+\\)" 1 'web-mode-html-attr-name-face) |
|
'("/?>" 0 'web-mode-html-tag-bracket-face) |
|
)) |
|
|
|
(defvar web-mode-dust-font-lock-keywords |
|
(list |
|
'("{[#:/?@><+^]\\([[:alpha:]_.]+\\)" 1 'web-mode-block-control-face) |
|
'(":\\([[:alpha:]]+\\)" 1 'web-mode-keyword-face) |
|
'("\\_<\\([[:alnum:]_]+=\\)\\(\"[^\"]*\"\\|[[:alnum:]_]*\\)" |
|
(1 'web-mode-block-attr-name-face) |
|
(2 'web-mode-block-attr-value-face)) |
|
'("\\\([[:alnum:]_.]+\\)" 0 'web-mode-variable-name-face) |
|
)) |
|
|
|
(defvar web-mode-expressionengine-font-lock-keywords |
|
(list |
|
'("{/?\\([[:alpha:]_]+:[[:alpha:]_:]+\\|if\\)" 1 'web-mode-block-control-face) |
|
'(":\\([[:alpha:]_]+\\)" 1 'web-mode-keyword-face) |
|
'(" {\\([[:alpha:]_]+\\)}" 1 'web-mode-keyword-face t) |
|
'("\\_<\\([[:alnum:]_]+=\\)\\(\"[^\"]*\"\\|[[:alnum:]_]*\\)" |
|
(1 'web-mode-block-attr-name-face) |
|
(2 'web-mode-block-attr-value-face)) |
|
'("\\\([[:alnum:]_.]+\\)" 0 'web-mode-variable-name-face) |
|
)) |
|
|
|
(defvar web-mode-svelte-font-lock-keywords |
|
(list |
|
(cons (concat "[ ]\\(" web-mode-svelte-keywords "\\)[ ]") '(1 'web-mode-keyword-face)) |
|
'("{[#:/@]\\([[:alpha:]_.]+\\)" 1 'web-mode-block-control-face) |
|
'("\\_<\\([[:alnum:]_]+=\\)\\(\"[^\"]*\"\\|[[:alnum:]_]*\\)" |
|
(1 'web-mode-block-attr-name-face) |
|
(2 'web-mode-block-attr-value-face)) |
|
'("\\\([[:alnum:]_.]+\\)" 0 'web-mode-variable-name-face) |
|
'("\\_<\\([$]\\)\\([[:alnum:]_]+\\)" (1 'web-mode-constant-face) (2 'web-mode-variable-name-face)) |
|
)) |
|
|
|
(defvar web-mode-template-toolkit-font-lock-keywords |
|
(list |
|
(cons (concat "\\_<\\(" web-mode-template-toolkit-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) |
|
'("\\\([[:alpha:]][[:alnum:]_]+\\)[ ]?(" 1 'web-mode-function-call-face) |
|
'("\\\([[:alpha:]][[:alnum:]_]+\\)" 0 'web-mode-variable-name-face) |
|
)) |
|
|
|
(defvar web-mode-smarty-font-lock-keywords |
|
(list |
|
(cons (concat "[ ]\\(" web-mode-smarty-keywords "\\)[ ]") '(1 'web-mode-keyword-face)) |
|
'("{/?\\([[:alpha:]_]+\\)" 1 'web-mode-block-control-face) |
|
'("\\([}{]\\)" 0 'web-mode-block-delimiter-face) |
|
'("\\_<\\([$]\\)\\([[:alnum:]_]+\\)" (1 nil) (2 'web-mode-variable-name-face)) |
|
'("\\_<\\(\\sw+\\)[ ]?(" 1 'web-mode-function-call-face) |
|
'(" \\(\\sw+[ ]?=\\)" 1 'web-mode-param-name-face) |
|
'(" \\(\\sw+\\)[ }]" 1 'web-mode-param-name-face) |
|
'("|\\([[:alnum:]_]+\\)" 1 'web-mode-function-call-face) |
|
'("\\(->\\)\\(\\sw+\\)" (1 nil) (2 'web-mode-variable-name-face)) |
|
'("[.]\\([[:alnum:]_-]+\\)[ ]?(" 1 'web-mode-function-call-face) |
|
'("[.]\\([[:alnum:]_]+\\)" 1 'web-mode-variable-name-face) |
|
'("#\\([[:alnum:]_]+\\)#" 1 'web-mode-variable-name-face) |
|
)) |
|
|
|
(defvar web-mode-velocity-font-lock-keywords |
|
(list |
|
'("#{?\\([[:alpha:]_]+\\)\\_>" (1 'web-mode-block-control-face)) |
|
(cons (concat "\\_<\\(" web-mode-velocity-keywords "\\)\\_>") '(1 'web-mode-keyword-face t t)) |
|
'("#macro([ ]*\\([[:alpha:]]+\\)[ ]+" 1 'web-mode-function-name-face) |
|
'("\\(def\\|define\\) \\([[:alnum:]_-]+\\)(" 2 'web-mode-function-name-face) |
|
'("[.]\\([[:alnum:]_-]+\\)" 1 'web-mode-variable-name-face) |
|
'("\\_<\\($[!]?[{]?\\)\\([[:alnum:]_-]+\\)[}]?" (1 nil) (2 'web-mode-variable-name-face)) |
|
)) |
|
|
|
(defvar web-mode-mako-tag-font-lock-keywords |
|
(list |
|
'("</?%\\([[:alpha:]:]+\\)" 1 'web-mode-block-control-face) |
|
'("\\_<\\([[:alpha:]]+=\\)\\(\"[^\"]*\"\\)" |
|
(1 'web-mode-block-attr-name-face t t) |
|
(2 'web-mode-block-attr-value-face t t)) |
|
)) |
|
|
|
(defvar web-mode-mako-block-font-lock-keywords |
|
(list |
|
'("\\_<\\(\\sw+\\)[ ]?(" 1 'web-mode-function-call-face) |
|
(cons (concat "\\_<\\(" web-mode-python-constants "\\)\\_>") '(1 'web-mode-constant-face)) |
|
(cons (concat "\\_<\\(" web-mode-python-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) |
|
(cons (concat "\\_<\\(endfor\\|endif\\|endwhile\\)\\_>") '(1 'web-mode-keyword-face)) |
|
)) |
|
|
|
(defvar web-mode-web2py-font-lock-keywords |
|
(list |
|
'("\\_<\\(\\sw+\\)[ ]?(" 1 'web-mode-function-call-face) |
|