@@ -119,7 +119,7 @@ private void initialize() throws IOException {
119
119
//on Solaris regexp.h used is different than on linux (gnu regexp)
120
120
//http://en.wikipedia.org/wiki/Regular_expression#POSIX_basic_and_extended
121
121
command .add ("--langdef=scala" ); // below is bug 61 to get full scala support
122
- command .add ("--langmap=scala:.scala" );
122
+ command .add ("--langmap=scala:+ .scala" );
123
123
command .add ("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*class[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/c,classes/" );
124
124
command .add ("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*object[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/o,objects/" );
125
125
command .add ("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private|protected)?[[:space:]]*case class[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/C,case classes/" );
@@ -132,7 +132,8 @@ private void initialize() throws IOException {
132
132
command .add ("--regex-scala=/^[[:space:]]*package[[:space:]]+([a-zA-Z0-9_.]+)/\\ 1/p,packages/" );
133
133
134
134
command .add ("--langdef=haskell" ); // below was added with #912
135
- command .add ("--langmap=haskell:.hs.hsc" );
135
+ command .add ("--langmap=haskell:+.hs" );
136
+ command .add ("--langmap=haskell:+.hsc" );
136
137
command .add ("--regex-haskell=/^[[:space:]]*class[[:space:]]+([a-zA-Z0-9_]+)/\\ 1/c,classes/" );
137
138
command .add ("--regex-haskell=/^[[:space:]]*data[[:space:]]+([a-zA-Z0-9_]+)/\\ 1/t,types/" );
138
139
command .add ("--regex-haskell=/^[[:space:]]*newtype[[:space:]]+([a-zA-Z0-9_]+)/\\ 1/t,types/" );
@@ -144,14 +145,14 @@ private void initialize() throws IOException {
144
145
145
146
if (!env .isUniversalCtags ()) {
146
147
command .add ("--langdef=golang" );
147
- command .add ("--langmap=golang:.go" );
148
+ command .add ("--langmap=golang:+ .go" );
148
149
command .add ("--regex-golang=/func([[:space:]]+([^)]+))?[[:space:]]+([a-zA-Z0-9_]+)/\\ 2/f,func/" );
149
150
command .add ("--regex-golang=/var[[:space:]]+([a-zA-Z_][a-zA-Z0-9_]+)/\\ 1/v,var/" );
150
151
command .add ("--regex-golang=/type[[:space:]]+([a-zA-Z_][a-zA-Z0-9_]+)/\\ 1/t,type/" );
151
152
}
152
153
//temporarily use our defs until ctags will fix https://github.com/universal-ctags/ctags/issues/988
153
154
command .add ("--langdef=clojure" ); // clojure support (patterns are from https://gist.github.com/kul/8704283)
154
- command .add ("--langmap=clojure:.clj" );
155
+ command .add ("--langmap=clojure:+ .clj" );
155
156
command .add ("--regex-clojure=/\\ ([[:space:]]*create-ns[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/n,namespace/" );
156
157
command .add ("--regex-clojure=/\\ ([[:space:]]*def[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/d,definition/" );
157
158
command .add ("--regex-clojure=/\\ ([[:space:]]*defn[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/f,function/" );
@@ -165,8 +166,22 @@ private void initialize() throws IOException {
165
166
command .add ("--regex-clojure=/\\ ([[:space:]]*intern[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/v,intern/" );
166
167
command .add ("--regex-clojure=/\\ ([[:space:]]*ns[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/n,namespace/" );
167
168
169
+ command .add ("--langdef=kotlin" );
170
+ command .add ("--langmap=kotlin:+.kt" );
171
+ command .add ("--langmap=kotlin:+.kts" );
172
+ command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*class[[:space:]]+([[:alnum:]_:]+)/\\ 4/c,classes/" );
173
+ command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*object[[:space:]]+([[:alnum:]_:]+)/\\ 4/o,objects/" );
174
+ command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*data class[[:space:]]+([[:alnum:]_:]+)/\\ 6/c,data classes/" );
175
+ command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*interface[[:space:]]+([[:alnum:]_:]+)/\\ 4/i,interfaces/" );
176
+ command .add ("--regex-kotlin=/^[[:space:]]*type[[:space:]]+([[:alnum:]_:]+)/\\ 1/T,types/" );
177
+ command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy|private[^ ]*(\\ [[a-z]*\\ ])*|protected)[[:space:]]*)*fun[[:space:]]+([[:alnum:]_:]+)/\\ 4/m,methods/" );
178
+ command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[[:space:]]*)*val[[:space:]]+([[:alnum:]_:]+)/\\ 3/co,constants/" );
179
+ command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[[:space:]]*)*var[[:space:]]+([[:alnum:]_:]+)/\\ 3/va,variables/" );
180
+ command .add ("--regex-kotlin=/^[[:space:]]*package[[:space:]]+([[:alnum:]_.:]+)/\\ 1/p,packages/" );
181
+ command .add ("--regex-kotlin=/^[[:space:]]*import[[:space:]]+([[:alnum:]_.:]+)/\\ 1/p,imports/" );
182
+
168
183
command .add ("--langdef=pascal" );
169
- command .add ("--langmap=pascal:.pas" );
184
+ command .add ("--langmap=pascal:+ .pas" );
170
185
command .add ("--regex-pascal=/([[:alnum:]_]+)[[:space:]]*=[[:space:]]*\\ ([[:space:]]*[[:alnum:]_][[:space:]]*\\ )/\\ 1/t,Type/" );
171
186
command .add ("--regex-pascal=/([[:alnum:]_]+)[[:space:]]*=[[:space:]]*class[[:space:]]*[^;]*$/\\ 1/c,Class/" );
172
187
command .add ("--regex-pascal=/([[:alnum:]_]+)[[:space:]]*=[[:space:]]*interface[[:space:]]*[^;]*$/\\ 1/i,interface/" );
@@ -179,7 +194,7 @@ private void initialize() throws IOException {
179
194
command .add ("--regex-pascal=/^unit[[:space:]]+([a-zA-Z0-9_<>, ]+)[;(]/\\ 1/u,unit/" );
180
195
181
196
command .add ("--langdef=rust" );
182
- command .add ("--langmap=rust:.rs" );
197
+ command .add ("--langmap=rust:+ .rs" );
183
198
command .add ("--regex-rust=/^[[:space:]]*(#\\ [[^\\ ]]\\ ][[:space:]]*)*(pub[[:space:]]+)?(extern[[:space:]]+)?(\" [^\" ]+\" [[:space:]]+)?(unsafe[[:space:]]+)?fn[[:space:]]+([[:alnum:]_]+)/\\ 6/h,functions,function definitions/" );
184
199
command .add ("--regex-rust=/^[[:space:]]*(pub[[:space:]]+)?type[[:space:]]+([[:alnum:]_]+)/\\ 2/T,types,type definitions/" );
185
200
command .add ("--regex-rust=/^[[:space:]]*(pub[[:space:]]+)?enum[[:space:]]+([[:alnum:]_]+)/\\ 2/g,enum,enumeration names/" );
@@ -190,21 +205,7 @@ private void initialize() throws IOException {
190
205
command .add ("--regex-rust=/^[[:space:]]*(pub[[:space:]]+)?(unsafe[[:space:]]+)?impl([[:space:]\n ]*<[^>]*>)?[[:space:]]+(([[:alnum:]_:]+)[[:space:]]*(<[^>]*>)?[[:space:]]+(for)[[:space:]]+)?([[:alnum:]_]+)/\\ 5 \\ 7 \\ 8/I,impls,trait implementations/" );
191
206
command .add ("--regex-rust=/^[[:space:]]*macro_rules![[:space:]]+([[:alnum:]_]+)/\\ 1/d,macros,macro definitions/" );
192
207
command .add ("--regex-rust=/^[[:space:]]*let[[:space:]]+(mut)?[[:space:]]+([[:alnum:]_]+)/\\ 2/V,variables/" );
193
-
194
- command .add ("--langdef=kotlin" );
195
- command .add ("--langmap=kotlin:.kt" );
196
- command .add ("--langmap=kotlin:+.kts" );
197
- command .add ("--regex-kotlin=/^[ \\ t]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*class[[:space:]]+([[:alnum:]_:]+)/\\ 4/c,classes/" );
198
- command .add ("--regex-kotlin=/^[ \\ t]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*object[[:space:]]+([[:alnum:]_:]+)/\\ 4/o,objects/" );
199
- command .add ("--regex-kotlin=/^[ \\ t]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*data class[[:space:]]+([[:alnum:]_:]+)/\\ 6/c,data classes/" );
200
- command .add ("--regex-kotlin=/^[ \\ t]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*interface[[:space:]]+([[:alnum:]_:]+)/\\ 4/i,interfaces/" );
201
- command .add ("--regex-kotlin=/^[ \\ t]*type[[:space:]]+([[:alnum:]_:]+)/\\ 1/T,types/" );
202
- command .add ("--regex-kotlin=/^[ \\ t]*((abstract|final|sealed|implicit|lazy|private[^ ]*(\\ [[a-z]*\\ ])*|protected)[[:space:]]*)*fun[[:space:]]+([[:alnum:]_:]+)/\\ 4/m,methods/" );
203
- command .add ("--regex-kotlin=/^[ \\ t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[[:space:]]*)*val[[:space:]]+([[:alnum:]_:]+)/\\ 3/co,constants/" );
204
- command .add ("--regex-kotlin=/^[ \\ t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[[:space:]]*)*var[[:space:]]+([[:alnum:]_:]+)/\\ 3/va,variables/" );
205
- command .add ("--regex-kotlin=/^[ \\ t]*package[[:space:]]+([[:alnum:]_.:]+)/\\ 1/p,packages/" );
206
- command .add ("--regex-kotlin=/^[ \\ t]*import[[:space:]]+([[:alnum:]_.:]+)/\\ 1/p,imports/" );
207
-
208
+
208
209
//PLEASE add new languages ONLY with POSIX syntax (see above wiki link)
209
210
210
211
/* Add extra command line options for ctags. */
0 commit comments