Mercurial > vim
annotate runtime/syntax/javascript.vim @ 28451:e015d650ea9f v8.2.4750
patch 8.2.4750: small pieces of dead code
Commit: https://github.com/vim/vim/commit/b836658a04ee5456deca2ee523de9efe51252da3
Author: =?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
Date: Thu Apr 14 20:43:56 2022 +0100
patch 8.2.4750: small pieces of dead code
Problem: Small pieces of dead code.
Solution: Remove the dead code. (Goc Dundar, closes https://github.com/vim/vim/issues/10190) Rename the
qftf_cb struct member to avoid confusion.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 14 Apr 2022 21:45:02 +0200 |
parents | 4ab4ef0c48b1 |
children | c58baa6d6dda |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: JavaScript | |
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com> | |
557 | 4 " Updaters: Scott Shattuck (ss) <ss@technicalpursuit.com> |
7 | 5 " URL: http://www.fleiner.com/vim/syntax/javascript.vim |
557 | 6 " Changes: (ss) added keywords, reserved words, and other identifiers |
7 " (ss) repaired several quoting and grouping glitches | |
8 " (ss) fixed regex parsing issue with multiple qualifiers [gi] | |
9 " (ss) additional factoring of keywords, globals, and members | |
24278 | 10 " Last Change: 2021 Mar 30 |
4869 | 11 " 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke) |
13735 | 12 " 2018 Apr 14: adjusted javaScriptRegexpString (LongJohnCoder) |
7 | 13 |
14 " tuning parameters: | |
15 " unlet javaScript_fold | |
16 | |
17 if !exists("main_syntax") | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
5239
diff
changeset
|
18 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
5239
diff
changeset
|
19 if exists("b:current_syntax") |
7 | 20 finish |
21 endif | |
22 let main_syntax = 'javascript' | |
5239 | 23 elseif exists("b:current_syntax") && b:current_syntax == "javascript" |
24 finish | |
7 | 25 endif |
26 | |
3854 | 27 let s:cpo_save = &cpo |
28 set cpo&vim | |
29 | |
7 | 30 |
31 syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained | |
1121 | 32 syn match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo |
7 | 33 syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" |
1121 | 34 syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,javaScriptCommentTodo |
7 | 35 syn match javaScriptSpecial "\\\d\d\d\|\\." |
2152 | 36 syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc |
37 syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc | |
14421 | 38 syn region javaScriptStringT start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=javaScriptSpecial,javaScriptEmbed,@htmlPreproc |
39 | |
40 syn region javaScriptEmbed start=+${+ end=+}+ contains=@javaScriptEmbededExpr | |
557 | 41 |
7 | 42 syn match javaScriptSpecialCharacter "'\\.'" |
43 syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" | |
24278 | 44 syn match javaScriptNumber "-\=\<\d\+\%(_\d\+\)*\>" |
14421 | 45 syn region javaScriptRegexpString start=+[,(=+]\s*/[^/*]+ms=e-1,me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[+;.,)\]}]+me=e-1 end=+/[gimuys]\{0,2\}\s\+\/+me=e-1 contains=@htmlPreproc,javaScriptComment oneline |
557 | 46 |
47 syn keyword javaScriptConditional if else switch | |
48 syn keyword javaScriptRepeat while for do in | |
49 syn keyword javaScriptBranch break continue | |
50 syn keyword javaScriptOperator new delete instanceof typeof | |
51 syn keyword javaScriptType Array Boolean Date Function Number Object String RegExp | |
18186 | 52 syn keyword javaScriptStatement return with await |
36 | 53 syn keyword javaScriptBoolean true false |
557 | 54 syn keyword javaScriptNull null undefined |
2152 | 55 syn keyword javaScriptIdentifier arguments this var let |
557 | 56 syn keyword javaScriptLabel case default |
57 syn keyword javaScriptException try catch finally throw | |
58 syn keyword javaScriptMessage alert confirm prompt status | |
59 syn keyword javaScriptGlobal self window top parent | |
60 syn keyword javaScriptMember document event location | |
61 syn keyword javaScriptDeprecated escape unescape | |
18186 | 62 syn keyword javaScriptReserved abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile async |
7 | 63 |
14421 | 64 syn cluster javaScriptEmbededExpr contains=javaScriptBoolean,javaScriptNull,javaScriptIdentifier,javaScriptStringD,javaScriptStringS,javaScriptStringT |
65 | |
7 | 66 if exists("javaScript_fold") |
2152 | 67 syn match javaScriptFunction "\<function\>" |
7 | 68 syn region javaScriptFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend |
69 | |
70 syn sync match javaScriptSync grouphere javaScriptFunctionFold "\<function\>" | |
71 syn sync match javaScriptSync grouphere NONE "^}" | |
72 | |
73 setlocal foldmethod=syntax | |
74 setlocal foldtext=getline(v:foldstart) | |
75 else | |
2152 | 76 syn keyword javaScriptFunction function |
557 | 77 syn match javaScriptBraces "[{}\[\]]" |
78 syn match javaScriptParens "[()]" | |
7 | 79 endif |
80 | |
20552 | 81 if main_syntax == "javascript" |
82 syn sync fromstart | |
83 syn sync maxlines=100 | |
7 | 84 |
85 syn sync ccomment javaScriptComment | |
86 endif | |
87 | |
88 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
5239
diff
changeset
|
89 " Only when an item doesn't have highlighting yet |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
90 hi def link javaScriptComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
91 hi def link javaScriptLineComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
92 hi def link javaScriptCommentTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
93 hi def link javaScriptSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
94 hi def link javaScriptStringS String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
95 hi def link javaScriptStringD String |
14421 | 96 hi def link javaScriptStringT String |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
97 hi def link javaScriptCharacter Character |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
98 hi def link javaScriptSpecialCharacter javaScriptSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
99 hi def link javaScriptNumber javaScriptValue |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
100 hi def link javaScriptConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
101 hi def link javaScriptRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
102 hi def link javaScriptBranch Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
103 hi def link javaScriptOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
104 hi def link javaScriptType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
105 hi def link javaScriptStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
106 hi def link javaScriptFunction Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
107 hi def link javaScriptBraces Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
108 hi def link javaScriptError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
109 hi def link javaScrParenError javaScriptError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
110 hi def link javaScriptNull Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
111 hi def link javaScriptBoolean Boolean |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
112 hi def link javaScriptRegexpString String |
557 | 113 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
114 hi def link javaScriptIdentifier Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
115 hi def link javaScriptLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
116 hi def link javaScriptException Exception |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
117 hi def link javaScriptMessage Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
118 hi def link javaScriptGlobal Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
119 hi def link javaScriptMember Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
120 hi def link javaScriptDeprecated Exception |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
121 hi def link javaScriptReserved Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
122 hi def link javaScriptDebug Debug |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
123 hi def link javaScriptConstant Label |
14421 | 124 hi def link javaScriptEmbed Special |
125 | |
557 | 126 |
7 | 127 |
128 let b:current_syntax = "javascript" | |
129 if main_syntax == 'javascript' | |
130 unlet main_syntax | |
131 endif | |
3854 | 132 let &cpo = s:cpo_save |
133 unlet s:cpo_save | |
7 | 134 |
135 " vim: ts=8 |