3 " Maintainer: Andy Lester <andy@petdance.com>
4 " Homepage: http://github.com/petdance/vim-perl/tree/master
5 " Last Change: 2009-07-04
7 " Contributors: Luke Palmer <fibonaci@babylonia.flatirons.org>
8 " Moritz Lenz <moritz@faui2k3.org>
9 " Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
11 " This is a big undertaking. Perl 6 is the sort of language that only Perl
12 " can parse. But I'll do my best to get vim to.
14 " You can associate the extension ".pl" with the filetype "perl6" by setting
15 " autocmd BufNewFile,BufRead *.pl setf perl6
16 " in your ~/.vimrc. But that will infringe on Perl 5, so you might want to
17 " put a modeline near the beginning or end of your Perl 6 files instead:
18 " # vim: filetype=perl6
21 " * Deal with s:Perl5//
22 " * m:s// is a match, not a substitution
23 " * Make these highlight as strings, not operators:
24 " <==> <=:=> <===> <=~> <« »> «>» «<»
25 " * Allow more keywords to match as function calls(leave() is export(), etc)
26 " * Optimization: use nextgroup instead of lookaround (:help syn-nextgroup)
27 " * Fix s''' substitutions being matched as package names
28 " * Match s/// and m/// better, so things like "$s/" won't match
29 " * Add more support for folding (:help syn-fold)
30 " * Add more syntax syncing hooks (:help syn-sync)
33 " interpolate \q:s{$scalar} (though the spec isn't very clear on it)
37 " * Unicode bracketing characters for quoting (there are so many)
38 " * Various tricks depending on context. I.e. we can't know when Perl
39 " expects «*» to be a string or a hyperoperator. The latter is presumably
40 " more common, so that's what we assume.
41 " * Selective highlighting of Pod formatting codes with the :allow option
42 " * Arbitrary number, order, and negation of adverbs to Q//, q//, qq//.
43 " Currently only the first adverb is considered significant. Anything
44 " more would require an exponential amount of regexes, making this
45 " already slow syntax file even slower.
47 " If you want to have Pir code inside Q:PIR// strings highlighted, do:
48 " let perl6_embedded_pir=1
50 " The above requires pir.vim, which you can find in Parrot's repository:
51 " https://svn.parrot.org/parrot/trunk/editor/
53 " Some less than crucial things have been made optional to speed things up.
54 " Look at the comments near the if/else branches in this file to see exactly
55 " which features are affected. "perl6_extended_all" enables everything.
59 " unlet perl6_extended_comments
60 " unlet perl6_extended_q
61 " unlet perl6_extended_all
63 " For version 5.x: Clear all syntax items
64 " For version 6.x: Quit when a syntax file was already loaded
67 elseif exists("b:current_syntax")
72 syn match p6Normal display "\K\%(\k\|[-']\K\@=\)*"
74 " This is used in the for loops below
75 " Don't use the "syn keyword" construct because that always has higher
76 " priority than matches/regions, so the words can't be autoquoted with
77 " the "=>" and "p5=>" operators. All the lookaround stuff is to make sure
78 " we don't match them as part of some other identifier.
79 let s:before_keyword = " display \"\\%(\\k\\|\\K\\@<=[-']\\)\\@<!\\%("
80 let s:after_keyword = "\\)\\%(\\k\\|[-']\\K\\@=\\)\\@!\""
82 " Billions of keywords
85 \ "ACHTUNG ATTN ATTENTION FIXME NB TODO TBD WTF XXX NOTE",
87 \ "p6DeclareRoutine": [
88 \ "macro sub submethod method multi proto only rule token regex category",
91 \ "module class role package enum grammar slang subset",
100 \ "if else elsif unless",
103 \ "let my our state temp has constant",
106 \ "for loop repeat while until gather given",
109 \ "take do when next last redo return contend maybe defer",
110 \ "default exit make continue break goto leave async lift",
112 \ "p6TypeConstraint": [
113 \ "is as but trusts of returns handles where augment supersede",
115 \ "p6ClosureTrait": [
116 \ "BEGIN CHECK INIT START FIRST ENTER LEAVE KEEP",
117 \ "UNDO NEXT LAST PRE POST END CATCH CONTROL TEMP",
120 \ "die fail try warn",
123 \ "prec irs ofs ors export deep binary unary reparsed rw parsed cached",
124 \ "readonly defequiv will ref copy inline tighter looser equiv assoc",
134 \ "Object Any Junction Whatever Capture Match",
135 \ "Signature Proxy Matcher Package Module Class",
136 \ "Grammar Scalar Array Hash KeyHash KeySet KeyBag",
137 \ "Pair List Seq Range Set Bag Mapping Void Undef",
138 \ "Failure Exception Code Block Routine Sub Macro",
139 \ "Method Submethod Regex Str Blob Char Byte",
140 \ "Codepoint Grapheme StrPos StrLen Version Num",
141 \ "Complex num complex Bit bit bool True False",
142 \ "Increasing Decreasing Ordered Callable AnyChar",
143 \ "Positional Associative Ordering KeyExtractor",
144 \ "Comparator OrderingPair IO KitchenSink Role",
145 \ "Int int int1 int2 int4 int8 int16 int32 int64",
146 \ "Rat rat rat1 rat2 rat4 rat8 rat16 rat32 rat64",
147 \ "Buf buf buf1 buf2 buf4 buf8 buf16 buf32 buf64",
148 \ "UInt uint uint1 uint2 uint4 uint8 uint16 uint32",
149 \ "uint64 Abstraction utf8 utf16 utf32",
152 \ "div x xx mod also leg cmp before after eq ne le lt",
153 \ "gt ge eqv ff fff and andthen Z X or xor",
154 \ "orelse extra m mm rx s tr",
158 for [group, words] in items(s:keywords)
159 let s:words_space = join(words, " ")
160 let s:temp = split(s:words_space)
161 let s:words = join(s:temp, "\\|")
162 exec "syn match ". group ." ". s:before_keyword . s:words . s:after_keyword
164 unlet s:keywords s:words_space s:temp s:words
167 " Don't put a "\+" at the end of the character class. That makes it so
168 " greedy that the "%" " in "+%foo" won't be allowed to match as a sigil,
170 syn match p6Operator display "[-+/*~?|=^!%&,<>.;\\]"
171 syn match p6Operator display "\%(:\@<!::\@!\|::=\|\.::\)"
172 " these require whitespace on the left side
173 syn match p6Operator display "\%(\s\|^\)\@<=\%(xx=\|p5=>\)"
174 " "i" requires a digit to the left, and no keyword char to the right
175 syn match p6Operator display "\d\@<=i\k\@!"
177 syn match p6Operator display "\%(&\.(\@=\|@\.\[\@=\|%\.{\@=\)"
179 " all infix operators except nonassocative ones
181 \ "div % mod +& +< +> \\~& ?& \\~< \\~> +| +\\^ \\~| \\~\\^ ?| ?\\^ xx x",
182 \ "\\~ && & also <== ==> <<== ==>> == != < <= > >= \\~\\~ eq ne lt le gt",
183 \ "ge =:= === eqv before after \\^\\^ min max \\^ff ff\\^ \\^ff\\^",
184 \ "\\^fff fff\\^ \\^fff\\^ fff ff ::= := \\.= => , : p5=> Z minmax",
185 \ "\\.\\.\\. and andthen or orelse xor \\^ += -= /= \\*= \\~= //= ||=",
186 \ "+ - \\*\\* \\* // / \\~ || |",
188 " nonassociative infix operators
189 let s:infix_n = "but does <=> leg cmp \\.\\. \\.\\.\\^\\^ \\^\\.\\. \\^\\.\\.\\^"
191 let s:infix_a_long = join(s:infix_a, " ")
192 let s:infix_a_words = split(s:infix_a_long)
193 let s:infix_a_pattern = join(s:infix_a_words, "\\|")
195 let s:infix_n_words = split(s:infix_n)
196 let s:infix_n_pattern = join(s:infix_n_words, "\\|")
198 let s:both = [s:infix_a_pattern, s:infix_n_pattern]
199 let s:infix = join(s:both, "\\|")
201 let s:infix_assoc = "!\\?\\%(" . s:infix_a_pattern . "\\)"
202 let s:infix = "!\\?\\%(" . s:infix . "\\)"
204 unlet s:infix_a s:infix_a_long s:infix_a_words s:infix_a_pattern
205 unlet s:infix_n s:infix_n_pattern s:both
208 exec "syn match p6ReduceOp display \"\\k\\@<!\\[[R\\\\]\\?!\\?". s:infix_assoc ."]\\%(«\\|<<\\)\\?\""
211 " Reverse and cross operators (Rop, Xop)
212 exec "syn match p6ReverseCrossOp display \"[RX]". s:infix ."\""
214 " q() or whatever() is always a function call
215 syn match p6Normal display "\K\%(\k\|[-']\K\@=\)*(\@="
217 " basically all builtins that can be followed by parentheses
219 \ "eager hyper substr index rindex grep map sort join lines hints chmod",
220 \ "split reduce min max reverse truncate zip cat roundrobin classify",
221 \ "first sum keys values pairs defined delete exists elems end kv any",
222 \ "all one wrap shape key value name pop push shift splice unshift floor",
223 \ "ceiling abs exp log log10 rand sign sqrt sin cos tan round strand",
224 \ "roots cis unpolar polar atan2 pick chop p5chop chomp p5chomp lc",
225 \ "lcfirst uc ucfirst capitalize normalize pack unpack quotemeta comb",
226 \ "samecase sameaccent chars nfd nfc nfkd nfkc printf sprintf caller",
227 \ "evalfile run runinstead nothing want bless chr ord gmtime time eof",
228 \ "localtime gethost getpw chroot getlogin getpeername kill fork wait",
229 \ "perl graphs codes bytes clone print open read write readline say seek",
230 \ "close opendir readdir slurp pos fmt vec link unlink symlink uniq pair",
231 \ "asin atan sec cosec cotan asec acosec acotan sinh cosh tanh asinh",
232 \ "acos acosh atanh sech cosech cotanh sech acosech acotanh asech ok",
233 \ "plan_ok dies_ok lives_ok skip todo pass flunk force_todo use_ok isa_ok",
234 \ "diag is_deeply isnt like skip_rest unlike cmp_ok eval_dies_ok nok_error",
235 \ "eval_lives_ok approx is_approx throws_ok version_lt plan eval succ pred",
236 \ "times nonce once signature new connect operator undef undefine sleep",
237 \ "from to infix postfix prefix circumfix postcircumfix minmax lazy count",
238 \ "unwrap getc pi e context void quasi body each contains rewinddir subst",
239 \ "can isa flush arity assuming rewind callwith callsame nextwith nextsame",
240 \ "attr eval_elsewhere none srand trim trim_start trim_end lastcall WHAT",
241 \ "WHERE HOW WHICH VAR WHO WHENCE ACCEPTS REJECTS does not true iterator by",
242 \ "re im invert flip",
245 " we want to highlight builtins like split() though, so this comes afterwards
246 " TODO: check if this would be faster as one big regex
247 let s:words_space = join(s:routines, " ")
248 let s:temp = split(s:words_space)
249 let s:words = join(s:temp, "\\|")
250 exec "syn match p6Routine ". s:before_keyword . s:words . s:after_keyword
251 unlet s:before_keyword s:after_keyword s:words_space s:temp s:words s:routines
253 " packages, must come after all the keywords
254 syn match p6Normal display "\%(::\)\@<=\K\%(\k\|[-']\K\@=\)*"
255 syn match p6Normal display "\K\%(\k\|[-']\K\@=\)*\%(::\)\@="
257 " some standard packages
258 syn match p6Type display "\%(::\|\k\|\K\@<=[-']\)\@<!\%(Order\%(::Same\|::Increase\|::Decrease\)\?\)\%(\k\|[-']\K\@=\)\@!"
259 syn match p6Type display "\%(::\|\k\|\K\@<=[-']\)\@<!\%(Bool\%(::True\|::False\)\?\)\%(\k\|[-']\K\@=\)\@!"
262 syn match p6Shebang display "\%^#!.*"
263 syn match p6BlockLabel display "\%(^\s*\)\@<=\h\w*\s*::\@!\_s\@="
264 syn match p6Number display "\k\@<!_\@!\%(\d\|__\@!\)\+_\@<!\%([eE]_\@!+\?\%(\d\|_\)\+\)\?_\@<!"
265 syn match p6Float display "\k\@<!_\@!\%(\d\|__\@!\)\+_\@<![eE]_\@!-\%(\d\|_\)\+"
266 syn match p6Float display "\k\@<!_\@<!\%(\d\|__\@!\)*_\@<!\.\@<!\._\@!\.\@!\a\@!\%(\d\|_\)\+_\@<!\%([eE]_\@!\%(\d\|_\)\+\)\?"
268 syn match p6NumberBase display "[obxd]" contained
269 syn match p6Number display "\<0\%(o[0-7][0-7_]*\)\@=" nextgroup=p6NumberBase
270 syn match p6Number display "\<0\%(b[01][01_]*\)\@=" nextgroup=p6NumberBase
271 syn match p6Number display "\<0\%(x\x[[:xdigit:]_]*\)\@=" nextgroup=p6NumberBase
272 syn match p6Number display "\<0\%(d\d[[:digit:]_]*\)\@=" nextgroup=p6NumberBase
273 syn match p6Number display "\%(\<0o\)\@<=[0-7][0-7_]*"
274 syn match p6Number display "\%(\<0b\)\@<=[01][01_]*"
275 syn match p6Number display "\%(\<0x\)\@<=\x[[:xdigit:]_]*"
276 syn match p6Number display "\%(\<0d\)\@<=\d[[:digit:]_]*"
278 syn match p6Version display "\<v\d\@=" nextgroup=p6VersionNum
279 syn match p6VersionNum display "\d\+" nextgroup=p6VersionDot contained
280 syn match p6VersionDot display "\.\%(\d\|\*\)\@=" nextgroup=p6VersionNum contained
282 " try to distinguish the "is" function from the "is" trail auxiliary
283 syn match p6Routine display "\%(\%(\S\k\@<!\|^\)\s*\)\@<=is\>"
285 " does is a type constraint sometimes
286 syn match p6TypeConstraint display "does\%(\s*\%(\k\|[-']\K\@=\)\)\@="
288 " int is a type sometimes
289 syn match p6Type display "\<int\>\%(\s*(\|\s\+\d\)\@!"
291 " these Routine names are also Properties, if preceded by "is"
292 syn match p6Property display "\%(is\s\+\)\@<=\%(signature\|context\|also\|shape\)"
294 " The sigil in ::*Package
295 syn match p6PackageTwigil display "\%(::\)\@<=\*"
298 syn region p6MatchVarSigil
299 \ matchgroup=p6Variable
300 \ start="\$\%(<<\@!\)\@="
302 \ contains=p6MatchVar
304 syn region p6MatchVar
305 \ matchgroup=p6Twigil
311 syn match p6Context display "\<\%(item\|list\|slice\|hash\)\>"
312 syn match p6Context display "\%(\$\|@\|%\|&\|@@\)(\@="
314 " the "$" placeholder in "$var1, $, var2 = @list"
315 syn match p6Placeholder display "\%(,\s*\)\@<=\$\%(\K\|\%([.^*?=!~]\|:\@<!::\@!\)\)\@!"
316 syn match p6Placeholder display "\$\%(\K\|\%([.^*?=!~]\|:\@<!::\@!\)\)\@!\%(,\s*\)\@="
320 " one cluster for every quote adverb
321 syn cluster p6Interp_s
323 syn cluster p6Interp_scalar
326 syn cluster p6Interp_a
328 syn cluster p6Interp_array
331 syn cluster p6Interp_h
333 syn cluster p6Interp_hash
336 syn cluster p6Interp_f
337 \ add=p6InterpFunction
338 syn cluster p6Interp_f
339 \ add=p6InterpFunction
341 syn cluster p6Interp_c
342 \ add=p6InterpClosure
343 syn cluster p6Interp_closure
344 \ add=p6InterpClosure
347 if exists("perl6_extended_q") || exists("perl6_extended_all")
348 syn cluster p6Interp_ww
351 syn cluster p6Interp_quotewords
356 syn cluster p6Interp_q
359 syn cluster p6Interp_single
363 syn cluster p6Interp_b
372 syn cluster p6Interp_backslash
382 syn cluster p6Interp_qq
383 \ add=@p6Interp_scalar
384 \ add=@p6Interp_array
386 \ add=@p6Interp_function
387 \ add=@p6Interp_closure
388 \ add=@p6Interp_backslash
389 syn cluster p6Interp_double
390 \ add=@p6Interp_scalar
391 \ add=@p6Interp_array
393 \ add=@p6Interp_function
394 \ add=@p6Interp_closure
395 \ add=@p6Interp_backslash
397 syn region p6InterpScalar
398 \ start="\ze\z(\$\%(\%(\%(\d\+\|!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\@=\)\?\K\%(\k\|[-']\K\@=\)*\)\%(\.\%(\K\%(\k\|[-']\K\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
399 \ start="\ze\z(\$\%(\%(\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\@=\)\?\K\%(\k\|[-']\K\@=\)*\)\|\%(\d\+\|!\|/\|¢\)\)\)"
405 syn region p6InterpScalar
406 \ matchgroup=p6Context
413 syn region p6InterpArray
414 \ start="\ze\z(@\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\@=\)\?\K\%(\k\|[-']\K\@=\)*\)\%(\.\%(\K\%(\k\|[-']\K\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
420 syn region p6InterpArray
421 \ matchgroup=p6Context
429 syn region p6InterpHash
430 \ start="\ze\z(%\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\@=\)\?\K\%(\k\|[-']\K\@=\)*\)\%(\.\%(\K\%(\k\|[-']\K\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
436 syn region p6InterpHash
437 \ matchgroup=p6Context
444 syn region p6InterpFunction
445 \ start="\ze\z(&\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\@=\)\?\K\%(\k\|[-']\K\@=\)*\%(\.\%(\K\%(\k\|[-']\K\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
451 syn region p6InterpFunction
452 \ matchgroup=p6Context
459 syn region p6InterpClosure
460 \ start="\\\@<!{}\@!"
468 syn match p6Escape display "\\\S" contained
470 " escaped closing delimiters
471 syn match p6EscQuote display "\\'" contained
472 syn match p6EscDoubleQuote display "\\\"" contained
473 syn match p6EscCloseAngle display "\\>" contained
474 syn match p6EscCloseFrench display "\\»" contained
475 syn match p6EscBackTick display "\\`" contained
476 syn match p6EscForwardSlash display "\\/" contained
477 syn match p6EscVerticalBar display "\\|" contained
478 syn match p6EscExclamation display "\\!" contained
479 syn match p6EscComma display "\\," contained
480 syn match p6EscDollar display "\\\$" contained
481 syn match p6EscCloseCurly display "\\}" contained
482 syn match p6EscCloseBracket display "\\\]" contained
485 syn match p6EscOctOld display "\\\d\{1,3}" contained
486 syn match p6EscNull display "\\0\d\@!" contained
487 syn match p6EscCodePoint display "\%(\\c\)\@<=\%(\d\|\S\|\[\)\@=" contained nextgroup=p6CodePoint
488 syn match p6EscHex display "\%(\\x\)\@<=\%(\x\|\[\)\@=" contained nextgroup=p6HexSequence
489 syn match p6EscOct display "\%(\\o\)\@<=\%(\o\|\[\)\@=" contained nextgroup=p6OctSequence
490 syn match p6EscQQ display "\\qq" contained nextgroup=p6QQSequence
491 syn match p6EscOpenCurly display "\\{" contained
492 syn match p6EscHash display "\\#" contained
493 syn match p6EscBackSlash display "\\\\" contained
495 syn region p6QQSequence
496 \ matchgroup=p6Escape
502 \ contains=@p6Interp_qq
504 syn match p6CodePoint display "\%(\d\+\|\S\)" contained
505 syn region p6CodePoint
506 \ matchgroup=p6Escape
511 syn match p6HexSequence display "\x\+" contained
512 syn region p6HexSequence
513 \ matchgroup=p6Escape
518 syn match p6OctSequence display "\o\+" contained
519 syn region p6OctSequence
520 \ matchgroup=p6Escape
525 " matches :key, :!key, :$var, :key<var>, etc
526 " Since we don't know in advance how the adverb ends, we use a trick.
527 " Consume nothing with the start pattern (\ze at the beginning),
528 " while capturing the whole adverb into \z1 and then putting it before
529 " the match start (\zs) of the end pattern.
531 \ start="\ze\z(:!\?\K\%(\k\|[-']\K\@=\)*\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\?\)"
532 \ start="\ze\z(:!\?[@$%]\$*\%(::\|\%(\$\@<=\d\+\|!\|/\|¢\)\|\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\)\|\%(\K\%(\k\|[-']\K\@=\)*\)\)\)"
539 " FIXME: not sure how to distinguish this from the "less than" operator
540 " in all cases. For now, it matches if any of the following is true:
542 " * There is whitespace missing on either side of the "<", since
543 " people tend to put spaces around "less than"
544 " * It comes after "enum", "for", "any", "all", or "none"
545 " * It's the first or last thing on a line (ignoring whitespace)
546 " * It's preceded by "= "
548 " It never matches when:
550 " * Preceded by [<+~=] (e.g. <<foo>>, =<$foo>)
551 " * Followed by [-=] (e.g. <--, <=, <==)
552 syn region p6StringAngle
554 \ start="\%(\<\%(enum\|for\|any\|all\|none\)\>\s*(\?\s*\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!"
555 \ start="\%(\s\|[<+~=]\)\@<!<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!"
556 \ start="[<+~=]\@<!<\%(\s\|<\|=>\|[-=]\{1,2}>\@!\)\@!"
557 \ start="\%(^\s*\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!"
558 \ start="[<+~=]\@<!<\%(\s*$\)\@="
559 \ start="\%(=\s\+\)\@=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!"
562 \ contains=p6InnerAnglesOne,p6EscBackSlash,p6EscCloseAngle
564 syn region p6InnerAnglesOne
565 \ matchgroup=p6StringAngle
571 \ contains=p6InnerAnglesOne
574 syn region p6StringAngles
579 \ contains=p6InnerAnglesTwo,@p6Interp_qq,p6Comment,p6EscHash,p6EscCloseAngle,p6Adverb,p6StringSQ,p6StringDQ
581 syn region p6InnerAnglesTwo
582 \ matchgroup=p6StringAngles
588 \ contains=p6InnerAnglesTwo
591 syn region p6StringFrench
596 \ contains=p6InnerFrench,@p6Interp_qq,p6Comment,p6EscHash,p6EscCloseFrench,p6Adverb,p6StringSQ,p6StringDQ
598 syn region p6InnerFrench
599 \ matchgroup=p6StringFrench
605 \ contains=p6InnerFrench
608 syn region p6StringSQ
613 \ contains=@p6Interp_q,p6EscQuote
616 syn region p6StringDQ
621 \ contains=@p6Interp_qq,p6EscDoubleQuote
625 syn match p6QuoteQ display "\%([Qq]\%(ww\|to\|[qwxsahfcb]\)\?\)\>" nextgroup=p6QPairs skipwhite skipempty
626 syn match p6QPairs contained transparent skipwhite skipempty nextgroup=p6StringQ,p6StringQ_PIR "\%(\_s*:!\?\K\%(\k\|[-']\K\@=\)*\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\?\)*"
628 if exists("perl6_embedded_pir")
629 syn include @p6PIR syntax/pir.vim
632 " hardcoded set of delimiters
634 \ ["\\\"", "\\\"", "p6EscDoubleQuote", "\\\\\\@<!\\\\\\\""],
635 \ ["'", "'", "p6EscQuote", "\\\\\\@<!\\\\'"],
636 \ ["/", "/", "p6EscForwardSlash", "\\\\\\@<!\\\\/"],
637 \ ["`", "`", "p6EscBackTick", "\\\\\\@<!\\\\`"],
638 \ ["|", "|", "p6EscVerticalBar", "\\\\\\@<!\\\\|"],
639 \ ["!", "!", "p6EscExclamation", "\\\\\\@<!\\\\!"],
640 \ [",", ",", "p6EscComma", "\\\\\\@<!\\\\,"],
641 \ ["\\$", "\\$", "p6EscDollar", "\\\\\\@<!\\\\\\$"],
642 \ ["{", "}", "p6EscCloseCurly", "\\%(\\\\\\@<!\\\\}\\|{[^}]*}\\)"],
643 \ ["<", ">", "p6EscCloseAngle", "\\%(\\\\\\@<!\\\\>\\|<[^>]*>\\)"],
644 \ ["«", "»", "p6EscCloseFrench", "\\%(\\\\\\@<!\\\\»\\|«[^»]*»\\)"],
645 \ ["\\\[", "]", "p6EscCloseBracket", "\\%(\\\\\\@<!\\\\]\\|\\[^\\]]*]\\)"],
646 \ ["\\s\\@<=(", ")", "p6EscCloseParen", "\\%(\\\\\\@<!\\\\)\\|([^)]*)\\)"],
649 " double and triple delimiters too
650 if exists("perl6_extended_q") || exists("perl6_extended_all")
651 call add(s:delims, ["««", "»»", "p6EscCloseFrench", "\\%(\\\\\\@<!\\\\»»\\|««\\%([^»]\\|»»\\@!\\)*»»\\)"])
652 call add(s:delims, ["«««", "»»»", "p6EscCloseFrench", "\\%(\\\\\\@<!\\\\»»»\\|«««\\%([^»]\\|»\\%(»»\\)\\@!\\)*»»»\\)"])
653 call add(s:delims, ["{{", "}}", "p6EscCloseCurly", "\\%(\\\\\\@<!\\\\}}\\|{{\\%([^}]\\|}}\\@!\\)*}}\\)"])
654 call add(s:delims, ["{{{", "}}}", "p6EscCloseCurly", "\\%(\\\\\\@<!\\\\}}}\\|{{{\\%([^}]\\|}\\%(}}\\)\\@!\\)*}}}\\)"])
655 call add(s:delims, ["\\\[\\\[", "]]", "p6EscCloseBracket", "\\%(\\\\\\@<!\\\\]]\\|\\[\\[\\%([^\\]]\\|]]\\@!\\)*]]\\)"])
656 call add(s:delims, ["\\\[\\\[\\\[", "]]]", "p6EscCloseBracket", "\\%(\\\\\\@<!\\\\]]]\\|\\[\\[\\[\\%([^\\]]\\|]\\%(]]\\)\\@!\\)*]]]\\)"])
657 call add(s:delims, ["\\s\\@<=((", "))", "p6EscCloseParen", "\\%(\\\\\\@<!\\\\))\\|((\\%([^)]\\|))\\@!\\)*))\\)"])
658 call add(s:delims, ["\\s\\@<=(((", ")))", "p6EscCloseParen", "\\%(\\\\\\@<!\\\\)))\\|(((\\%([^)]\\|)\\%())\\)\\@!\\)*)))\\)"])
659 call add(s:delims, ["\\s\\@<=<<", ">>", "p6EscCloseAngle", "\\%(\\\\\\@<!\\\\>>\\|<<\\%([^>]\\|>>\\@!\\)*>>\\)"])
660 call add(s:delims, ["\\s\\@<=<<<", ">>>", "p6EscCloseAngle", "\\%(\\\\\\@<!\\\\>>>\\|<<<\\%([^>]\\|>\\%(>>\\)\\@!\\)*>>>\\)"])
663 if !exists("perl6_extended_q") && !exists("perl6_extended_all")
664 " simple version, no special highlighting within the string
665 for [start_delim, end_delim, end_group, skip] in s:delims
666 exec "syn region p6StringQ matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=".end_group." contained"
669 if exists("perl6_embedded_pir")
670 " highlight embedded PIR code
671 for [start_delim, end_delim, end_group, skip] in s:delims
672 exec "syn region p6StringQ_PIR matchgroup=p6Quote start=\"\\%(Q\\s*:PIR\\s*\\)\\@<=".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6PIR,".end_group." contained"
676 let s:before = "syn region p6StringQ matchgroup=p6Quote start=\"\\%("
677 let s:after = "\\%(\\_s*:!\\?\\K\\%(\\k\\|[-']\\K\\@=\\)*\\%(([^)]*)\\|\\[[^\\]]*]\\|<[^>]*>\\|«[^»]*»\\|{[^}]*}\\)\\?\\)*\\_s*\\)\\@<="
685 \ ["b", "backslash"],
687 \ ["ww", "quotewords"],
691 " these can't be conjoined with q and qq (e.g. as qqq and qqqq)
697 for [start_delim, end_delim, end_group, skip] in s:delims
698 " Q, q, and qq with any number of (ignored) adverbs
699 exec s:before ."Q". s:after .start_delim."\" end=\"". end_delim ."\""." contained"
700 exec s:before ."q". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q"." contained"
701 exec s:before ."qq". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq"." contained"
703 for [short, long] in s:adverbs
704 " Qs, qs, qqs, Qa, qa, qqa, etc, with ignored adverbs
705 exec s:before ."Q".short. s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long." contained"
706 exec s:before ."q".short. s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long." contained"
707 exec s:before ."qq".short. s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long." contained"
709 " Q, q, and qq, with one significant adverb
710 exec s:before ."Q\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long." contained"
711 for [q_short, q_long] in s:q_adverbs
712 exec s:before ."Q\\s*:\\%(".q_short."\\|".q_long."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".q_long." contained"
714 exec s:before ."q\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long." contained"
715 exec s:before ."qq\\s*:\\%(".short."\\|".long."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long." contained"
717 for [short2, long2] in s:adverbs
718 " Qs, qs, qqs, Qa, qa, qqa, etc, with one significant adverb
719 exec s:before ."Q".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long.",@p6Interp_".long2." contained"
720 for [q_short2, q_long2] in s:q_adverbs
721 exec s:before ."Q".short."\\s*:\\%(".q_short2."\\|".q_long2."\\)". s:after .start_delim ."\" end=\"". end_delim ."\" contains=@p6Interp_".long.",@p6Interp_".q_long2." contained"
723 exec s:before ."q".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_q,@p6Interp_".long.",@p6Interp_".long2." contained"
724 exec s:before ."qq".short."\\s*:\\%(".short2."\\|".long2."\\)". s:after .start_delim ."\" skip=\"". skip ."\" end=\"". end_delim ."\" contains=". end_group .",@p6Interp_qq,@p6Interp_".long.",@p6Interp_".long2." contained"
728 unlet s:before s:after s:adverbs s:q_adverbs
732 " Match these so something else above can't. E.g. the "q" in "role q { }"
733 " should not be considered a string
734 syn match p6Normal display "\%(\<\%(role\|grammar\|slang\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*"
737 syn match p6Operator display ":\@<!::\@!!\?" nextgroup=p6Key
738 syn match p6Key display "\k\%(\k\|[-']\K\@=\)*" contained
740 " => and p5=> autoquoting
741 syn match p6StringP5Auto display "\K\%(\k\|[-']\K\@=\)*\ze\s\+p5=>"
742 syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*\ze\%(p5\)\@<!=>"
743 syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*\ze\s\+=>"
744 syn match p6StringAuto display "\K\%(\k\|[-']\K\@=\)*p5\ze=>"
746 " Hyperoperators. Needs to come after the quoting operators (<>, «», etc)
747 exec "syn match p6HyperOp display \"»" .s:infix."»\\?\""
748 exec "syn match p6HyperOp display \"«\\?".s:infix."«\""
749 exec "syn match p6HyperOp display \"»" .s:infix."«\""
750 exec "syn match p6HyperOp display \"«" .s:infix. "»\""
752 exec "syn match p6HyperOp display \">>" .s:infix."\\%(>>\\)\\?\""
753 exec "syn match p6HyperOp display \"\\%(<<\\)\\?".s:infix."<<\""
754 exec "syn match p6HyperOp display \">>" .s:infix."<<\""
755 exec "syn match p6HyperOp display \"<<" .s:infix.">>\""
758 " Regexes and grammars
760 syn match p6RegexName display "\%(\<\%(regex\|rule\|token\)\s\+\)\@<=\K\%(\k\|[-']\K\@=\)*" nextgroup=p6RegexBlockCrap skipwhite skipempty
761 syn match p6RegexBlockCrap "[^{]*" nextgroup=p6RegexBlock skipwhite skipempty transparent contained
763 syn region p6RegexBlock
764 \ matchgroup=p6Normal
768 \ contains=@p6Regexen,@p6Variables
772 syn cluster p6Regexen
781 \ add=p6RxAlternation
792 syn match p6RxMeta display contained ".\%(\k\|\s\)\@<!"
793 syn match p6RxAnchor display contained "[$^]"
794 syn match p6RxEscape display contained "\\\S"
795 syn match p6RxCapture display contained "[()]"
796 syn match p6RxAlternation display contained "|"
797 syn match p6RxRange display contained "\.\."
799 syn region p6RxClosure
800 \ matchgroup=p6Normal
804 \ containedin=p6RxClosure
807 \ matchgroup=p6StringSpecial2
811 \ contains=@p6Regexen,@p6Variables
812 syn region p6RxAssertion
813 \ matchgroup=p6StringSpecial2
817 \ contains=@p6Regexen,@p6Variables,p6RxCharClass,p6RxAssertCall
818 syn region p6RxAssertCall
819 \ matchgroup=p6Normal
820 \ start="\%(::\|\%(\K\%(\k\|[-']\K\@=\)*\)\)\@<=(\@="
824 syn region p6RxCharClass
825 \ matchgroup=p6StringSpecial2
826 \ start="\%(<[-!+?]\?\)\@<=\["
830 \ contains=p6RxRange,p6RxEscape,p6EscHex,p6EscOct,p6EscNull
831 syn region p6RxQuoteWords
832 \ matchgroup=p6StringSpecial2
836 syn region p6RxAdverb
837 \ start="\ze\z(:!\?\K\%(\k\|[-']\K\@=\)*\)"
842 syn region p6RxAdverbArg
843 \ start="\%(:!\?\K\%(\k\|[-']\K\@=\)*\)\@<=("
848 syn region p6RxStorage
849 \ matchgroup=p6Operator
850 \ start="\%(^\s*\)\@<=:\%(my\>\|temp\>\)\@="
857 syn cluster p6RegexP5Base
862 \ add=p6RxP5CodePoint
866 syn cluster p6RegexP5
868 \ add=p6RxP5Quantifier
870 \ add=p6RxP5QuoteMeta
877 \ add=p6RxP5CharClass
880 " inside character classes
881 syn cluster p6RegexP5Class
886 syn match p6RxP5Escape display contained "\\\S"
887 syn match p6RxP5CodePoint display contained "\\c\S\@=" nextgroup=p6RxP5CPId
888 syn match p6RxP5CPId display contained "\S"
889 syn match p6RxP5Oct display contained "\\\%(\o\{1,3}\)\@=" nextgroup=p6RxP5OctSeq
890 syn match p6RxP5OctSeq display contained "\o\{1,3}"
891 syn match p6RxP5Anchor display contained "[\^$]"
892 syn match p6RxP5Hex display contained "\\x\%({\x\+}\|\x\{1,2}\)\@=" nextgroup=p6RxP5HexSeq
893 syn match p6RxP5HexSeq display contained "\x\{1,2}"
894 syn region p6RxP5HexSeq
895 \ matchgroup=p6RxP5Escape
899 syn region p6RxP5Named
900 \ matchgroup=p6RxP5Escape
901 \ start="\%(\\N\)\@<={"
904 syn match p6RxP5Quantifier display contained "\%([+*]\|(\@<!?\)"
905 syn match p6RxP5ReadRef display contained "\\[1-9]\d\@!"
906 syn match p6RxP5ReadRef display contained "\\k<\@=" nextgroup=p6RxP5ReadRefId
907 syn region p6RxP5ReadRefId
908 \ matchgroup=p6RxP5Escape
912 syn match p6RxP5WriteRef display contained "\\g\%(\d\|{\)\@=" nextgroup=p6RxP5WriteRefId
913 syn match p6RxP5WriteRefId display contained "\d\+"
914 syn region p6RxP5WriteRefId
915 \ matchgroup=p6RxP5Escape
919 syn match p6RxP5Prop display contained "\\[pP]\%(\a\|{\)\@=" nextgroup=p6RxP5PropId
920 syn match p6RxP5PropId display contained "\a"
921 syn region p6RxP5PropId
922 \ matchgroup=p6RxP5Escape
926 syn match p6RxP5Meta display contained "[(|).]"
927 syn match p6RxP5ParenMod display contained "(\@<=?\@=" nextgroup=p6RxP5Mod,p6RxP5ModName,p6RxP5Code
928 syn match p6RxP5Mod display contained "?\%(<\?=\|<\?!\|[#:|]\)"
929 syn match p6RxP5Mod display contained "?-\?[impsx]\+"
930 syn match p6RxP5Mod display contained "?\%([-+]\?\d\+\|R\)"
931 syn match p6RxP5Mod display contained "?(DEFINE)"
932 syn match p6RxP5Mod display contained "?\%(&\|P[>=]\)" nextgroup=p6RxP5ModDef
933 syn match p6RxP5ModDef display contained "\h\w*"
934 syn region p6RxP5ModName
935 \ matchgroup=p6StringSpecial
939 syn region p6RxP5ModName
940 \ matchgroup=p6StringSpecial
944 syn region p6RxP5Code
945 \ matchgroup=p6StringSpecial
950 syn match p6RxP5EscMeta display contained "\\[?*.{}()[\]|\^$]"
951 syn match p6RxP5Count display contained "\%({\d\+\%(,\%(\d\+\)\?\)\?}\)\@=" nextgroup=p6RxP5CountId
952 syn region p6RxP5CountId
953 \ matchgroup=p6RxP5Escape
957 syn match p6RxP5Verb display contained "(\@<=\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\?\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\?\|ACCEPT\)"
958 syn region p6RxP5QuoteMeta
959 \ matchgroup=p6RxP5Escape
963 \ contains=@p6Variables,p6EscBackSlash
964 syn region p6RxP5CharClass
965 \ matchgroup=p6StringSpecial
970 \ contains=@p6RegexP5Class
971 syn region p6RxP5Posix
972 \ matchgroup=p6RxP5Escape
976 syn match p6RxP5Range display contained "-"
978 " 'string' inside a regex
979 syn region p6RxStringSQ
985 \ contains=p6EscQuote,p6EscBackSlash
987 " "string" inside a regex
988 syn region p6RxStringDQ
994 \ contains=p6EscDoubleQuote,p6EscBackSlash
996 " $!, $var, $!var, $::var, $package::var $*::package::var, etc
997 " Thus must come after the matches for the "$" regex anchor, but before
998 " the match for the $ regex delimiter
999 syn cluster p6Variables
1006 syn match p6VarSlash display "\$/"
1007 syn match p6VarExclam display "\$!"
1008 syn match p6VarMatch display "\$¢"
1009 syn match p6VarNum display "\$\d\+"
1010 syn match p6Variable display "\%(@@\|[@&$%]\$*\)\%(::\|\%(\%([.^*?=!~]\|:\@<!::\@!\)\K\)\|\K\)\@=" nextgroup=p6Twigil,p6VarName,p6PackageScope
1011 syn match p6VarName display "\K\%(\k\|[-']\K\@=\)*" contained
1012 syn match p6Twigil display "\%([.^*?=!~]\|:\@<!::\@!\)\K\@=" nextgroup=p6PackageScope,p6VarName contained
1013 syn match p6PackageScope display "\%(\K\%(\k\|[-']\K\@=\)*\)\?::" nextgroup=p6PackageScope,p6VarName contained
1015 " Perl 6 regex regions
1018 " Below some hacks to recognise the // variant. This is virtually impossible
1019 " to catch in all cases as the / is used in so many other ways, but these
1020 " should be the most obvious ones.
1021 " TODO: mostly stolen from perl.vim, might need more work
1023 \ matchgroup=p6Quote
1024 \ start="\%([$@%&*]\@<!\%(\<\%(split\|while\|until\|if\|unless\)\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=//\@!"
1026 \ start=+\s\@<=/[^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!/\@!+
1029 \ contains=@p6Regexen,p6Variable,p6VarExclam,p6VarMatch,p6VarNum
1031 " m/foo/, mm/foo/, rx/foo/
1033 \ matchgroup=p6Quote
1034 \ start="\%(\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=//\@!"
1038 \ contains=@p6Regexen,p6Variable,p6VarExclam,p6VarMatch,p6VarNum
1040 " m!foo!, mm!foo!, rx!foo!
1042 \ matchgroup=p6Quote
1043 \ start="\%(\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=!!\@!"
1047 \ contains=@p6Regexen,p6Variable,p6VarSlash,p6VarMatch,p6VarNum
1049 " m$foo$, mm$foo$, rx$foo$, m|foo|, mm|foo|, rx|foo|, etc
1051 \ matchgroup=p6Quote
1052 \ start="\%(\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\z([\"'`|,$]\)\$\@!"
1056 \ contains=@p6Regexen,@p6Variables
1058 " m (foo), mm (foo), rx (foo)
1060 \ matchgroup=p6Quote
1061 \ start="\%(\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s\+\)\@<=()\@!)\@!"
1064 \ contains=@p6Regexen,@p6Variables
1066 " m[foo], mm[foo], rx[foo]
1068 \ matchgroup=p6Quote
1069 \ start="\%(\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\[]\@!]\@!"
1072 \ contains=@p6Regexen,@p6Variables
1074 " m{foo}, mm{foo}, rx{foo}
1076 \ matchgroup=p6Quote
1077 \ start="\%(\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<={}\@!}\@!"
1080 \ contains=@p6Regexen,@p6Variables
1082 " m<foo>, mm<foo>, rx<foo>
1084 \ matchgroup=p6Quote
1085 \ start="\%(\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=<>\@!>\@!"
1088 \ contains=@p6Regexen,@p6Variables
1090 " m«foo», mm«foo», rx«foo»
1092 \ matchgroup=p6Quote
1093 \ start="\%(\<\%(mm\?\|rx\)\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=«»\@!»\@!"
1096 \ contains=@p6Regexen,@p6Variables
1102 \ matchgroup=p6Quote
1103 \ start="\%(\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=/"
1107 \ contains=@p6Regexen,p6Variable,p6VarExclam,p6VarMatch,p6VarNum
1108 \ nextgroup=p6Substitution
1110 syn region p6Substitution
1111 \ matchgroup=p6Quote
1117 \ contains=@p6Interp_qq
1121 \ matchgroup=p6Quote
1122 \ start="\%(\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=!"
1126 \ contains=@p6Regexen,p6Variable,p6VarSlash,p6VarMatch,p6VarNum
1127 \ nextgroup=p6Substitution
1129 syn region p6Substitution
1130 \ matchgroup=p6Quote
1136 \ contains=@p6Interp_qq
1138 " s$foo$bar$, s|foo|bar, etc
1140 \ matchgroup=p6Quote
1141 \ start="\%(\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\z([\"'`|,$]\)"
1145 \ contains=@p6Regexen,@p6Variables
1146 \ nextgroup=p6Substitution
1148 syn region p6Substitution
1149 \ matchgroup=p6Quote
1150 \ start="\z([\"'`|,$]\)"
1155 \ contains=@p6Interp_qq
1159 \ matchgroup=p6Quote
1160 \ start="\%(\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<={}\@!"
1163 \ contains=@p6Regexen,@p6Variables
1167 \ matchgroup=p6Quote
1168 \ start="\%(\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\[]\@!"
1171 \ contains=@p6Regexen,@p6Variables
1175 \ matchgroup=p6Quote
1176 \ start="\%(\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=<>\@!"
1179 \ contains=@p6Regexen,@p6Variables
1183 \ matchgroup=p6Quote
1184 \ start="\%(\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=«»\@!"
1187 \ contains=@p6Regexen,@p6Variables
1191 \ matchgroup=p6Quote
1192 \ start="\%(\<s\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s\+\)\@<=()\@!"
1195 \ contains=@p6Regexen,@p6Variables
1197 " Perl 5 regex regions
1201 \ matchgroup=p6Quote
1202 \ start="\%(\<m\s*:P\%(erl\)\?5\s*\)\@<=/"
1205 \ contains=@p6RegexP5,p6Variable,p6VarExclam,p6VarMatch,p6VarNum
1209 \ matchgroup=p6Quote
1210 \ start="\%(\<m\s*:P\%(erl\)\?5\s*\)\@<=!"
1213 \ contains=@p6RegexP5,p6Variable,p6VarSlash,p6VarMatch,p6VarNum
1215 " m:P5$$, m:P5||, etc
1217 \ matchgroup=p6Quote
1218 \ start="\%(\<m\s*:P\%(erl\)\?5\s*\)\@<=\z([\"'`|,$]\)"
1221 \ contains=@p6RegexP5,@p6Variables
1225 \ matchgroup=p6Quote
1226 \ start="\%(\<m\s*:P\%(erl\)\?5\s\+\)\@<=()\@!"
1229 \ contains=@p6RegexP5,@p6Variables
1233 \ matchgroup=p6Quote
1234 \ start="\%(\<m\s*:P\%(erl\)\?5\s*\)\@<=[]\@!"
1237 \ contains=@p6RegexP5,@p6Variables
1241 \ matchgroup=p6Quote
1242 \ start="\%(\<m\s*:P\%(erl\)\?5\s*\)\@<={}\@!"
1245 \ contains=@p6RegexP5,p6Variables
1249 \ matchgroup=p6Quote
1250 \ start="\%(\<m\s*:P\%(erl\)\?5\s*\)\@<=<>\@!"
1253 \ contains=@p6RegexP5,p6Variables
1257 \ matchgroup=p6Quote
1258 \ start="\%(\<m\s*:P\%(erl\)\?5\s*\)\@<=«»\@!"
1261 \ contains=@p6RegexP5,p6Variables
1265 " tr/foo/bar/, tr|foo|bar, etc
1267 \ matchgroup=p6Quote
1268 \ start="\%(\<tr\%(\s*:!\?\k\%(\k\|[-']\K\@=\)*\%(([^)]*)\)\?\)*\s*\)\@<=\z([/\"'`|!,$]\)"
1271 \ contains=p6RxRange
1272 \ nextgroup=p6Transliteration
1274 syn region p6Transliteration
1275 \ matchgroup=p6Quote
1276 \ start="\z([/\"'`|!,$]\)"
1280 \ contains=@p6Interp_qq
1284 " normal end-of-line comment
1285 syn match p6Comment display "#.*" contains=p6Attention
1287 " Multiline comments. Arbitrary numbers of opening brackets are allowed,
1288 " but we only define regions for 1 to 3
1289 syn region p6Comment
1290 \ matchgroup=p6Comment
1294 \ matchgroup=p6Error
1296 \ contains=p6Attention,p6Comment
1297 syn region p6Comment
1298 \ matchgroup=p6Comment
1302 \ matchgroup=p6Error
1304 \ contains=p6Attention,p6Comment
1305 syn region p6Comment
1306 \ matchgroup=p6Comment
1310 \ matchgroup=p6Error
1312 \ contains=p6Attention,p6Comment
1313 syn region p6Comment
1314 \ matchgroup=p6Comment
1318 \ matchgroup=p6Error
1320 \ contains=p6Attention,p6Comment
1321 syn region p6Comment
1322 \ matchgroup=p6Comment
1326 \ matchgroup=p6Error
1328 \ contains=p6Attention,p6Comment
1330 " double and triple delimiters
1331 if exists("perl6_extended_comments") || exists("perl6_extended_all")
1332 syn region p6Comment
1333 \ matchgroup=p6Comment
1335 \ skip="((\%([^)\|))\@!]\)*))"
1337 \ matchgroup=p6Error
1339 \ contains=p6Attention,p6Comment
1340 syn region p6Comment
1341 \ matchgroup=p6Comment
1343 \ skip="(((\%([^)]\|)\%())\)\@!\)*)))"
1345 \ matchgroup=p6Error
1347 \ contains=p6Attention,p6Comment
1349 syn region p6Comment
1350 \ matchgroup=p6Comment
1351 \ start="^\@<!#\[\["
1352 \ skip="\[\[\%([^\]]\|]]\@!\)*]]"
1354 \ matchgroup=p6Error
1356 \ contains=p6Attention,p6Comment
1357 syn region p6Comment
1358 \ matchgroup=p6Comment
1359 \ start="^\@<!#\[\[\["
1360 \ skip="\[\[\[\%([^\]]\|]\%(]]\)\@!\)*]]]"
1362 \ matchgroup=p6Error
1364 \ contains=p6Attention,p6Comment
1366 syn region p6Comment
1367 \ matchgroup=p6Comment
1369 \ skip="{{\%([^}]\|}}\@!\)*}}"
1371 \ matchgroup=p6Error
1373 \ contains=p6Attention,p6Comment
1374 syn region p6Comment
1375 \ matchgroup=p6Comment
1377 \ skip="{{{\%([^}]\|}\%(}}\)\@!\)*}}}"
1379 \ matchgroup=p6Error
1381 \ contains=p6Attention,p6Comment
1383 syn region p6Comment
1384 \ matchgroup=p6Comment
1386 \ skip="<<\%([^>]\|>>\@!\)*>>"
1388 \ matchgroup=p6Error
1390 \ contains=p6Attention,p6Comment
1391 syn region p6Comment
1392 \ matchgroup=p6Comment
1394 \ skip="<<<\%([^>]\|>\%(>>\)\@!\)*>>>"
1396 \ matchgroup=p6Error
1398 \ contains=p6Attention,p6Comment
1400 syn region p6Comment
1401 \ matchgroup=p6Comment
1403 \ skip="««\%([^»]\|»»\@!\)*»»"
1405 \ matchgroup=p6Error
1407 \ contains=p6Attention,p6Comment
1408 syn region p6Comment
1409 \ matchgroup=p6Comment
1411 \ skip="«««\%([^»]\|»\%(»»\)\@!\)*»»»"
1413 \ matchgroup=p6Error
1415 \ contains=p6Attention,p6Comment
1420 " Abbreviated blocks (implicit code forbidden)
1421 syn region p6PodAbbrRegion
1422 \ matchgroup=p6PodPrefix
1423 \ start="^=\ze\K\k*"
1424 \ end="^\ze\%(\s*$\|=\K\)"
1425 \ contains=p6PodAbbrNoCodeType
1428 syn region p6PodAbbrNoCodeType
1429 \ matchgroup=p6PodType
1431 \ end="^\ze\%(\s*$\|=\K\)"
1433 \ contains=p6PodName,p6PodAbbrNoCode
1435 syn match p6PodName contained ".\+" contains=@p6PodFormat
1436 syn match p6PodComment contained ".\+"
1438 syn region p6PodAbbrNoCode
1440 \ end="^\ze\%(\s*$\|=\K\)"
1442 \ contains=@p6PodFormat
1444 " Abbreviated blocks (everything is code)
1445 syn region p6PodAbbrRegion
1446 \ matchgroup=p6PodPrefix
1447 \ start="^=\zecode\>"
1448 \ end="^\ze\%(\s*$\|=\K\)"
1449 \ contains=p6PodAbbrCodeType
1452 syn region p6PodAbbrCodeType
1453 \ matchgroup=p6PodType
1455 \ end="^\ze\%(\s*$\|=\K\)"
1457 \ contains=p6PodName,p6PodAbbrCode
1459 syn region p6PodAbbrCode
1461 \ end="^\ze\%(\s*$\|=\K\)"
1464 " Abbreviated blocks (everything is a comment)
1465 syn region p6PodAbbrRegion
1466 \ matchgroup=p6PodPrefix
1467 \ start="^=\zecomment\>"
1468 \ end="^\ze\%(\s*$\|=\K\)"
1469 \ contains=p6PodAbbrCommentType
1472 syn region p6PodAbbrCommentType
1473 \ matchgroup=p6PodType
1475 \ end="^\ze\%(\s*$\|=\K\)"
1477 \ contains=p6PodComment,p6PodAbbrNoCode
1479 " Abbreviated blocks (implicit code allowed)
1480 syn region p6PodAbbrRegion
1481 \ matchgroup=p6PodPrefix
1482 \ start="^=\ze\%(pod\|item\|nested\|\u\+\)\>"
1483 \ end="^\ze\%(\s*$\|=\K\)"
1484 \ contains=p6PodAbbrType
1487 syn region p6PodAbbrType
1488 \ matchgroup=p6PodType
1490 \ end="^\ze\%(\s*$\|=\K\)"
1492 \ contains=p6PodName,p6PodAbbr
1494 syn region p6PodAbbr
1496 \ end="^\ze\%(\s*$\|=\K\)"
1498 \ contains=@p6PodFormat,p6PodImplicitCode
1500 " Abbreviated block to end-of-file
1501 syn region p6PodAbbrRegion
1502 \ matchgroup=p6PodPrefix
1503 \ start="^=\zeEND\>"
1505 \ contains=p6PodAbbrEOFType
1508 syn region p6PodAbbrEOFType
1509 \ matchgroup=p6PodType
1513 \ contains=p6PodName,p6PodAbbrEOF
1515 syn region p6PodAbbrEOF
1519 \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode
1522 syn region p6PodDirectRegion
1523 \ matchgroup=p6PodPrefix
1524 \ start="^=\%(config\|use\)\>"
1525 \ end="^\ze\%([^=]\|=\K\|\s*$\)"
1526 \ contains=p6PodDirectArgRegion
1529 syn region p6PodDirectArgRegion
1530 \ matchgroup=p6PodType
1532 \ end="^\ze\%([^=]\|=\K\|\s*$\)"
1534 \ contains=p6PodDirectConfigRegion
1536 syn region p6PodDirectConfigRegion
1538 \ end="^\ze\%([^=]\|=\K\|\s*$\)"
1540 \ contains=@p6PodConfig
1542 " =encoding is a special directive
1543 syn region p6PodDirectRegion
1544 \ matchgroup=p6PodPrefix
1545 \ start="^=encoding\>"
1546 \ end="^\ze\%([^=]\|=\K\|\s*$\)"
1547 \ contains=p6PodEncodingArgRegion
1550 syn region p6PodEncodingArgRegion
1551 \ matchgroup=p6PodName
1553 \ end="^\ze\%([^=]\|=\K\|\s*$\)"
1556 " Paragraph blocks (implicit code forbidden)
1557 syn region p6PodParaRegion
1558 \ matchgroup=p6PodPrefix
1560 \ end="^\ze\%(\s*$\|=\K\)"
1561 \ contains=p6PodParaNoCodeTypeRegion
1565 syn region p6PodParaNoCodeTypeRegion
1566 \ matchgroup=p6PodType
1568 \ end="^\ze\%(\s*$\|=\K\)"
1570 \ contains=p6PodParaNoCode,p6PodParaConfigRegion
1572 syn region p6PodParaConfigRegion
1574 \ end="^\ze\%([^=]\|=\k\@<!\)"
1576 \ contains=@p6PodConfig
1578 syn region p6PodParaNoCode
1580 \ end="^\ze\%(\s*$\|=\K\)"
1582 \ contains=@p6PodFormat
1584 " Paragraph blocks (everything is code)
1585 syn region p6PodParaRegion
1586 \ matchgroup=p6PodPrefix
1587 \ start="^=for\>\ze\s*code\>"
1588 \ end="^\ze\%(\s*$\|=\K\)"
1589 \ contains=p6PodParaCodeTypeRegion
1593 syn region p6PodParaCodeTypeRegion
1594 \ matchgroup=p6PodType
1596 \ end="^\ze\%(\s*$\|=\K\)"
1598 \ contains=p6PodParaCode,p6PodParaConfigRegion
1600 syn region p6PodParaCode
1602 \ end="^\ze\%(\s*$\|=\K\)"
1605 " Paragraph blocks (implicit code allowed)
1606 syn region p6PodParaRegion
1607 \ matchgroup=p6PodPrefix
1608 \ start="^=for\>\ze\s*\%(pod\|item\|nested\|\u\+\)\>"
1609 \ end="^\ze\%(\s*$\|=\K\)"
1610 \ contains=p6PodParaTypeRegion
1614 syn region p6PodParaTypeRegion
1615 \ matchgroup=p6PodType
1617 \ end="^\ze\%(\s*$\|=\K\)"
1619 \ contains=p6PodPara,p6PodParaConfigRegion
1621 syn region p6PodPara
1623 \ end="^\ze\%(\s*$\|=\K\)"
1625 \ contains=@p6PodFormat,p6PodImplicitCode
1627 " Paragraph block to end-of-file
1628 syn region p6PodParaRegion
1629 \ matchgroup=p6PodPrefix
1630 \ start="^=for\>\ze\s\+END\>"
1632 \ contains=p6PodParaEOFTypeRegion
1636 syn region p6PodParaEOFTypeRegion
1637 \ matchgroup=p6PodType
1641 \ contains=p6PodParaEOF,p6PodParaConfigRegion
1643 syn region p6PodParaEOF
1647 \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode
1649 " Delimited blocks (implicit code forbidden)
1650 syn region p6PodDelimRegion
1651 \ matchgroup=p6PodPrefix
1654 \ contains=p6PodDelimNoCodeTypeRegion
1658 syn region p6PodDelimNoCodeTypeRegion
1659 \ matchgroup=p6PodType
1663 \ contains=p6PodDelimNoCode,p6PodDelimConfigRegion
1665 syn region p6PodDelimConfigRegion
1667 \ end="^\ze\%([^=]\|=\K\|\s*$\)"
1669 \ contains=@p6PodConfig
1671 syn region p6PodDelimNoCode
1675 \ contains=@p6PodNestedBlocks,@p6PodFormat
1677 " Delimited blocks (everything is code)
1678 syn region p6PodDelimRegion
1679 \ matchgroup=p6PodPrefix
1680 \ start="^=begin\>\ze\s*code\>"
1682 \ contains=p6PodDelimCodeTypeRegion
1686 syn region p6PodDelimCodeTypeRegion
1687 \ matchgroup=p6PodType
1691 \ contains=p6PodDelimCode,p6PodDelimConfigRegion
1693 syn region p6PodDelimCode
1697 \ contains=@p6PodNestedBlocks
1699 " Delimited blocks (implicit code allowed)
1700 syn region p6PodDelimRegion
1701 \ matchgroup=p6PodPrefix
1702 \ start="^=begin\>\ze\s*\%(pod\|item\|nested\|\u\+\)\>"
1704 \ contains=p6PodDelimTypeRegion
1708 syn region p6PodDelimTypeRegion
1709 \ matchgroup=p6PodType
1713 \ contains=p6PodDelim,p6PodDelimConfigRegion
1715 syn region p6PodDelim
1719 \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode
1721 " Delimited block to end-of-file
1722 syn region p6PodDelimRegion
1723 \ matchgroup=p6PodPrefix
1724 \ start="^=begin\>\ze\s\+END\>"
1726 \ contains=p6PodDelimEOFTypeRegion
1729 syn region p6PodDelimEOFTypeRegion
1730 \ matchgroup=p6PodType
1734 \ contains=p6PodDelimEOF,p6PodDelimConfigRegion
1736 syn region p6PodDelimEOF
1740 \ contains=@p6PodNestedBlocks,@p6PodFormat,p6PodImplicitCode
1742 syn cluster p6PodConfig
1743 \ add=p6PodConfigOperator
1744 \ add=p6PodExtraConfig
1746 \ add=p6PodAutoQuote
1749 syn region p6PodParens
1753 \ contains=p6Number,p6StringSQ
1755 syn match p6PodAutoQuote display contained "=>"
1756 syn match p6PodConfigOperator display contained ":!\?" nextgroup=p6PodConfigOption
1757 syn match p6PodConfigOption display contained "[^[:space:](<]\+" nextgroup=p6PodParens,p6StringAngle
1758 syn match p6PodExtraConfig display contained "^="
1759 syn match p6PodVerticalBar display contained "|"
1760 syn match p6PodColon display contained ":"
1761 syn match p6PodSemicolon display contained ";"
1762 syn match p6PodComma display contained ","
1763 syn match p6PodImplicitCode display contained "^\s.*"
1765 syn region p6PodDelimEndRegion
1766 \ matchgroup=p6PodType
1767 \ start="\%(^=end\>\)\@<="
1770 " These may appear inside delimited blocks
1771 syn cluster p6PodNestedBlocks
1772 \ add=p6PodAbbrRegion
1773 \ add=p6PodDirectRegion
1774 \ add=p6PodParaRegion
1775 \ add=p6PodDelimRegion
1776 \ add=p6PodDelimEndRegion
1778 " Pod formatting codes
1780 syn cluster p6PodFormat
1781 \ add=p6PodFormatOne
1782 \ add=p6PodFormatTwo
1783 \ add=p6PodFormatThree
1784 \ add=p6PodFormatFrench
1786 " Balanced angles found inside formatting codes. Ensures proper nesting.
1788 syn region p6PodFormatAnglesOne
1789 \ matchgroup=p6PodFormat
1795 \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne
1797 syn region p6PodFormatAnglesTwo
1798 \ matchgroup=p6PodFormat
1804 \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo
1806 syn region p6PodFormatAnglesThree
1807 \ matchgroup=p6PodFormat
1809 \ skip="<<<[^>]*>>>"
1813 \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo,p6PodFormatAnglesThree
1815 syn region p6PodFormatAnglesFrench
1816 \ matchgroup=p6PodFormat
1822 \ contains=p6PodFormatAnglesFrench,p6PodFormatAnglesOne,p6PodFormatAnglesTwo,p6PodFormatAnglesThree
1824 " All formatting codes
1826 syn region p6PodFormatOne
1827 \ matchgroup=p6PodFormatCode
1832 \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne
1834 syn region p6PodFormatTwo
1835 \ matchgroup=p6PodFormatCode
1840 \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo
1842 syn region p6PodFormatThree
1843 \ matchgroup=p6PodFormatCode
1845 \ skip="<<<[^>]*>>>"
1848 \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree
1850 syn region p6PodFormatFrench
1851 \ matchgroup=p6PodFormatCode
1856 \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree
1858 " C<> and V<> don't allow nested formatting formatting codes
1860 syn region p6PodFormatOne
1861 \ matchgroup=p6PodFormatCode
1866 \ contains=p6PodFormatAnglesOne
1868 syn region p6PodFormatTwo
1869 \ matchgroup=p6PodFormatCode
1874 \ contains=p6PodFormatAnglesTwo
1876 syn region p6PodFormatThree
1877 \ matchgroup=p6PodFormatCode
1879 \ skip="<<<[^>]*>>>"
1882 \ contains=p6PodFormatAnglesThree
1884 syn region p6PodFormatFrench
1885 \ matchgroup=p6PodFormatCode
1890 \ contains=p6PodFormatAnglesFrench
1892 " L<> can have a "|" separator
1894 syn region p6PodFormatOne
1895 \ matchgroup=p6PodFormatCode
1900 \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar
1902 syn region p6PodFormatTwo
1903 \ matchgroup=p6PodFormatCode
1908 \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar
1910 syn region p6PodFormatThree
1911 \ matchgroup=p6PodFormatCode
1913 \ skip="<<<[^>]*>>>"
1916 \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar
1918 syn region p6PodFormatFrench
1919 \ matchgroup=p6PodFormatCode
1924 \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar
1926 " E<> can have a ";" separator
1928 syn region p6PodFormatOne
1929 \ matchgroup=p6PodFormatCode
1934 \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodSemiColon
1936 syn region p6PodFormatTwo
1937 \ matchgroup=p6PodFormatCode
1942 \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodSemiColon
1944 syn region p6PodFormatThree
1945 \ matchgroup=p6PodFormatCode
1947 \ skip="<<<[^>]*>>>"
1950 \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodSemiColon
1952 syn region p6PodFormatFrench
1953 \ matchgroup=p6PodFormatCode
1958 \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodSemiColon
1960 " M<> can have a ":" separator
1962 syn region p6PodFormatOne
1963 \ matchgroup=p6PodFormatCode
1968 \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodColon
1970 syn region p6PodFormatTwo
1971 \ matchgroup=p6PodFormatCode
1976 \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodColon
1978 syn region p6PodFormatThree
1979 \ matchgroup=p6PodFormatCode
1981 \ skip="<<<[^>]*>>>"
1984 \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodColon
1986 syn region p6PodFormatFrench
1987 \ matchgroup=p6PodFormatCode
1992 \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodColon
1994 " D<> can have "|" and ";" separators
1996 syn region p6PodFormatOne
1997 \ matchgroup=p6PodFormatCode
2002 \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar,p6PodSemiColon
2004 syn region p6PodFormatTwo
2005 \ matchgroup=p6PodFormatCode
2010 \ contains=p6PodFormatAngleTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar,p6PodSemiColon
2012 syn region p6PodFormatThree
2013 \ matchgroup=p6PodFormatCode
2015 \ skip="<<<[^>]*>>>"
2018 \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon
2020 syn region p6PodFormatFrench
2021 \ matchgroup=p6PodFormatCode
2026 \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon
2028 " X<> can have "|", "," and ";" separators
2030 syn region p6PodFormatOne
2031 \ matchgroup=p6PodFormatCode
2036 \ contains=p6PodFormatAnglesOne,p6PodFormatFrench,p6PodFormatOne,p6PodVerticalBar,p6PodSemiColon,p6PodComma
2038 syn region p6PodFormatTwo
2039 \ matchgroup=p6PodFormatCode
2044 \ contains=p6PodFormatAnglesTwo,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodVerticalBar,p6PodSemiColon,p6PodComma
2046 syn region p6PodFormatThree
2047 \ matchgroup=p6PodFormatCode
2049 \ skip="<<<[^>]*>>>"
2052 \ contains=p6PodFormatAnglesThree,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon,p6PodComma
2054 syn region p6PodFormatFrench
2055 \ matchgroup=p6PodFormatCode
2060 \ contains=p6PodFormatAnglesFrench,p6PodFormatFrench,p6PodFormatOne,p6PodFormatTwo,p6PodFormatThree,p6PodVerticalBar,p6PodSemiColon,p6PodComma
2062 " Define the default highlighting.
2063 " For version 5.7 and earlier: only when not done already
2064 " For version 5.8 and later: only when an item doesn't have highlighting yet
2065 if version >= 508 || !exists("did_perl6_syntax_inits")
2067 let did_perl6_syntax_inits = 1
2068 command -nargs=+ HiLink hi link <args>
2070 command -nargs=+ HiLink hi def link <args>
2073 HiLink p6EscOctOld p6Error
2074 HiLink p6PackageTwigil p6Twigil
2075 HiLink p6StringAngle p6String
2076 HiLink p6StringFrench p6String
2077 HiLink p6StringAngles p6String
2078 HiLink p6StringSQ p6String
2079 HiLink p6StringDQ p6String
2080 HiLink p6StringQ p6String
2081 HiLink p6RxStringSQ p6String
2082 HiLink p6RxStringDQ p6String
2083 HiLink p6Substitution p6String
2084 HiLink p6Transliteration p6String
2085 HiLink p6StringAuto p6String
2086 HiLink p6StringP5Auto p6String
2087 HiLink p6Key p6String
2088 HiLink p6Match p6String
2089 HiLink p6RegexBlock p6String
2090 HiLink p6RxP5CharClass p6String
2091 HiLink p6RxP5QuoteMeta p6String
2092 HiLink p6RxCharClass p6String
2093 HiLink p6RxQuoteWords p6String
2094 HiLink p6ReduceOp p6Operator
2095 HiLink p6ReverseCrossOp p6Operator
2096 HiLink p6HyperOp p6Operator
2097 HiLink p6QuoteQ p6Operator
2098 HiLink p6RxRange p6StringSpecial
2099 HiLink p6RxAnchor p6StringSpecial
2100 HiLink p6RxP5Anchor p6StringSpecial
2101 HiLink p6CodePoint p6StringSpecial
2102 HiLink p6RxMeta p6StringSpecial
2103 HiLink p6RxP5Range p6StringSpecial
2104 HiLink p6RxP5CPId p6StringSpecial
2105 HiLink p6RxP5Posix p6StringSpecial
2106 HiLink p6RxP5Mod p6StringSpecial
2107 HiLink p6RxP5HexSeq p6StringSpecial
2108 HiLink p6RxP5OctSeq p6StringSpecial
2109 HiLink p6RxP5WriteRefId p6StringSpecial
2110 HiLink p6HexSequence p6StringSpecial
2111 HiLink p6OctSequence p6StringSpecial
2112 HiLink p6RxP5Named p6StringSpecial
2113 HiLink p6RxP5PropId p6StringSpecial
2114 HiLink p6RxP5Quantifier p6StringSpecial
2115 HiLink p6RxP5CountId p6StringSpecial
2116 HiLink p6RxP5Verb p6StringSpecial
2117 HiLink p6Escape p6StringSpecial2
2118 HiLink p6EscNull p6StringSpecial2
2119 HiLink p6EscHash p6StringSpecial2
2120 HiLink p6EscQQ p6StringSpecial2
2121 HiLink p6EscQuote p6StringSpecial2
2122 HiLink p6EscDoubleQuote p6StringSpecial2
2123 HiLink p6EscBackTick p6StringSpecial2
2124 HiLink p6EscForwardSlash p6StringSpecial2
2125 HiLink p6EscVerticalBar p6StringSpecial2
2126 HiLink p6EscExclamation p6StringSpecial2
2127 HiLink p6EscDollar p6StringSpecial2
2128 HiLink p6EscOpenCurly p6StringSpecial2
2129 HiLink p6EscCloseCurly p6StringSpecial2
2130 HiLink p6EscCloseBracket p6StringSpecial2
2131 HiLink p6EscCloseAngle p6StringSpecial2
2132 HiLink p6EscCloseFrench p6StringSpecial2
2133 HiLink p6EscBackSlash p6StringSpecial2
2134 HiLink p6RxEscape p6StringSpecial2
2135 HiLink p6RxCapture p6StringSpecial2
2136 HiLink p6RxAlternation p6StringSpecial2
2137 HiLink p6RxP5 p6StringSpecial2
2138 HiLink p6RxP5ReadRef p6StringSpecial2
2139 HiLink p6RxP5Oct p6StringSpecial2
2140 HiLink p6RxP5Hex p6StringSpecial2
2141 HiLink p6RxP5EscMeta p6StringSpecial2
2142 HiLink p6RxP5Meta p6StringSpecial2
2143 HiLink p6RxP5Escape p6StringSpecial2
2144 HiLink p6RxP5CodePoint p6StringSpecial2
2145 HiLink p6RxP5WriteRef p6StringSpecial2
2146 HiLink p6RxP5Prop p6StringSpecial2
2148 HiLink p6Property Tag
2149 HiLink p6Attention Todo
2151 HiLink p6Error Error
2152 HiLink p6BlockLabel Label
2153 HiLink p6Float Float
2154 HiLink p6Normal Normal
2155 HiLink p6Package Normal
2156 HiLink p6PackageScope Normal
2157 HiLink p6Number Number
2158 HiLink p6VersionNum Number
2159 HiLink p6String String
2160 HiLink p6Repeat Repeat
2161 HiLink p6Keyword Keyword
2162 HiLink p6Pragma Keyword
2163 HiLink p6Module Keyword
2164 HiLink p6DeclareRoutine Keyword
2165 HiLink p6VarStorage Special
2166 HiLink p6FlowControl Special
2167 HiLink p6NumberBase Special
2168 HiLink p6Twigil Special
2169 HiLink p6StringSpecial2 Special
2170 HiLink p6VersionDot Special
2171 HiLink p6Comment Comment
2172 HiLink p6Include Include
2173 HiLink p6Shebang PreProc
2174 HiLink p6ClosureTrait PreProc
2175 HiLink p6Routine Function
2176 HiLink p6Operator Operator
2177 HiLink p6Version Operator
2178 HiLink p6Context Operator
2179 HiLink p6Quote Delimiter
2180 HiLink p6TypeConstraint PreCondit
2181 HiLink p6Exception Exception
2182 HiLink p6Placeholder Identifier
2183 HiLink p6Variable Identifier
2184 HiLink p6VarSlash Identifier
2185 HiLink p6VarNum Identifier
2186 HiLink p6VarExclam Identifier
2187 HiLink p6VarMatch Identifier
2188 HiLink p6VarName Identifier
2189 HiLink p6MatchVar Identifier
2190 HiLink p6RxP5ReadRefId Identifier
2191 HiLink p6RxP5ModDef Identifier
2192 HiLink p6RxP5ModName Identifier
2193 HiLink p6Conditional Conditional
2194 HiLink p6StringSpecial SpecialChar
2196 HiLink p6PodAbbr p6Pod
2197 HiLink p6PodAbbrEOF p6Pod
2198 HiLink p6PodAbbrNoCode p6Pod
2199 HiLink p6PodAbbrCode p6PodCode
2200 HiLink p6PodPara p6Pod
2201 HiLink p6PodParaEOF p6Pod
2202 HiLink p6PodParaNoCode p6Pod
2203 HiLink p6PodParaCode p6PodCode
2204 HiLink p6PodDelim p6Pod
2205 HiLink p6PodDelimEOF p6Pod
2206 HiLink p6PodDelimNoCode p6Pod
2207 HiLink p6PodDelimCode p6PodCode
2208 HiLink p6PodImplicitCode p6PodCode
2209 HiLink p6PodExtraConfig p6PodPrefix
2210 HiLink p6PodVerticalBar p6PodFormatCode
2211 HiLink p6PodColon p6PodFormatCode
2212 HiLink p6PodSemicolon p6PodFormatCode
2213 HiLink p6PodComma p6PodFormatCode
2214 HiLink p6PodFormatOne p6PodFormat
2215 HiLink p6PodFormatTwo p6PodFormat
2216 HiLink p6PodFormatThree p6PodFormat
2217 HiLink p6PodFormatFrench p6PodFormat
2219 HiLink p6PodType Type
2220 HiLink p6PodConfigOption String
2221 HiLink p6PodCode PreProc
2222 HiLink p6Pod Comment
2223 HiLink p6PodComment Comment
2224 HiLink p6PodAutoQuote Operator
2225 HiLink p6PodConfigOperator Operator
2226 HiLink p6PodPrefix Statement
2227 HiLink p6PodName Identifier
2228 HiLink p6PodFormatCode SpecialChar
2229 HiLink p6PodFormat SpecialComment
2234 " Syncing to speed up processing
2235 "syn sync match p6SyncPod groupthere p6PodAbbrRegion "^=\K\k*\>"
2236 "syn sync match p6SyncPod groupthere p6PodDirectRegion "^=\%(config\|use\|encoding\)\>"
2237 "syn sync match p6SyncPod groupthere p6PodParaRegion "^=for\>"
2238 "syn sync match p6SyncPod groupthere p6PodDelimRegion "^=begin\>"
2239 "syn sync match p6SyncPod groupthere p6PodDelimEndRegion "^=end\>"
2241 " Let's just sync whole file, the other methods aren't reliable (or I don't
2242 " know how to use them reliably)
2245 setlocal foldmethod=syntax
2247 let b:current_syntax = "perl6"
2249 " vim:ts=8:sts=4:sw=4:expandtab:ft=vim