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

Unified Diff: polymer_1.0.4/bower_components/prism/components/prism-twig.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-twig.js
diff --git a/polymer_1.0.4/bower_components/prism/components/prism-twig.js b/polymer_1.0.4/bower_components/prism/components/prism-twig.js
new file mode 100644
index 0000000000000000000000000000000000000000..b2fc48fb58f652a512f4e03adffb1597331e2aee
--- /dev/null
+++ b/polymer_1.0.4/bower_components/prism/components/prism-twig.js
@@ -0,0 +1,46 @@
+Prism.languages.twig = {
+ 'comment': /\{#[\s\S]*?#\}/,
+ 'tag': {
+ pattern: /(\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\})/,
+ inside: {
+ 'ld': {
+ pattern: /^(\{\{\-?|\{%\-?\s*\w+)/,
+ inside: {
+ 'punctuation': /^(\{\{|\{%)\-?/,
+ 'keyword': /\w+/
+ }
+ },
+ 'rd': {
+ pattern: /\-?(%\}|\}\})$/,
+ inside: {
+ 'punctuation': /.*/
+ }
+ },
+ 'string': {
+ pattern: /("|')(\\?.)*?\1/,
+ inside: {
+ 'punctuation': /^('|")|('|")$/
+ }
+ },
+ 'keyword': /\b(if)\b/,
+ 'boolean': /\b(true|false|null)\b/,
+ 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
+ 'operator': /==|=|!=|<|>|>=|<=|\+|\-|~|\*|\/|\/\/|%|\*\*|\|/,
+ 'space-operator': {
+ pattern: /(\s)(\b(not|b\-and|b\-xor|b\-or|and|or|in|matches|starts with|ends with|is)\b|\?|:|\?:)(?=\s)/,
+ lookbehind: true,
+ inside: {
+ 'operator': /.*/
+ }
+ },
+ 'property': /\b[a-zA-Z_][a-zA-Z0-9_]*\b/,
+ 'punctuation': /\(|\)|\[\]|\[|\]|\{|\}|:|\.|,/
+ }
+ },
+
+ // The rest can be parsed as HTML
+ 'other': {
+ pattern: /[\s\S]*/,
+ inside: Prism.languages.markup
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698