Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: polymer_1.0.4/bower_components/prism/components/prism-perl.js

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_1.0.4/bower_components/prism/components/prism-perl.js
diff --git a/polymer_1.0.4/bower_components/prism/components/prism-perl.js b/polymer_1.0.4/bower_components/prism/components/prism-perl.js
new file mode 100644
index 0000000000000000000000000000000000000000..d435e800e2dd773bfa032927c58d83a51fdf0c95
--- /dev/null
+++ b/polymer_1.0.4/bower_components/prism/components/prism-perl.js
@@ -0,0 +1,112 @@
+Prism.languages.perl = {
+ 'comment': [
+ {
+ // POD
+ pattern: /((?:^|\n)\s*)=\w+[\s\S]*?=cut.*/,
+ lookbehind: true
+ },
+ {
+ pattern: /(^|[^\\$])#.*?(\r?\n|$)/,
+ lookbehind: true
+ }
+ ],
+ // TODO Could be nice to handle Heredoc too.
+ 'string': [
+ // q/.../
+ /\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1/,
+
+ // q a...a
+ /\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(\\?.)*?\s*\1/,
+
+ // q(...)
+ /\b(?:q|qq|qx|qw)\s*\(([^()]|\\.)*\s*\)/,
+
+ // q{...}
+ /\b(?:q|qq|qx|qw)\s*\{([^{}]|\\.)*\s*\}/,
+
+ // q[...]
+ /\b(?:q|qq|qx|qw)\s*\[([^[\]]|\\.)*\s*\]/,
+
+ // q<...>
+ /\b(?:q|qq|qx|qw)\s*<([^<>]|\\.)*\s*>/,
+
+ // "...", '...', `...`
+ /("|'|`)(\\?.)*?\1/
+ ],
+ 'regex': [
+ // m/.../
+ /\b(?:m|qr)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1[msixpodualgc]*/,
+
+ // m a...a
+ /\b(?:m|qr)\s+([a-zA-Z0-9])(\\?.)*?\s*\1[msixpodualgc]*/,
+
+ // m(...)
+ /\b(?:m|qr)\s*\(([^()]|\\.)*\s*\)[msixpodualgc]*/,
+
+ // m{...}
+ /\b(?:m|qr)\s*\{([^{}]|\\.)*\s*\}[msixpodualgc]*/,
+
+ // m[...]
+ /\b(?:m|qr)\s*\[([^[\]]|\\.)*\s*\][msixpodualgc]*/,
+
+ // m<...>
+ /\b(?:m|qr)\s*<([^<>]|\\.)*\s*>[msixpodualgc]*/,
+
+ // s/.../.../
+ /\b(?:s|tr|y)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1\s*((?!\1).|\\.)*\s*\1[msixpodualgcer]*/,
+
+ // s a...a...a
+ /\b(?:s|tr|y)\s+([a-zA-Z0-9])(\\?.)*?\s*\1\s*((?!\1).|\\.)*\s*\1[msixpodualgcer]*/,
+
+ // s(...)(...)
+ /\b(?:s|tr|y)\s*\(([^()]|\\.)*\s*\)\s*\(\s*([^()]|\\.)*\s*\)[msixpodualgcer]*/,
+
+ // s{...}{...}
+ /\b(?:s|tr|y)\s*\{([^{}]|\\.)*\s*\}\s*\{\s*([^{}]|\\.)*\s*\}[msixpodualgcer]*/,
+
+ // s[...][...]
+ /\b(?:s|tr|y)\s*\[([^[\]]|\\.)*\s*\]\s*\[\s*([^[\]]|\\.)*\s*\][msixpodualgcer]*/,
+
+ // s<...><...>
+ /\b(?:s|tr|y)\s*<([^<>]|\\.)*\s*>\s*<\s*([^<>]|\\.)*\s*>[msixpodualgcer]*/,
+
+ // /.../
+ /\/(\[.+?]|\\.|[^\/\r\n])*\/[msixpodualgc]*(?=\s*($|[\r\n,.;})&|\-+*=~<>!?^]|(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/
+ ],
+
+ // FIXME Not sure about the handling of ::, ', and #
+ 'variable': [
+ // ${^POSTMATCH}
+ /[&*\$@%]\{\^[A-Z]+\}/,
+ // $^V
+ /[&*\$@%]\^[A-Z_]/,
+ // ${...}
+ /[&*\$@%]#?(?=\{)/,
+ // $foo
+ /[&*\$@%]#?((::)*'?(?!\d)[\w$]+)+(::)*/i,
+ // $1
+ /[&*\$@%]\d+/,
+ // $_, @_, %!
+ /[\$@%][!"#\$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/
+ ],
+ 'filehandle': {
+ // <>, <FOO>, _
+ pattern: /<(?!=).*>|\b_\b/,
+ alias: 'symbol'
+ },
+ 'vstring': {
+ // v1.2, 1.2.3
+ pattern: /v\d+(\.\d+)*|\d+(\.\d+){2,}/,
+ alias: 'string'
+ },
+ 'function': {
+ pattern: /sub [a-z0-9_]+/i,
+ inside: {
+ keyword: /sub/
+ }
+ },
+ 'keyword': /\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|say|state|sub|switch|undef|unless|until|use|when|while)\b/,
+ 'number': /(\n|\b)-?(0x[\dA-Fa-f](_?[\dA-Fa-f])*|0b[01](_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee]-?\d+)?)\b/,
+ 'operator': /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|[-+*=~\/|&]{1,2}|<=?|>=?|\.{1,3}|[!?\\^]|\b(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b/,
+ 'punctuation': /[{}[\];(),:]/
+};

Powered by Google App Engine
This is Rietveld 408576698