| 1 |
filetype: perl |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "\\.p[lmp]$" |
| 5 |
header: "^#!.*/(env +)?perl( |$)" |
| 6 |
|
| 7 |
rules: |
| 8 |
- type: "\\b(accept|alarm|atan2|bin(d|mode)|c(aller|homp|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\\b|\\b(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\\b|\\b(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|say|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\\b|\\b(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\\b|\\b(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\\b" |
| 9 |
- statement: "\\b(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\\b" |
| 10 |
|
| 11 |
- special: "\\-\\>" |
| 12 |
- symbol: "(,|\\.)" |
| 13 |
|
| 14 |
#regexes |
| 15 |
- identifier.macro: "m?\\/.*?\\/[a-z]*" |
| 16 |
- identifier.macro: "m?\\|.*?\\|[a-z]*" |
| 17 |
- identifier.macro: "\\bs/.*?/.*?/[a-z]*" |
| 18 |
- identifier.macro: "\\bs\\|.*?\\|.*?\\|[a-z]*" |
| 19 |
|
| 20 |
- constant.string: |
| 21 |
start: '"' |
| 22 |
end: '"' |
| 23 |
skip: '\\"' |
| 24 |
rules: |
| 25 |
- identifier.var: '[\\$@%].[a-zA-Z0-9_]*' |
| 26 |
|
| 27 |
- constant.string: |
| 28 |
start: "'" |
| 29 |
end: "'" |
| 30 |
skip: "\\\\'" |
| 31 |
rules: [] |
| 32 |
|
| 33 |
- comment: |
| 34 |
start: "#" |
| 35 |
end: "$" |
| 36 |
rules: [] |
| 37 |
|
| 38 |
- constant.string: "\"\\(.*\\)\"|qq?\\|.*\\||qq?\\{.*\\}|qq?\\/.*\\/" |
| 39 |
- constant.number: "\\b([0-9]*[.])?[0-9]+" |
| 40 |
- constant.number: "\\b[0-9]+" |
| 41 |
- constant.number: "\\b0x[a-f0-9]+" |
| 42 |
- constant.string.url: "`(.+?)`" |
| 43 |
- identifier.var: '[\\$@%].[a-zA-Z0-9_]*' |
| 44 |
|
| 45 |
- preproc: |
| 46 |
start: "(^use| = new)" |
| 47 |
end: ";" |
| 48 |
rules: [] |
| 49 |
|
| 50 |
- comment: |
| 51 |
start: "^=" |
| 52 |
end: "^=cut" |
| 53 |
rules: [] |
| 54 |
|
| 55 |
- identifier.macro: |
| 56 |
start: "<< 'STOP'" |
| 57 |
end: "STOP" |
| 58 |
rules: [] |