annotate runtime/syntax/javascript.vim @ 2663:fd3346e3ccc0 v7.3.082

updated for version 7.3.082 Problem: Leaking file descriptor when hostname doesn't exist. Solution: Remove old debugging lines.
author Bram Moolenaar <bram@vim.org>
date Fri, 17 Dec 2010 12:19:21 +0100
parents b9e314fe473f
children aa51675adf7e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: JavaScript
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
557
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
4 " Updaters: Scott Shattuck (ss) <ss@technicalpursuit.com>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " URL: http://www.fleiner.com/vim/syntax/javascript.vim
557
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
6 " Changes: (ss) added keywords, reserved words, and other identifiers
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
7 " (ss) repaired several quoting and grouping glitches
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
8 " (ss) fixed regex parsing issue with multiple qualifiers [gi]
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
9 " (ss) additional factoring of keywords, globals, and members
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1121
diff changeset
10 " Last Change: 2010 Mar 25
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " tuning parameters:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " unlet javaScript_fold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 if !exists("main_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 let main_syntax = 'javascript'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " Drop fold if it set but vim doesn't support it.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 if version < 600 && exists("javaScript_fold")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 unlet javaScript_fold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
33 syn match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
35 syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,javaScriptCommentTodo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match javaScriptSpecial "\\\d\d\d\|\\."
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1121
diff changeset
37 syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1121
diff changeset
38 syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc
557
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
39
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match javaScriptSpecialCharacter "'\\.'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 557
diff changeset
42 syn region javaScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
557
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
43
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
44 syn keyword javaScriptConditional if else switch
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
45 syn keyword javaScriptRepeat while for do in
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
46 syn keyword javaScriptBranch break continue
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
47 syn keyword javaScriptOperator new delete instanceof typeof
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
48 syn keyword javaScriptType Array Boolean Date Function Number Object String RegExp
36
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
49 syn keyword javaScriptStatement return with
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
50 syn keyword javaScriptBoolean true false
557
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
51 syn keyword javaScriptNull null undefined
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1121
diff changeset
52 syn keyword javaScriptIdentifier arguments this var let
557
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
53 syn keyword javaScriptLabel case default
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
54 syn keyword javaScriptException try catch finally throw
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
55 syn keyword javaScriptMessage alert confirm prompt status
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
56 syn keyword javaScriptGlobal self window top parent
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
57 syn keyword javaScriptMember document event location
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
58 syn keyword javaScriptDeprecated escape unescape
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
59 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
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 if exists("javaScript_fold")
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1121
diff changeset
62 syn match javaScriptFunction "\<function\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn region javaScriptFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn sync match javaScriptSync grouphere javaScriptFunctionFold "\<function\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn sync match javaScriptSync grouphere NONE "^}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 setlocal foldmethod=syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 setlocal foldtext=getline(v:foldstart)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 else
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1121
diff changeset
71 syn keyword javaScriptFunction function
557
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
72 syn match javaScriptBraces "[{}\[\]]"
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
73 syn match javaScriptParens "[()]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn sync fromstart
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn sync maxlines=100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 if main_syntax == "javascript"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn sync ccomment javaScriptComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 if version >= 508 || !exists("did_javascript_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 let did_javascript_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 endif
36
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
93 HiLink javaScriptComment Comment
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
94 HiLink javaScriptLineComment Comment
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
95 HiLink javaScriptCommentTodo Todo
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
96 HiLink javaScriptSpecial Special
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
97 HiLink javaScriptStringS String
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
98 HiLink javaScriptStringD String
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
99 HiLink javaScriptCharacter Character
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
100 HiLink javaScriptSpecialCharacter javaScriptSpecial
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
101 HiLink javaScriptNumber javaScriptValue
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
102 HiLink javaScriptConditional Conditional
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
103 HiLink javaScriptRepeat Repeat
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
104 HiLink javaScriptBranch Conditional
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
105 HiLink javaScriptOperator Operator
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
106 HiLink javaScriptType Type
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
107 HiLink javaScriptStatement Statement
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
108 HiLink javaScriptFunction Function
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
109 HiLink javaScriptBraces Function
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
110 HiLink javaScriptError Error
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
111 HiLink javaScrParenError javaScriptError
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
112 HiLink javaScriptNull Keyword
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
113 HiLink javaScriptBoolean Boolean
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
114 HiLink javaScriptRegexpString String
557
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
115
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
116 HiLink javaScriptIdentifier Identifier
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
117 HiLink javaScriptLabel Label
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
118 HiLink javaScriptException Exception
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
119 HiLink javaScriptMessage Keyword
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
120 HiLink javaScriptGlobal Keyword
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
121 HiLink javaScriptMember Keyword
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
122 HiLink javaScriptDeprecated Exception
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
123 HiLink javaScriptReserved Keyword
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
124 HiLink javaScriptDebug Debug
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
125 HiLink javaScriptConstant Label
862863033fdd updated for version 7.0158
vimboss
parents: 417
diff changeset
126
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 let b:current_syntax = "javascript"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 if main_syntax == 'javascript'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 " vim: ts=8