Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created March 1, 2015 20:52
Show Gist options
  • Save ashgti/fb444fd8af4daa68409f to your computer and use it in GitHub Desktop.
Save ashgti/fb444fd8af4daa68409f to your computer and use it in GitHub Desktop.
{ patterns = (
{ name = 'comment.block.perl6';
begin = '^=begin';
end = '^=end';
},
{ name = 'comment.line.number-sign.perl6';
match = '#.*$';
},
{ name = 'string.quoted.single.perl6';
begin = "'";
end = "'";
beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.perl6'; }; };
endCaptures = { 0 = { name = 'punctuation.definition.string.end.perl6'; }; };
patterns = (
{ name = 'constant.character.escape';
match = '\\[''\\]';
},
);
},
{ name = 'string.quoted.double.perl6';
begin = '"';
end = '"';
beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.perl6'; }; };
endCaptures = { 0 = { name = 'punctuation.definition.string.end.perl6'; }; };
patterns = (
{ name = 'constant.character.escape.perl6';
match = '\\[abtnfre"\\]';
},
);
},
{ name = 'string.quoted.single.heredoc.perl6';
begin = 'q(q|to|heredoc)*\s*:?(q|to|heredoc)*\s*/(.+)/';
end = '\3';
},
{ name = 'string.quoted.double.heredoc.brace.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*{{';
end = '}}';
patterns = (
{ include = '#qq_brace_string_content'; },
);
},
{ name = 'string.quoted.double.heredoc.angle.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*<<';
end = '>>';
patterns = (
{ include = '#qq_angle_string_content'; },
);
},
{ name = 'string.quoted.double.heredoc.paren.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*\(\(';
end = '\)\)';
patterns = (
{ include = '#qq_paren_string_content'; },
);
},
{ name = 'string.quoted.double.heredoc.bracket.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*\[\[';
end = '\]\]';
patterns = (
{ include = '#qq_bracket_string_content'; },
);
},
{ name = 'string.quoted.single.heredoc.brace.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*{';
end = '}';
patterns = (
{ include = '#qq_brace_string_content'; },
);
},
{ name = 'string.quoted.single.heredoc.angle.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*<';
end = '>';
patterns = (
{ include = '#qq_angle_string_content'; },
);
},
{ name = 'string.quoted.single.heredoc.slash.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*/';
end = '/';
patterns = (
{ include = '#qq_slash_string_content'; },
);
},
{ name = 'string.quoted.single.heredoc.paren.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*\(';
end = '\)';
patterns = (
{ include = '#qq_paren_string_content'; },
);
},
{ name = 'string.quoted.single.heredoc.bracket.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*\[';
end = '\]';
patterns = (
{ include = '#qq_bracket_string_content'; },
);
},
{ name = 'string.quoted.single.heredoc.single.perl6';
begin = "(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*'";
end = "'";
patterns = (
{ include = '#qq_single_string_content'; },
);
},
{ name = 'string.quoted.single.heredoc.double.perl6';
begin = '(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*"';
end = '"';
patterns = (
{ include = '#qq_double_string_content'; },
);
},
{ name = 'variable.other.perl6';
match = '\b\$\w+\b';
},
{ name = 'storage.type.declare.routine.perl6';
match = '\b(macro|sub|submethod|method|multi|proto|only|rule|token|regex|category)\b';
},
{ name = 'keyword.other.module.perl6';
match = '\b(module|class|role|package|enum|grammar|slang|subset)\b';
},
{ name = 'variable.language.perl6';
match = '\b(self)\b';
},
{ name = 'keyword.other.include.perl6';
match = '\b(use|require)\b';
},
{ name = 'keyword.control.conditional.perl6';
match = '\b(if|else|elsif|unless)\b';
},
{ name = 'storage.type.variable.perl6';
match = '\b(let|my|our|state|temp|has|constant)\b';
},
{ name = 'keyword.control.repeat.perl6';
match = '\b(for|loop|repeat|while|until|gather|given)\b';
},
{ name = 'keyword.control.flowcontrol.perl6';
match = '\b(take|do|when|next|last|redo|return|contend|maybe|defer|default|exit|make|continue|break|goto|leave|async|lift)\b';
},
{ name = 'storage.modifier.type.constraints.perl6';
match = '\b(is|as|but|trusts|of|returns|handles|where|augment|supersede)\b';
},
{ name = 'meta.function.perl6';
match = '\b(BEGIN|CHECK|INIT|START|FIRST|ENTER|LEAVE|KEEP|UNDO|NEXT|LAST|PRE|POST|END|CATCH|CONTROL|TEMP)\b';
},
{ name = 'keyword.control.control-handlers.perl6';
match = '\b(die|fail|try|warn)\b';
},
{ name = 'storage.modifier.perl6';
match = '\b(prec|irs|ofs|ors|export|deep|binary|unary|reparsed|rw|parsed|cached|readonly|defequiv|will|ref|copy|inline|tighter|looser|equiv|assoc|required)\b';
},
{ name = 'constant.numeric.perl6';
match = '\b(NaN|Inf)\b';
},
{ name = 'keyword.other.pragma.perl6';
match = '\b(oo|fatal)\b';
},
{ name = 'support.type.perl6';
match = '\b(Object|Any|Junction|Whatever|Capture|MatchSignature|Proxy|Matcher|Package|Module|ClassGrammar|Scalar|Array|Hash|KeyHash|KeySet|KeyBagPair|List|Seq|Range|Set|Bag|Mapping|Void|UndefFailure|Exception|Code|Block|Routine|Sub|MacroMethod|Submethod|Regex|Str|str|Blob|Char|ByteCodepoint|Grapheme|StrPos|StrLen|Version|NumComplex|num|complex|Bit|bit|bool|True|FalseIncreasing|Decreasing|Ordered|Callable|AnyCharPositional|Associative|Ordering|KeyExtractorComparator|OrderingPair|IO|KitchenSink|RoleInt|int|int1|int2|int4|int8|int16|int32|int64Rat|rat|rat1|rat2|rat4|rat8|rat16|rat32|rat64Buf|buf|buf1|buf2|buf4|buf8|buf16|buf32|buf64UInt|uint|uint1|uint2|uint4|uint8|uint16|uint32uint64|Abstraction|utf8|utf16|utf32)\b';
},
{ name = 'keyword.operator.perl6';
match = '\b(div|x|xx|mod|also|leg|cmp|before|after|eq|ne|le|lt|gt|ge|eqv|ff|fff|and|andthen|Z|X|or|xor|orelse|extra|m|mm|rx|s|tr)\b';
},
{ name = 'variable.other.basic.perl6';
match = '(\$|@|%|&)(\*|:|!|\^|~|=|\?|(<(?=.+>)))?([A-Za-z_])([A-Za-z0-9_]|[\-''][A-Za-z0-9_])*';
},
{ name = 'support.function';
match = '\b(eager|hyper|substr|index|rindex|grep|map|sort|join|lines|hints|chmod|split|reduce|min|max|reverse|truncate|zip|cat|roundrobin|classify|first|sum|keys|values|pairs|defined|delete|exists|elems|end|kv|any|all|one|wrap|shape|key|value|name|pop|push|shift|splice|unshift|floor|ceiling|abs|exp|log|log10|rand|sign|sqrt|sin|cos|tan|round|strand|roots|cis|unpolar|polar|atan2|pick|chop|p5chop|chomp|p5chomp|lc|lcfirst|uc|ucfirst|capitalize|normalize|pack|unpack|quotemeta|comb|samecase|sameaccent|chars|nfd|nfc|nfkd|nfkc|printf|sprintf|caller|evalfile|run|runinstead|nothing|want|bless|chr|ord|gmtime|time|eof|localtime|gethost|getpw|chroot|getlogin|getpeername|kill|fork|wait|perl|graphs|codes|bytes|clone|print|open|read|write|readline|say|seek|close|opendir|readdir|slurp|spurt|shell|run|pos|fmt|vec|link|unlink|symlink|uniq|pair|asin|atan|sec|cosec|cotan|asec|acosec|acotan|sinh|cosh|tanh|asinh|done|acos|acosh|atanh|sech|cosech|cotanh|sech|acosech|acotanh|asech|ok|nok|plan_ok|dies_ok|lives_ok|skip|todo|pass|flunk|force_todo|use_ok|isa_ok|diag|is_deeply|isnt|like|skip_rest|unlike|cmp_ok|eval_dies_ok|nok_error|eval_lives_ok|approx|is_approx|throws_ok|version_lt|plan|EVAL|succ|pred|times|nonce|once|signature|new|connect|operator|undef|undefine|sleep|from|to|infix|postfix|prefix|circumfix|postcircumfix|minmax|lazy|count|unwrap|getc|pi|e|context|void|quasi|body|each|contains|rewinddir|subst|can|isa|flush|arity|assuming|rewind|callwith|callsame|nextwith|nextsame|attr|eval_elsewhere|none|srand|trim|trim_start|trim_end|lastcall|WHAT|WHERE|HOW|WHICH|VAR|WHO|WHENCE|ACCEPTS|REJECTS|not|true|iterator|by|re|im|invert|flip|gist|flat|tree|is-prime|throws_like|trans)\b';
},
);
repository = {
qq_brace_string_content = {
begin = '{';
end = '}';
patterns = (
{ include = '#qq_brace_string_content'; },
);
};
qq_slash_string_content = {
begin = '\\/';
end = '\\/';
patterns = (
{ include = '#qq_slash_string_content'; },
);
};
qq_paren_string_content = {
begin = '\(';
end = '\)';
patterns = (
{ include = '#qq_paren_string_content'; },
);
};
qq_bracket_string_content = {
begin = '\[';
end = '\]';
patterns = (
{ include = '#qq_bracket_string_content'; },
);
};
qq_angle_string_content = {
begin = "<";
end = ">";
patterns = (
{ include = '#qq_angle_string_content'; },
);
};
qq_single_string_content = {
begin = "'";
end = "'";
patterns = (
{ include = '#qq_single_string_content'; },
);
};
qq_double_string_content = {
begin = '"';
end = '"';
patterns = (
{ include = '#qq_double_string_content'; },
);
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment