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

Side by Side Diff: lib/src/prism/components/prism-twig.js

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 Prism.languages.twig = { 1 Prism.languages.twig = {
2 'comment': /\{#[\s\S]*?#\}/, 2 'comment': /\{#[\s\S]*?#\}/,
3 'tag': { 3 'tag': {
4 » » pattern: /(\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\})/, 4 » » pattern: /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/,
5 inside: { 5 inside: {
6 'ld': { 6 'ld': {
7 » » » » pattern: /^(\{\{\-?|\{%\-?\s*\w+)/, 7 » » » » pattern: /^(?:\{\{\-?|\{%\-?\s*\w+)/,
8 inside: { 8 inside: {
9 » » » » » 'punctuation': /^(\{\{|\{%)\-?/, 9 » » » » » 'punctuation': /^(?:\{\{|\{%)\-?/,
10 'keyword': /\w+/ 10 'keyword': /\w+/
11 } 11 }
12 }, 12 },
13 'rd': { 13 'rd': {
14 » » » » pattern: /\-?(%\}|\}\})$/, 14 » » » » pattern: /\-?(?:%\}|\}\})$/,
15 inside: { 15 inside: {
16 'punctuation': /.*/ 16 'punctuation': /.*/
17 } 17 }
18 }, 18 },
19 'string': { 19 'string': {
20 » » » » pattern: /("|')(\\?.)*?\1/, 20 » » » » pattern: /("|')(?:\\?.)*?\1/,
21 inside: { 21 inside: {
22 » » » » » 'punctuation': /^('|")|('|")$/ 22 » » » » » 'punctuation': /^['"]|['"]$/
23 } 23 }
24 }, 24 },
25 » » » 'keyword': /\b(if)\b/, 25 » » » 'keyword': /\b(?:even|if|odd)\b/,
26 » » » 'boolean': /\b(true|false|null)\b/, 26 » » » 'boolean': /\b(?:true|false|null)\b/,
27 » » » 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/, 27 » » » 'number': /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+([Ee][-+]?\d+)? )\b/,
28 » » » 'operator': /==|=|!=|<|>|>=|<=|\+|\-|~|\*|\/|\/\/|%|\*\* |\|/, 28 » » » 'operator': [
29 » » » 'space-operator': { 29 » » » » {
30 » » » » pattern: /(\s)(\b(not|b\-and|b\-xor|b\-or|and|or |in|matches|starts with|ends with|is)\b|\?|:|\?:)(?=\s)/, 30 » » » » » pattern: /(\s)(?:and|b\-and|b\-xor|b\-or |ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,
31 » » » » lookbehind: true, 31 » » » » » lookbehind: true
32 » » » » inside: { 32 » » » » },
33 » » » » » 'operator': /.*/ 33 » » » » /[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/
34 » » » » } 34 » » » ],
35 » » » },
36 'property': /\b[a-zA-Z_][a-zA-Z0-9_]*\b/, 35 'property': /\b[a-zA-Z_][a-zA-Z0-9_]*\b/,
37 » » » 'punctuation': /\(|\)|\[\]|\[|\]|\{|\}|:|\.|,/ 36 » » » 'punctuation': /[()\[\]{}:.,]/
38 } 37 }
39 }, 38 },
40 39
41 // The rest can be parsed as HTML 40 // The rest can be parsed as HTML
42 'other': { 41 'other': {
43 » » pattern: /[\s\S]*/, 42 » » // We want non-blank matches
43 » » pattern: /\S(?:[\s\S]*\S)?/,
44 inside: Prism.languages.markup 44 inside: Prism.languages.markup
45 } 45 }
46 }; 46 };
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-textile.min.js ('k') | lib/src/prism/components/prism-twig.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698