@@ -44,6 +44,44 @@ PATTERNS("bash",
44
44
/* -- */
45
45
/* Characters not in the default $IFS value */
46
46
"[^ \t]+" ),
47
+ PATTERNS ("bibtex" , "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$" ,
48
+ "[={}\"]|[^={}\" \t]+" ),
49
+ PATTERNS ("cpp" ,
50
+ /* Jump targets or access declarations */
51
+ "!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:[[:space:]]*($|/[/*])\n"
52
+ /* functions/methods, variables, and compounds at top level */
53
+ "^((::[[:space:]]*)?[A-Za-z_].*)$" ,
54
+ /* -- */
55
+ "[a-zA-Z_][a-zA-Z0-9_]*"
56
+ "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lLuU]*"
57
+ "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*" ),
58
+ PATTERNS ("csharp" ,
59
+ /* Keywords */
60
+ "!^[ \t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\n"
61
+ /* Methods and constructors */
62
+ "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe|async)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[<>@._[:alnum:]]+[ \t]*\\(.*\\))[ \t]*$\n"
63
+ /* Properties */
64
+ "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
65
+ /* Type definitions */
66
+ "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct)[ \t]+.*)$\n"
67
+ /* Namespace */
68
+ "^[ \t]*(namespace[ \t]+.*)$" ,
69
+ /* -- */
70
+ "[a-zA-Z_][a-zA-Z0-9_]*"
71
+ "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
72
+ "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->" ),
73
+ IPATTERN ("css" ,
74
+ "![:;][[:space:]]*$\n"
75
+ "^[:[@.#]?[_a-z0-9].*$" ,
76
+ /* -- */
77
+ /*
78
+ * This regex comes from W3C CSS specs. Should theoretically also
79
+ * allow ISO 10646 characters U+00A0 and higher,
80
+ * but they are not handled in this regex.
81
+ */
82
+ "-?[_a-zA-Z][-_a-zA-Z0-9]*" /* identifiers */
83
+ "|-?[0-9]+|\\#[0-9a-fA-F]+" /* numbers */
84
+ ),
47
85
PATTERNS ("dts" ,
48
86
"!;\n"
49
87
"!=\n"
@@ -191,46 +229,8 @@ PATTERNS("rust",
191
229
"[a-zA-Z_][a-zA-Z0-9_]*"
192
230
"|[0-9][0-9_a-fA-Fiosuxz]*(\\.([0-9]*[eE][+-]?)?[0-9_fF]*)?"
193
231
"|[-+*\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\|\\||->|=>|\\.{2}=|\\.{3}|::" ),
194
- PATTERNS ("bibtex" , "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$" ,
195
- "[={}\"]|[^={}\" \t]+" ),
196
232
PATTERNS ("tex" , "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$" ,
197
233
"\\\\[a-zA-Z@]+|\\\\.|[a-zA-Z0-9\x80-\xff]+" ),
198
- PATTERNS ("cpp" ,
199
- /* Jump targets or access declarations */
200
- "!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:[[:space:]]*($|/[/*])\n"
201
- /* functions/methods, variables, and compounds at top level */
202
- "^((::[[:space:]]*)?[A-Za-z_].*)$" ,
203
- /* -- */
204
- "[a-zA-Z_][a-zA-Z0-9_]*"
205
- "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lLuU]*"
206
- "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*" ),
207
- PATTERNS ("csharp" ,
208
- /* Keywords */
209
- "!^[ \t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\n"
210
- /* Methods and constructors */
211
- "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe|async)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[<>@._[:alnum:]]+[ \t]*\\(.*\\))[ \t]*$\n"
212
- /* Properties */
213
- "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
214
- /* Type definitions */
215
- "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct)[ \t]+.*)$\n"
216
- /* Namespace */
217
- "^[ \t]*(namespace[ \t]+.*)$" ,
218
- /* -- */
219
- "[a-zA-Z_][a-zA-Z0-9_]*"
220
- "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
221
- "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->" ),
222
- IPATTERN ("css" ,
223
- "![:;][[:space:]]*$\n"
224
- "^[:[@.#]?[_a-z0-9].*$" ,
225
- /* -- */
226
- /*
227
- * This regex comes from W3C CSS specs. Should theoretically also
228
- * allow ISO 10646 characters U+00A0 and higher,
229
- * but they are not handled in this regex.
230
- */
231
- "-?[_a-zA-Z][-_a-zA-Z0-9]*" /* identifiers */
232
- "|-?[0-9]+|\\#[0-9a-fA-F]+" /* numbers */
233
- ),
234
234
{ "default" , NULL , -1 , { NULL , 0 } },
235
235
};
236
236
#undef PATTERNS
0 commit comments