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

Unified Diff: polymer_1.0.4/bower_components/prism/components/prism-javascript.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-javascript.js
diff --git a/polymer_1.0.4/bower_components/prism/components/prism-javascript.js b/polymer_1.0.4/bower_components/prism/components/prism-javascript.js
new file mode 100644
index 0000000000000000000000000000000000000000..754ff0e489119faa138f3be19ec6d9d4a95a0439
--- /dev/null
+++ b/polymer_1.0.4/bower_components/prism/components/prism-javascript.js
@@ -0,0 +1,28 @@
+Prism.languages.javascript = Prism.languages.extend('clike', {
+ 'keyword': /\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,
+ 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|-?Infinity)\b/,
+ 'function': /(?!\d)[a-z0-9_$]+(?=\()/i
+});
+
+Prism.languages.insertBefore('javascript', 'keyword', {
+ 'regex': {
+ pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,
+ lookbehind: true
+ }
+});
+
+if (Prism.languages.markup) {
+ Prism.languages.insertBefore('markup', 'tag', {
+ 'script': {
+ pattern: /<script[\w\W]*?>[\w\W]*?<\/script>/i,
+ inside: {
+ 'tag': {
+ pattern: /<script[\w\W]*?>|<\/script>/i,
+ inside: Prism.languages.markup.tag.inside
+ },
+ rest: Prism.languages.javascript
+ },
+ alias: 'language-javascript'
+ }
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698