| 42 | | syn keyword p6Attention ACHTUNG ATTN ATTENTION FIXME NB contained |
| 43 | | syn keyword p6Attention TODO TBD WTF XXX NOTE contained |
| 44 | | " XXX subset declares a type, but not a module, how should it be classified? |
| 45 | | syn keyword p6Module module class role use require package enum |
| 46 | | syn keyword p6Module grammar subset self |
| 47 | | syn keyword p6DeclareRoutine macro sub submethod method multi only rule |
| 48 | | syn keyword p6DeclareRoutine token regex category |
| 49 | | syn keyword p6VarStorage let my our state temp has proto constant |
| 50 | | syn keyword p6Repeat for loop repeat while until gather |
| 51 | | syn keyword p6FlowControl take do when next last redo given return |
| 52 | | syn keyword p6FlowControl default exit make |
| 53 | | syn keyword p6TypeConstraint is as but does trusts of returns also |
| 54 | | syn keyword p6ClosureTrait BEGIN CHECK INIT START FIRST ENTER LEAVE KEEP |
| 55 | | syn keyword p6ClosureTrait UNDO NEXT LAST PRE POST END |
| 56 | | syn keyword p6Exception die fail try CATCH CONTROL warn |
| 57 | | syn keyword p6Property prec irs ofs ors pos export deep |
| 58 | | syn keyword p6Property rw parsed cached readonly |
| 59 | | syn keyword p6Property ref copy inline tighter looser equiv assoc |
| 60 | | syn keyword p6Type Object Any Junction Whatever Capture Match |
| 61 | | syn keyword p6Type Signature Proxy Matcher Package Module Class |
| 62 | | syn keyword p6Type Grammar Scalar Array Hash KeyHash KeySet KeyBag |
| 63 | | syn keyword p6Type Pair List Seq Range Set Bag Mapping Void Undef |
| 64 | | syn keyword p6Type Failure Exception Code Block Routine Sub Macro |
| 65 | | syn keyword p6Type Method Submethod Regex Str Blob Char Byte |
| 66 | | syn keyword p6Type Codepoint Grapheme StrPos StrLen Version Num |
| 67 | | syn keyword p6Type Complex num complex Bit Bool bit bool Order |
| 68 | | syn keyword p6Type Increasing Decreasing Ordered Callable AnyChar |
| 69 | | syn keyword p6Type Positional Associative Ordering KeyExtractor |
| 70 | | syn keyword p6Type Comparator OrderingPair IO KitchenSink |
| 71 | | syn keyword p6Type Int int int1 int2 int4 int8 int16 int32 int64 |
| 72 | | syn keyword p6Type Rat rat rat1 rat2 rat4 rat8 rat16 rat32 rat64 |
| 73 | | syn keyword p6Type UInt uint uint1 uint2 uint4 uint8 uint16 |
| 74 | | syn keyword p6Type uint32 uint64 Buf buf buf1 buf2 buf4 buf8 |
| 75 | | syn keyword p6Type buf16 buf32 buf64 True False |
| 76 | | syn keyword p6Number NaN Inf |
| 77 | | syn keyword p6Routine WHAT WHICH VAR eager hyper substr index rindex |
| 78 | | syn keyword p6Routine grep map sort join split reduce min max reverse |
| 79 | | syn keyword p6Routine truncate zip cat roundrobin classify first sum |
| 80 | | syn keyword p6Routine keys values pairs defined delete exists elems |
| 81 | | syn keyword p6Routine end kv arity assuming pick slice clone key new |
| 82 | | syn keyword p6Routine any all none one wrap shape classify value |
| 83 | | syn keyword p6Routine callsame callwith nextsame nextwith ACCEPTS |
| 84 | | syn keyword p6Routine pop push shift splice unshift floor ceiling |
| 85 | | syn keyword p6Routine abs exp log log10 rand sign sqrt sin cos tan |
| 86 | | syn keyword p6Routine round srand roots cis unpolar polar atan2 |
| 87 | | syn keyword p6Routine p5chop chop p5chomp chomp lc lcfirst uc ucfirst |
| 88 | | syn keyword p6Routine capitalize normalize pack unpack quotemeta comb |
| 89 | | syn keyword p6Routine samecase sameaccent chars nfd nfc nfkd nfkc |
| 90 | | syn keyword p6Routine printf sprintf caller evalfile run runinstead |
| 91 | | syn keyword p6Routine nothing want bless chr ord list item gmtime |
| 92 | | syn keyword p6Routine localtime time gethost getpw chroot getlogin |
| 93 | | syn keyword p6Routine kill fork wait perl context graphs codes bytes |
| 94 | | syn keyword p6Routine print open read write readline say seek close |
| 95 | | syn keyword p6Routine opendir readdir slurp pos fmt vec link unlink |
| 96 | | syn keyword p6Routine symlink uniq pair asin acos atan sec cosec |
| 97 | | syn keyword p6Routine cotan asec acosec acotan sinh cosh tanh asinh |
| 98 | | syn keyword p6Routine acosh atanh sech cosech cotanh sech acosech |
| 99 | | syn keyword p6Routine acotanh plan ok dies_ok lives_ok skip todo |
| 100 | | syn keyword p6Routine pass flunk force_todo use_ok isa_ok cmp_ok |
| 101 | | syn keyword p6Routine diag is_deeply isnt like skip_rest unlike |
| 102 | | syn keyword p6Routine nonce skip_rest eval_dies_ok eval_lives_ok |
| 103 | | syn keyword p6Routine approx is_approx throws_ok version_lt signature |
| 104 | | syn keyword p6Routine eval operator undef undefine sleep from to |
| 105 | | syn keyword p6Routine infix postfix prefix circumfix postcircumfix |
| 106 | | syn keyword p6Routine minmax |
| 107 | | syn keyword p6Operator x xx div mod also leg cmp |
| 108 | | syn keyword p6Operator eq ne lt le gt ge eqv ff fff true not Z |
| 109 | | syn keyword p6Operator X XeqvX and andthen or xor orelse extra |
| | 44 | " Don't use the "syn keyword" construct because that always has a higher |
| | 45 | " priority than matches/regions, so the words can't be autoquoted with |
| | 46 | " the "=>" and "p5=>" operators |
| | 47 | syn match p6Attention display "\k\@<!\%(ACHTUNG\|ATTN\|ATTENTION\|FIXME\)\k\@!" contained |
| | 48 | syn match p6Attention display "\k\@<!\%(NB\|TODO\|TBD\|WTF\|XXX\|NOTE\)\k\@!" contained |
| | 49 | syn match p6DeclareRoutine display "\k\@<!\%(macro\|sub\|submethod\|method\|multi\|only\|rule\)\k\@!" |
| | 50 | syn match p6DeclareRoutine display "\k\@<!\%(token\|regex\|category\)\k\@!" |
| | 51 | syn match p6Module display "\k\@<!\%(module\|class\|role\|use\|require\|package\|enum\)\k\@!" |
| | 52 | syn match p6Module display "\k\@<!\%(grammar\|subset\|self\)\k\@!" |
| | 53 | syn match p6VarStorage display "\k\@<!\%(let\|my\|our\|state\|temp\|has\|proto\|constant\)\k\@!" |
| | 54 | syn match p6Repeat display "\k\@<!\%(for\|loop\|repeat\|while\|until\|gather\)\k\@!" |
| | 55 | syn match p6FlowControl display "\k\@<!\%(take\|do\|when\|next\|last\|redo\|given\|return\)\k\@!" |
| | 56 | syn match p6FlowControl display "\k\@<!\%(default\|exit\|make\|continue\|break\|goto\|leave\)\k\@!" |
| | 57 | syn match p6TypeConstraint display "\k\@<!\%(is\|as\|but\|does\|trusts\|of\|returns\|also\)\k\@!" |
| | 58 | syn match p6ClosureTrait display "\k\@<!\%(BEGIN\|CHECK\|INIT\|START\|FIRST\|ENTER\|LEAVE\|KEEP\)\k\@!" |
| | 59 | syn match p6ClosureTrait display "\k\@<!\%(UNDO\|NEXT\|LAST\|PRE\|POST\|END\|CATCH\|CONTROL\)\k\@!" |
| | 60 | syn match p6Exception display "\k\@<!\%(die\|fail\|try\|warn\)\k\@!" |
| | 61 | syn match p6Property display "\k\@<!\%(prec\|irs\|ofs\|ors\|export\|deep\)\k\@!" |
| | 62 | syn match p6Property display "\k\@<!\%(rw\|parsed\|cached\|readonly\)\k\@!" |
| | 63 | syn match p6Property display "\k\@<!\%(ref\|copy\|inline\|tighter\|looser\|equiv\|assoc\)\k\@!" |
| | 64 | syn match p6Type display "\k\@<!\%(Object\|Any\|Junction\|Whatever\|Capture\|Match\)\k\@!" |
| | 65 | syn match p6Type display "\k\@<!\%(Signature\|Proxy\|Matcher\|Package\|Module\|Class\)\k\@!" |
| | 66 | syn match p6Type display "\k\@<!\%(Grammar\|Scalar\|Array\|Hash\|KeyHash\|KeySet\|KeyBag\)\k\@!" |
| | 67 | syn match p6Type display "\k\@<!\%(Pair\|List\|Seq\|Range\|Set\|Bag\|Mapping\|Void\|Undef\)\k\@!" |
| | 68 | syn match p6Type display "\k\@<!\%(Failure\|Exception\|Code\|Block\|Routine\|Sub\|Macro\)\k\@!" |
| | 69 | syn match p6Type display "\k\@<!\%(Method\|Submethod\|Regex\|Str\|Blob\|Char\|Byte\)\k\@!" |
| | 70 | syn match p6Type display "\k\@<!\%(Codepoint\|Grapheme\|StrPos\|StrLen\|Version\|Num\)\k\@!" |
| | 71 | syn match p6Type display "\k\@<!\%(Complex\|num\|complex\|Bit\|Bool\|bit\|bool\|Order\)\k\@!" |
| | 72 | syn match p6Type display "\k\@<!\%(Increasing\|Decreasing\|Ordered\|Callable\|AnyChar\)\k\@!" |
| | 73 | syn match p6Type display "\k\@<!\%(Positional\|Associative\|Ordering\|KeyExtractor\|Bool::False\)\k\@!" |
| | 74 | syn match p6Type display "\k\@<!\%(Comparator\|OrderingPair\|IO\|KitchenSink\|Bool::True\)\k\@!" |
| | 75 | syn match p6Type display "\k\@<!\%(Int\|int\|int1\|int2\|int4\|int8\|int16\|int32\|int64\)\k\@!" |
| | 76 | syn match p6Type display "\k\@<!\%(Rat\|rat\|rat1\|rat2\|rat4\|rat8\|rat16\|rat32\|rat64\)\k\@!" |
| | 77 | syn match p6Type display "\k\@<!\%(UInt\|uint\|uint1\|uint2\|uint4\|uint8\|uint16\)\k\@!" |
| | 78 | syn match p6Type display "\k\@<!\%(uint32\|uint64\|Buf\|buf\|buf1\|buf2\|buf4\|buf8\)\k\@!" |
| | 79 | syn match p6Type display "\k\@<!\%(buf16\|buf32\|buf64\|True\|false\)\k\@!" |
| | 80 | syn match p6Number display "\k\@<!\%(NaN\|Inf\)\k\@!" |
| | 81 | syn match p6Routine display "\k\@<!\%(WHAT\|WHICH\|VAR\|eager\|hyper\|substr\|index\|rindex\)\k\@!" |
| | 82 | syn match p6Routine display "\k\@<!\%(grep\|map\|sort\|join\|split\|reduce\|min\|max\|reverse\)\k\@!" |
| | 83 | syn match p6Routine display "\k\@<!\%(truncate\|zip\|cat\|roundrobin\|classify\|first\|sum\)\k\@!" |
| | 84 | syn match p6Routine display "\k\@<!\%(keys\|values\|pairs\|defined\|delete\|exists\|elems\)\k\@!" |
| | 85 | syn match p6Routine display "\k\@<!\%(end\|kv\|arity\|assuming\|pick\|slice\|clone\|key\|new\)\k\@!" |
| | 86 | syn match p6Routine display "\k\@<!\%(any\|all\|none\|one\|wrap\|shape\|value\)\k\@!" |
| | 87 | syn match p6Routine display "\k\@<!\%(callsame\|callwith\|nextsame\|nextwith\|ACCEPTS\)\k\@!" |
| | 88 | syn match p6Routine display "\k\@<!\%(pop\|push\|shift\|splice\|unshift\|floor\|ceiling\)\k\@!" |
| | 89 | syn match p6Routine display "\k\@<!\%(abs\|exp\|log\|log10\|rand\|sign\|sqrt\|sin\|cos\|tan\)\k\@!" |
| | 90 | syn match p6Routine display "\k\@<!\%(round\|srand\|roots\|cis\|unpolar\|polar\|atan2\)\k\@!" |
| | 91 | syn match p6Routine display "\k\@<!\%(p5chop\|chop\|p5chomp\|chomp\|lc\|lcfirst\|uc\|ucfirst\)\k\@!" |
| | 92 | syn match p6Routine display "\k\@<!\%(capitalize\|normalize\|pack\|unpack\|quotemeta\|comb\)\k\@!" |
| | 93 | syn match p6Routine display "\k\@<!\%(samecase\|sameaccent\|chars\|nfd\|nfc\|nfkd\|nfkc\)\k\@!" |
| | 94 | syn match p6Routine display "\k\@<!\%(printf\|sprintf\|caller\|evalfile\|run\|runinstead\)\k\@!" |
| | 95 | syn match p6Routine display "\k\@<!\%(nothing\|want\|bless\|chr\|ord\|list\|item\|gmtime\)\k\@!" |
| | 96 | syn match p6Routine display "\k\@<!\%(localtime\|time\|gethost\|getpw\|chroot\|getlogin\)\k\@!" |
| | 97 | syn match p6Routine display "\k\@<!\%(kill\|fork\|wait\|perl\|context\|graphs\|codes\|bytes\)\k\@!" |
| | 98 | syn match p6Routine display "\k\@<!\%(print\|open\|read\|write\|readline\|say\|seek\|close\)\k\@!" |
| | 99 | syn match p6Routine display "\k\@<!\%(opendir\|readdir\|slurp\|pos\|fmt\|vec\|link\|unlink\)\k\@!" |
| | 100 | syn match p6Routine display "\k\@<!\%(symlink\|uniq\|pair\|asin\|atan\|sec\|cosec\)\k\@!" |
| | 101 | syn match p6Routine display "\k\@<!\%(cotan\|asec\|acosec\|acotan\|sinh\|cosh\|tanh\|asinh\)\k\@!" |
| | 102 | syn match p6Routine display "\k\@<!\%(achosh\|atanh\|sech\|cosech\|cotanh\|sech\|acosech\)\k\@!" |
| | 103 | syn match p6Routine display "\k\@<!\%(acotanh\|plan\|ok\|dies_ok\|lives_ok\|skip\|todo\)\k\@!" |
| | 104 | syn match p6Routine display "\k\@<!\%(pass\|flunk\|force_todo\|use_ok\|isa_ok\|cmp_ok\)\k\@!" |
| | 105 | syn match p6Routine display "\k\@<!\%(diag\|is_deeply\|isnt\|like\|skip_rest\|unlike\)\k\@!" |
| | 106 | syn match p6Routine display "\k\@<!\%(nonce\|eval_dies_ok\|eval_lives_ok\)\k\@!" |
| | 107 | syn match p6Routine display "\k\@<!\%(approx\|is_approx\|throws_ok\|version_lt\|signature\)\k\@!" |
| | 108 | syn match p6Routine display "\k\@<!\%(eval\|operator\|undef\|undefine\|sleep\|from\|to\)\k\@!" |
| | 109 | syn match p6Routine display "\k\@<!\%(infix\|postfix\|prefix\|circumfix\|postcircumfix\)\k\@!" |
| | 110 | syn match p6Routine display "\k\@<!\%(minmax\|lazy\|count\|nok_error\|unwrap\|can\|isa\)\k\@!" |
| | 111 | syn match p6Operator display "\k\@<!\%(x\|xx\|div\|mod\|also\|leg\|cmp\)\k\@!" |
| | 112 | syn match p6Operator display "\k\@<!\%(eq\|ne\|lt\|le\|gt\|ge\|eqv\|ff\|fff\|true\|not\)\k\@!" |
| | 113 | syn match p6Operator display "\k\@<!\%(X\|XeqvX\|and\|andthen\|or\|xor\|orelse\|extra\)\k\@!" |
| 122 | | |
| 123 | | " conditionals need whitespace to the right |
| 124 | | syn match p6Conditional "\%(if\|else\|elsif\|unless\)\s\@=" |
| 125 | | |
| 126 | | " misc |
| 127 | | syn match p6Normal display "\w*::\w\+" |
| 128 | | syn match p6Comment display "#.*" contains=p6Attention |
| 129 | | syn match p6Shebang display "\%^#!.*" |
| 130 | | syn match p6BlockLabel display "\%(^\s*\)\@<=\h\w*\s*:\s\@=" |
| 131 | | syn match p6Variable display "[$@%&][!.*^?]" |
| 132 | | syn match p6Variable display "[$@%&][!.*^?]\?[[:alnum:]¢]\%([[:alnum:]_¢]\|::\)*" |
| | 124 | " hyperoperators |
| | 125 | syn match p6Operator display "\%(>>\|»\)[^[:alnum:][:blank:]]" |
| | 126 | syn match p6Operator display "[^[:alnum:][:blank:]]\%(«\|<<\)" |
| | 127 | syn match p6Operator display "»[^[:alnum:][:blank:]]«" |
| | 128 | syn match p6Operator display ">>[^[:alnum:][:blank:]]<<" |
| | 129 | |
| | 130 | syn match p6Normal display "::=\@!" |
| | 131 | syn match p6Comment display "#.*" contains=p6Attention |
| | 132 | syn match p6Shebang display "\%^#!.*" |
| | 133 | syn match p6BlockLabel display "\%(^\|\s\)\@<=\h\w*\s*::\@!\%(\s\|$\)\@=" |
| | 134 | syn match p6Context display "\<hash\>" |
| | 135 | syn match p6Conditional display "\%(if\|else\|elsif\|unless\)\%($\|\s\)\@=" |
| | 136 | syn match p6Number display "\<\d\%(\d\|__\@!\)*\%(_\@<![eE]_\@!+\?\%(\d\|_\)\+\)\?_\@<!" |
| | 137 | syn match p6Float display "\<\d\%(\d\|_\)*_\@<![eE]_\@!-\%(\d\|_\)\+" |
| | 138 | syn match p6Float display "\<\d\%(\d\|_\)*_\@<!\._\@!\%(\.\|\a\)\@!\%(\%(\d\|_\)*\%(_\@<![eE]_\@!\%(\d\|_\)\+\)\?\)\?" |
| | 139 | syn match p6Number display "\<0o[0-7][0-7_]*" |
| | 140 | syn match p6Number display "\<0b[01][01_]*" |
| | 141 | syn match p6Number display "\<0x\x[[:xdigit:]_]*" |
| | 142 | syn match p6Number display "\<0d\d[[:digit:]_]*" |
| | 143 | |
| | 144 | " sigils, twigils, variables and package scope; a little tricky |
| | 145 | |
| | 146 | syn match p6Twigil display contained "\%([.^*+?=!]\|:\@<!::\@!\)" |
| | 147 | syn match p6Variable display contained "[[:alnum:]_¢]\+" |
| | 148 | syn match p6PackageScope display contained "[-[:alnum:]_:]\+::" |
| | 149 | |
| | 150 | syn region p6VariableRegion |
| | 151 | \ matchgroup=p6Sigil |
| | 152 | \ start="[$@%&]\+" |
| | 153 | \ start="[^-_:¢[:alnum:]]\@<=\%(::\)\@=" |
| | 154 | \ start="[$@%&]\+\%([.^*+?=!]\|:\@<!::\@!\)\%([^-_:¢[:alnum:]]\)\@=" |
| | 155 | \ end="\%([-_:¢[:alnum:].^*+?=!]\)\@!" |
| | 156 | \ oneline |
| | 157 | \ display |
| | 158 | \ contains=p6Twigil,p6PackageScope,p6Variable |
| | 159 | |
| | 160 | " the "!" in "$!" is the variable name, not a twigil |
| | 161 | syn match p6Variable display "\%([$@%&]\+\)\@<=\%([.^*+?=!]\|:\@<!::\@!\)\%([-_:¢[:alnum:].^*+?=!]\)\@!" |