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