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

Unified Diff: polymer_1.0.4/bower_components/prism/components/prism-ruby.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-ruby.js
diff --git a/polymer_1.0.4/bower_components/prism/components/prism-ruby.js b/polymer_1.0.4/bower_components/prism/components/prism-ruby.js
new file mode 100644
index 0000000000000000000000000000000000000000..554d6873e4047c81a7c0658ae70197586737745b
--- /dev/null
+++ b/polymer_1.0.4/bower_components/prism/components/prism-ruby.js
@@ -0,0 +1,21 @@
+/**
+ * Original by Samuel Flores
+ *
+ * Adds the following new token classes:
+ * constant, builtin, variable, symbol, regex
+ */
+Prism.languages.ruby = Prism.languages.extend('clike', {
+ 'comment': /#[^\r\n]*(\r?\n|$)/,
+ 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/,
+ 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
+ 'constant': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/
+});
+
+Prism.languages.insertBefore('ruby', 'keyword', {
+ 'regex': {
+ pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,
+ lookbehind: true
+ },
+ 'variable': /[@$]+\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/,
+ 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/
+});

Powered by Google App Engine
This is Rietveld 408576698