Diffstat (limited to 'share/tinykate/syntax/javascript.xml') (more/less context) (ignore whitespace changes)
-rw-r--r-- | share/tinykate/syntax/javascript.xml | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/share/tinykate/syntax/javascript.xml b/share/tinykate/syntax/javascript.xml new file mode 100644 index 0000000..e2f05d8 --- a/dev/null +++ b/share/tinykate/syntax/javascript.xml | |||
@@ -0,0 +1,117 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE language SYSTEM "language.dtd"> | ||
3 | <!-- Author: Anders Lund <anders@alweb.dk> //--> | ||
4 | <!-- Minimal javascript support //--> | ||
5 | <language name="JavaScript" version="0.1" kateversion="2.0" section="Scripts" extensions="*.js" mimetype="text/x-javascript"> | ||
6 | <highlighting> | ||
7 | <list name="keywords"> | ||
8 | <item> if </item> | ||
9 | <item> else </item> | ||
10 | <item> for </item> | ||
11 | <item> in </item> | ||
12 | <item> while </item> | ||
13 | <item> do </item> | ||
14 | <item> continue </item> | ||
15 | <item> break </item> | ||
16 | <item> with </item> | ||
17 | <item> try </item> | ||
18 | <item> catch </item> | ||
19 | <item> switch </item> | ||
20 | <item> case </item> | ||
21 | <item> new </item> | ||
22 | <item> var </item> | ||
23 | <item> function </item> | ||
24 | <item> return </item> | ||
25 | <item> this </item> | ||
26 | <item> delete </item> | ||
27 | <item> true </item> | ||
28 | <item> false </item> | ||
29 | <item> void </item> | ||
30 | <item> throw </item> | ||
31 | <item> typeof </item> | ||
32 | <item> const </item> | ||
33 | <item> default </item> | ||
34 | </list> | ||
35 | <contexts> | ||
36 | <context attribute="0" lineEndContext="#stay" name="Normal"> | ||
37 | <Float attribute="2" context="0"> | ||
38 | <AnyChar String="fF" attribute="2" context="0" /> | ||
39 | </Float> | ||
40 | <Int attribute="2" context="#stay" /> | ||
41 | <keyword attribute="1" context="0" String="keywords" /> | ||
42 | <DetectChar attribute="3" context="1" char=""" /> | ||
43 | <DetectChar attribute="3" context="2" char="'" /> | ||
44 | <Detect2Chars attribute="5" context="4" char="/" char1="/" /> | ||
45 | <Detect2Chars attribute="5" context="5" char="/" char1="*" /> | ||
46 | <RegExpr attribute="0" context="7" String="\s*[=?:]\s*" /> | ||
47 | <RegExpr attribute="0" context="7" String="(search|replace)\s*\(\s*" /> | ||
48 | </context> | ||
49 | <context attribute="3" lineEndContext="#stay" name="String"> | ||
50 | <Detect2Chars attribute="3" context="#stay" char="\" char1=""" /> | ||
51 | <HlCStringChar attribute="4" context="#stay" /> | ||
52 | <DetectChar attribute="3" context="#pop" char=""" /> | ||
53 | </context> | ||
54 | <context attribute="3" lineEndContext="#stay" name="String (2)"> | ||
55 | <Detect2Chars attribute="3" context="#stay" char="\" char1="'" /> | ||
56 | <HlCStringChar attribute="4" context="#stay" /> | ||
57 | <DetectChar attribute="3" context="#pop" char="'" /> | ||
58 | </context> | ||
59 | <context attribute="0" lineEndContext="0" name="Comment common"> | ||
60 | <RegExpr attribute="6" context= "#stay" String="\b(?:fixme|todo|note)\b" insensitive="TRUE" /> | ||
61 | </context> | ||
62 | <context attribute="5" lineEndContext="#pop" name="Single Line Comment"> | ||
63 | <IncludeRules context="3" /> | ||
64 | </context> | ||
65 | <context attribute="5" lineEndContext="#stay" name="Multiline/Inline Comment"> | ||
66 | <Detect2Chars attribute="5" context="#pop" char="*" char1="/" /> | ||
67 | <IncludeRules context="3" /> | ||
68 | </context> | ||
69 | <context attribute="7" lineEndContext="#stay" name="Regular Expression"> | ||
70 | <RegExpr attribute="7" context="#pop#pop#pop" String="/[ig]{0,2}" /> | ||
71 | <RegExpr attribute="8" context="#stay" String="\{[\d, ]+\}" /> | ||
72 | <RegExpr attribute="8" context="#stay" String="\\[bB]" /> | ||
73 | <RegExpr attribute="9" context="#stay" String="\\[nrtvfDdSsWw]" /> | ||
74 | <RegExpr attribute="7" context="#stay" String="\\." /> | ||
75 | <DetectChar attribute="9" context="10" char="[" /> | ||
76 | <RegExpr attribute="8" context="#stay" String="\$(?=/)" /> | ||
77 | <AnyChar attribute="8" context="#stay" String="?+*()|" /> | ||
78 | </context> | ||
79 | <context attribute="0" lineEndContext="#stay" name="(Internal regex catch)" fallthrough="true" fallthroughContext="#pop"> | ||
80 | <RegExpr attribute="0" context="#stay" String="\s*" /> | ||
81 | <RegExpr attribute="7" context="#pop" String="//(?=;)" /> | ||
82 | <Detect2Chars attribute="5" context="4" char="/" char1="/" /> | ||
83 | <Detect2Chars attribute="5" context="5" char="/" char1="*" /> | ||
84 | <DetectChar attribute="7" context="9" char="/" /> | ||
85 | </context> | ||
86 | <context attribute="9" lineEndcontext="#stay" name="Regular Expression Character Class"> | ||
87 | <RegExpr attribute="9" context="#stay" String="\\[\[\]]" /> | ||
88 | <DetectChar attribute="9" context="#pop#pop" char="]" /> | ||
89 | </context> | ||
90 | <context attribute="8" lineEndContext="#pop" name="(regex caret first check)" fallthrough="true" fallthroughContext="6"> | ||
91 | <DetectChar attribute="8" context="6" char="^" /> | ||
92 | </context> | ||
93 | <context attribute="8" lineEndContext="#pop" name="(charclass caret first check)" fallthrough="true" fallthroughContext="8"> | ||
94 | <DetectChar attribute="8" context="8" char="^" /> | ||
95 | </context> | ||
96 | </contexts> | ||
97 | <itemDatas> | ||
98 | <itemData name="Normal Text" defStyleNum="dsNormal" /> | ||
99 | <itemData name="Keyword" defStyleNum="dsKeyword" /> | ||
100 | <itemData name="Number" defStyleNum="dsDecVal" /> | ||
101 | <itemData name="String" defStyleNum="dsString" /> | ||
102 | <itemData name="String Char" defStyleNum="dsChar" /> | ||
103 | <itemData name="Comment" defStyleNum="dsComment" /> | ||
104 | <itemData name="Note" defStyleNum="dsDecVal" /> | ||
105 | <itemData name="Regular Expression" defStyleNum="dsOthers" /> | ||
106 | <itemData name="Pattern Internal Operator" defStyleNum="dsFloat" /> | ||
107 | <itemData name="Pattern Character Class" defStyleNum="dsBaseN" /> | ||
108 | </itemDatas> | ||
109 | </highlighting> | ||
110 | <general> | ||
111 | <comments> | ||
112 | <comment name="singleLine" start="//" /> | ||
113 | <comment name="multiLine" start="/*" end="*/" /> | ||
114 | </comments> | ||
115 | <keywords casesensitive="1" /> | ||
116 | </general> | ||
117 | </language> | ||