groovy.jsf (8568B)
1 # JOE syntax highlight file for Groovy 2 3 =Idle 4 =Ident 5 =Comment 6 =Shebang +Preproc 7 =Constant 8 =Number +Constant 9 =Boolean +Constant 10 =String +Constant 11 =Regex +String 12 =Escape 13 =StringEscape +Escape +String 14 =RegexEscape +StringEscape 15 =Keyword 16 =Operator +Keyword 17 =Statement +Keyword 18 =Conditional +Statement 19 =Loop +Statement 20 =Structure +Type +Keyword 21 =Label +DefinedIdent 22 =StorageClass +Type +Keyword 23 =Bad 24 =Brace 25 =Builtin +DefinedFunction 26 27 :pre_idle Idle 28 * NULL noeat call=.groovy() 29 30 .subr groovy 31 32 # #! allowed on first line 33 34 :reset Idle 35 * idle noeat 36 "#" maybe_shebang 37 38 :maybe_shebang Idle 39 * idle noeat 40 "!" shebang recolor=-2 41 42 :shebang Shebang 43 * shebang 44 "\n" idle 45 46 :idle Idle 47 * idle 48 "{}" brace recolor=-1 49 "0" first_digit recolor=-1 50 "1-9" decimal recolor=-1 51 "." ident_no_kw 52 "\"" double_quote recolor=-1 53 "'" single_quote recolor=-1 54 "/" maybe_regex recolor=-1 55 "$" not_string buffer 56 "\i" ident buffer 57 58 # / / regex not allowed after terms 59 60 :after_term Idle 61 * idle noeat 62 " \t)" after_term 63 "/" slash_after_term 64 65 :slash_after_term Idle 66 * idle noeat 67 "/" line_comment recolor=-2 68 "*" comment recolor=-2 69 70 :maybe_regex Regex string 71 * regex noeat 72 "*" comment recolor=-2 73 "/" line_comment recolor=-2 74 75 :regex Regex string 76 * regex 77 "\\" regex_quote recolor=-1 78 "/" after_term 79 "$" maybe_regex_subst recolor=-1 80 81 :maybe_regex_subst Regex string 82 * regex noeat 83 "\i" regex_subst1 recolor=-2 84 "{" regex_subst recolor=-2 85 86 :regex_subst RegexEscape string 87 * regex_subst 88 "}" regex 89 90 :regex_subst1 RegexEscape string 91 * regex noeat 92 ".\c" regex_subst1 93 94 :regex_quote RegexEscape string 95 * regex 96 97 :not_string Idle 98 * idle noeat 99 "\c" builtin recolor=-2 100 "/" dstring recolor=-2 101 102 :brace Brace 103 * idle noeat 104 105 :comment Comment comment 106 * comment 107 "BFHNTX" comment noeat call=comment_todo.comment_todo() 108 "*" maybe_end_comment 109 110 :maybe_end_comment Comment comment 111 * comment 112 "/" idle 113 "*" maybe_end_comment 114 115 :line_comment Comment comment 116 * line_comment 117 "BFHNTX" line_comment noeat call=comment_todo.comment_todo() 118 "\n" idle 119 120 :end_of_file_comment Comment comment 121 * end_of_file_comment 122 123 :first_digit Number 124 * after_term noeat 125 "x" hex 126 "b" binary 127 "." float 128 "eE" epart 129 "0-7" octal 130 "89" bad_number recolor=-1 131 "gGlLiIdDfF" after_term 132 133 :bad_number Bad 134 * after_term noeat 135 "0-9" bad_number 136 137 :octal Number 138 * after_term noeat 139 "0-7_" octal 140 "89" bad_number recolor=-1 141 142 :binary Number 143 * after_term noeat 144 "01_" binary 145 "2-9" bad_number recolor=-1 146 147 :hex Number 148 * after_term noeat 149 "0-9A-Fa-f_" hex 150 151 :decimal Number 152 * after_term noeat 153 "0-9_" decimal 154 "eE" epart 155 "." float 156 "gGlLiIdDfF" after_term 157 158 :float Number 159 * after_term noeat 160 "eE" epart 161 "0-9_" float 162 "gGlLiIdDfF" after_term 163 164 :epart Number 165 * after_term noeat 166 "0-9+\-" enum 167 168 :enum Number 169 * after_term noeat 170 "0-9_" enum 171 "gGlLiIdDfF" after_term 172 173 # Distinguish between " and """ 174 175 :double_quote String string 176 * string noeat 177 "\"" double_quote_1 178 179 :double_quote_1 String string 180 * after_term noeat 181 "\"" tstring 182 183 # strings like "hello" 184 # interpolation allowed 185 # line crossing not allowed 186 187 :string String string 188 * string 189 "\"" after_term 190 "\n" after_term 191 "\\" string_escape recolor=-1 192 "$" maybe_string_subst recolor=-1 193 194 :maybe_string_subst String string 195 * string noeat 196 "\i" string_subst1 recolor=-2 197 "{" string_subst recolor=-2 198 199 :string_subst StringEscape string 200 * string_subst 201 "}" string 202 203 :string_subst1 StringEscape string 204 * string noeat 205 ".\c" string_subst1 206 207 :string_escape StringEscape string 208 * string 209 "x" string_hex2 210 "u" string_hex4 211 "0-7" string_octal2 212 "\n" string recolor=-2 213 214 :string_hex4 StringEscape string 215 * string noeat 216 "0-9a-fA-F" string_hex3 217 218 :string_hex3 StringEscape string 219 * string noeat 220 "0-9a-fA-F" string_hex2 221 222 :string_hex2 StringEscape string 223 * string noeat 224 "0-9a-fA-F" string_hex1 225 226 :string_hex1 StringEscape string 227 * string noeat 228 "0-9a-fA-F" string 229 230 :string_octal2 StringEscape string 231 * string noeat 232 "0-7" string_octal1 233 234 :string_octal1 StringEscape string 235 * string noeat 236 "0-7" string 237 238 # tstrings like "hello" 239 # interpolation allowed 240 # line crossing not allowed 241 242 :tstring String string 243 * tstring 244 "\"" tstring_maybe_done 245 "\\" tstring_escape recolor=-1 246 "$" maybe_tstring_subst recolor=-1 247 248 :tstring_maybe_done String string 249 * tstring noeat 250 "\"" tstring_maybe_done_2 251 252 :tstring_maybe_done_2 String string 253 * tstring noeat 254 "\"" after_term 255 256 :maybe_tstring_subst String string 257 * tstring noeat 258 "\i" tstring_subst1 recolor=-2 259 "{" tstring_subst recolor=-2 260 261 :tstring_subst StringEscape string 262 * tstring_subst 263 "}" tstring 264 265 :tstring_subst1 StringEscape string 266 * tstring noeat 267 ".\c" tstring_subst1 268 269 :tstring_escape StringEscape string 270 * tstring 271 "x" tstring_hex2 272 "u" tstring_hex4 273 "0-7" tstring_octal2 274 "\n" tstring recolor=-2 275 276 :tstring_hex4 StringEscape string 277 * tstring noeat 278 "0-9a-fA-F" tstring_hex3 279 280 :tstring_hex3 StringEscape string 281 * tstring noeat 282 "0-9a-fA-F" tstring_hex2 283 284 :tstring_hex2 StringEscape string 285 * tstring noeat 286 "0-9a-fA-F" tstring_hex1 287 288 :tstring_hex1 StringEscape string 289 * tstring noeat 290 "0-9a-fA-F" tstring 291 292 :tstring_octal2 StringEscape string 293 * tstring noeat 294 "0-7" tstring_octal1 295 296 :tstring_octal1 StringEscape string 297 * tstring noeat 298 "0-7" tstring 299 300 # strings like: $/sdfsdf/$ 301 # interpolation allowed 302 303 :dstring String string 304 * dstring 305 "$" dstring_esc recolor=-1 306 "/" dstring_maybe_done 307 308 :dstring_maybe_done String string 309 * dstring noeat 310 "$" after_term 311 312 :dstring_esc StringEscape string 313 * dstring 314 "/" dstring_esc_slash 315 316 :dstring_esc_slash StringEscape string 317 * dstring noeat recolor=-1 318 "$" dstring 319 320 :single_quote String string 321 * char noeat recolor=-1 322 "\'" single_quote_1 323 324 :single_quote_1 String string 325 * after_term noeat 326 "\'" tchar 327 328 # strings like 'hello' 329 # no interpolation 330 # no line crossing 331 332 :char String string 333 * char 334 "\n" after_term 335 "\'" after_term 336 "\\" char_escape recolor=-1 337 338 :char_escape StringEscape string 339 * char 340 "x" char_hex2 341 "u" char_hex4 342 "0-7" char_octal2 343 "\n" char recolor=-2 344 345 :char_hex4 StringEscape string 346 * char noeat 347 "0-9a-fA-F" char_hex3 348 349 :char_hex3 StringEscape string 350 * char noeat 351 "0-9a-fA-F" char_hex2 352 353 :char_hex2 StringEscape string 354 * char noeat 355 "0-9a-fA-F" char_hex1 356 357 :char_hex1 StringEscape string 358 * char noeat 359 "0-9a-fA-F" char 360 361 :char_octal2 StringEscape string 362 * char noeat 363 "0-7" char_octal1 364 365 :char_octal1 StringEscape string 366 * char noeat 367 "0-7" char 368 369 # strings like 'hello' 370 # no interpolation 371 # no line crossing 372 373 :tchar String string 374 * tchar 375 "\'" after_term 376 "\\" tchar_escape recolor=-1 377 378 :tchar_maybe_done String string 379 * tchar noeat 380 "\'" tchar_maybe_done_2 381 382 :tchar_maybe_done_2 String string 383 * tchar noeat 384 "\'" after_term 385 386 :tchar_escape StringEscape string 387 * tchar 388 "x" tchar_hex2 389 "u" tchar_hex4 390 "0-7" tchar_octal2 391 "\n" tchar recolor=-2 392 393 :tchar_hex4 StringEscape string 394 * tchar noeat 395 "0-9a-fA-F" tchar_hex3 396 397 :tchar_hex3 StringEscape string 398 * tchar noeat 399 "0-9a-fA-F" tchar_hex2 400 401 :tchar_hex2 StringEscape string 402 * tchar noeat 403 "0-9a-fA-F" tchar_hex1 404 405 :tchar_hex1 StringEscape string 406 * tchar noeat 407 "0-9a-fA-F" tchar 408 409 :tchar_octal2 StringEscape string 410 * tchar noeat 411 "0-7" tchar_octal1 412 413 :tchar_octal1 StringEscape string 414 * tchar noeat 415 "0-7" tchar 416 417 :ident_no_kw Ident 418 * after_term noeat 419 "0" first_digit recolor=-1 420 "1-9" decimal recolor=-1 421 "\i" ident_no_kw1 422 423 :ident_no_kw1 Ident 424 * after_term noeat 425 "\c" ident_no_kw1 426 427 :ident Ident 428 * after_term noeat strings 429 "as" operator 430 "assert" stmt 431 "break" loop 432 "case" label 433 "catch" stmt 434 "class" struct 435 "const" storage 436 "continue" loop 437 "def" stmt 438 "default" label 439 "do" loop 440 "else" cond 441 "enum" struct 442 "extends" struct 443 "finally" stmt 444 "for" loop 445 "goto" loop 446 "if" cond 447 "implements" struct 448 "import" kw 449 "in" operator 450 "instanceof" operator 451 "interface" struct 452 "new" operator 453 "package" kw 454 "return" stmt 455 "super" kw 456 "switch" cond 457 "throw" kw 458 "throws" struct 459 "trait" kw 460 "try" stmt 461 "while" loop 462 "true" bool 463 "false" bool 464 "null" lit 465 done 466 "\c" ident 467 468 :kw Keyword 469 * idle noeat 470 471 :stmt Statement 472 * idle noeat 473 474 :loop Loop 475 * idle noeat 476 477 :cond Conditional 478 * idle noeat 479 480 :struct Structure 481 * idle noeat 482 483 :storage StorageClass 484 * idle noeat 485 486 :label Label 487 * idle noeat 488 489 :lit Constant 490 * idle noeat 491 492 :bool Boolean 493 * idle noeat 494 495 :operator Operator 496 * idle noeat 497 498 :builtin Builtin 499 * idle noeat 500 "\c" builtin 501 502 .end