stan.xml 7.1 KB
Newer Older
1
2
3
4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Stan"
          section="Scientific"
Brian Ward's avatar
Brian Ward committed
5
          version="5"
6
7
          kateversion="5.0"
          indenter="cstyle"
Brian Ward's avatar
Brian Ward committed
8
          extensions="*.stan;*.stanfunctions"
9
10
11
12
13
14
15
16
17
18
19
          license="MIT">
  <highlighting>
    <list name="controlflow">
      <item>break</item>
      <item>continue</item>
      <item>else</item>
      <item>for</item>
      <item>if</item>
      <item>in</item>
      <item>return</item>
      <item>while</item>
Brian Ward's avatar
Brian Ward committed
20
      <item>profile</item>
21
22
23
24
25
26
27
28
29
30
    </list>
    <list name="keywords">
      <item>reject</item>
      <item>print</item>
      <item>integrate_ode</item>
      <item>integrate_ode_bdf</item>
      <item>integrate_ode_rk45</item>
      <item>algebra_solver</item>
    </list>
    <list name="types">
Brian Ward's avatar
Brian Ward committed
31
32
33
34
      <item>lower</item>
      <item>upper</item>
      <item>offset</item>
      <item>multiplier</item>
35
36
37
      <item>int</item>
      <item>real</item>
      <item>vector</item>
Brian Ward's avatar
Brian Ward committed
38
      <item>complex</item>
39
40
41
42
43
44
      <item>ordered</item>
      <item>positive_ordered</item>
      <item>simplex</item>
      <item>unit_vector</item>
      <item>row_vector</item>
      <item>matrix</item>
Brian Ward's avatar
Brian Ward committed
45
      <item>array</item>
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
      <item>cholesky_factor_corr</item>
      <item>cholesky_factor_cov</item>
      <item>corr_matrix</item>
      <item>cov_matrix</item>
      <item>void</item>
    </list>
    <contexts>
      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
        <DetectSpaces />
        <DetectChar attribute="Comment" context="Hash comment" char="#"/>
        <Detect2Chars attribute="Comment" context="C-style comment" char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="Block comment" char="/" char1="*" beginRegion="Comment"/>
        <RegExpr attribute="Keyword" context="#stay" String="\btarget\s*\+=" />
        <DetectChar attribute="Operator" context="After less-than" char="&lt;" />
        <DetectChar attribute="Punctuation" context="After comma" char="," />
        <DetectChar attribute="Operator" context="After Right Paren" char=")" />
        <RegExpr attribute="Keyword" context="#stay" String="\b(functions|(transformed\s+)?(data|parameters)|model|generated\s+quantities)\b" />
        <keyword attribute="Control Flow" context="#stay" String="controlflow" />
        <keyword attribute="Keyword" context="#stay" String="keywords" />
        <keyword attribute="Data Type" context="#stay" String="types" />
        <RegExpr attribute="Identifier" context="#stay" String="[A-Za-z][A-Za-z0-9_]*" />
Brian Ward's avatar
Brian Ward committed
67
        <RegExpr attribute="Complex" context="#stay" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?i" />
68
69
70
71
72
73
74
75
76
77
78
79
80
        <Float attribute="Real" />
        <Int attribute="Int" />
        <DetectChar attribute="Punctuation" context="#stay" char="{" beginRegion="Brace1" />
        <DetectChar attribute="Punctuation" context="#stay" char="}" endRegion="Brace1" />
        <DetectChar attribute="String" context="String" char="&quot;" />
        <RegExpr attribute="Assignment" context="#stay" String="([+-]?=|\.?[*/]=)" />
        <RegExpr attribute="Operator" context="#stay" String="(:|\?|\|\||&amp;&amp;|==|!=|&lt;=?|&gt;=?|\+|-|\.?\*|\.?/|%|\\|'|^)" />
        <RegExpr attribute="Punctuation" context="#stay" String="[[\]()]" />
      </context>
      <context attribute="String" lineEndContext="#stay" name="String">
        <DetectChar attribute="String" context="#pop" char="&quot;"/>
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="Hash comment">
81
        <DetectSpaces />
82
        <IncludeRules context="##Comments" />
83
84
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="C-style comment">
85
        <DetectSpaces />
86
        <IncludeRules context="##Comments" />
87
88
      </context>
      <context attribute="Comment" lineEndContext="#stay" name="Block comment">
89
        <DetectSpaces />
90
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
91
92
        <WordDetect attribute="Doc Tag" String="@return" context="#stay" />
        <WordDetect attribute="Doc Tag" String="@param" context="#stay" />
93
        <IncludeRules context="##Comments" />
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
      </context>
      <context attribute="Normal Text" name="After comma" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop" >
        <DetectSpaces />
        <RegExpr context="Upper Bound" String="upper\s*=" lookAhead="true" />
      </context>
      <context attribute="Normal Text" name="After less-than" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop" >
        <DetectSpaces />
        <RegExpr context="Upper Bound" String="upper\s*=" lookAhead="true" />
        <RegExpr context="Lower Bound" String="lower\s*=" lookAhead="true" />
      </context>
      <context attribute="Normal Text" name="After Right Paren" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop" >
        <DetectSpaces />
        <RegExpr context="Truncation" String="T\s*\[" lookAhead="true" />
      </context>
      <context attribute="Normal Text" name="Upper Bound" lineEndContext="#stay" >
109
        <StringDetect attribute="Keyword" String="upper" context="#stay" />
110
111
112
        <DetectChar attribute="Punctuation" char="=" context="#pop" />
      </context>
      <context attribute="Normal Text" name="Lower Bound" lineEndContext="#stay" >
113
        <StringDetect attribute="Keyword" String="lower" context="#stay" />
114
115
116
117
118
119
120
121
122
123
124
125
126
        <DetectChar attribute="Punctuation" char="=" context="#pop" />
      </context>
      <context attribute="Normal Text" name="Truncation" lineEndContext="#stay" >
        <DetectChar attribute="Keyword" char="T" context="#stay" />
        <DetectChar attribute="Punctuation" char="[" context="#pop" />
      </context>
    </contexts>
    <itemDatas>
      <itemData name="Normal Text"  defStyleNum="dsNormal" spellChecking="false"/>
      <itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/>
      <itemData name="Keyword"      defStyleNum="dsKeyword" spellChecking="false"/>
      <itemData name="Data Type"    defStyleNum="dsDataType" spellChecking="false"/>
      <itemData name="Int"          defStyleNum="dsDecVal" spellChecking="false"/>
Brian Ward's avatar
Brian Ward committed
127
128
      <itemData name="Real"         defStyleNum="dsFloat" spellChecking="false"/>
      <itemData name="Complex"      defStyleNum="dsFloat" spellChecking="false"/>
129
130
131
132
133
134
135
136
137
138
139
140
      <itemData name="String"       defStyleNum="dsString"/>
      <itemData name="Comment"      defStyleNum="dsComment"/>
      <itemData name="Assignment"   defStyleNum="dsNormal" spellChecking="false"/>
      <itemData name="Operator"     defStyleNum="dsNormal" spellChecking="false"/>
      <itemData name="Punctuation"  defStyleNum="dsNormal" spellChecking="false"/>
      <itemData name="Identifier"   defStyleNum="dsNormal" spellChecking="false" />
      <itemData name="Doc Tag"      defStyleNum="dsAnnotation" spellChecking="false" />
    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name="singleLine" start="//" />
141
      <comment name="multiLine" start="/*" end="*/" region="Comment" />
142
143
144
145
    </comments>
    <keywords casesensitive="1" />
  </general>
</language>
146
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->