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

Side by Side Diff: lib/src/prism/components/prism-batch.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
(Empty)
1 (function (Prism) {
2 var variable = /%%?[~:\w]+%?|!\S+!/;
3 var parameter = {
4 pattern: /\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,
5 alias: 'attr-name',
6 inside: {
7 'punctuation': /:/
8 }
9 };
10 var string = /"[^"]*"/;
11 var number = /(?:\b|-)\d+\b/;
12
13 Prism.languages.batch = {
14 'comment': [
15 /^::.*/m,
16 {
17 pattern: /((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\ ^(?:\r\n|[\s\S]))*/im,
18 lookbehind: true
19 }
20 ],
21 'label': {
22 pattern: /^:.*/m,
23 alias: 'property'
24 },
25 'command': [
26 {
27 // FOR command
28 pattern: /((?:^|[&(])[ \t]*)for(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* \S+ in \([^)]+\) do/im,
29 lookbehind: true,
30 inside: {
31 'keyword': /^for\b|\b(?:in|do)\b/i,
32 'string': string,
33 'parameter': parameter,
34 'variable': variable,
35 'number': number,
36 'punctuation': /[()',]/
37 }
38 },
39 {
40 // IF command
41 pattern: /((?:^|[&(])[ \t]*)if(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|e xist \S+|(?:"[^"]*"|\S+)?(?:==| (?:equ|neq|lss|leq|gtr|geq) )(?:"[^"]*"|\S+))/im ,
42 lookbehind: true,
43 inside: {
44 'keyword': /^if\b|\b(?:not|cmdextversion |defined|errorlevel|exist)\b/i,
45 'string': string,
46 'parameter': parameter,
47 'variable': variable,
48 'number': number,
49 'operator': /\^|==|\b(?:equ|neq|lss|leq| gtr|geq)\b/i
50 }
51 },
52 {
53 // ELSE command
54 pattern: /((?:^|[&()])[ \t]*)else\b/im,
55 lookbehind: true,
56 inside: {
57 'keyword': /^else\b/i
58 }
59 },
60 {
61 // SET command
62 pattern: /((?:^|[&(])[ \t]*)set(?: ?\/[a-z](?:[ :](?:"[^"]*"|\S+))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,
63 lookbehind: true,
64 inside: {
65 'keyword': /^set\b/i,
66 'string': string,
67 'parameter': parameter,
68 'variable': [
69 variable,
70 /\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=) /
71 ],
72 'number': number,
73 'operator': /[*\/%+\-&^|]=?|<<=?|>>=?|[! ~_=]/,
74 'punctuation': /[()',]/
75 }
76 },
77 {
78 // Other commands
79 pattern: /((?:^|[&(])[ \t]*@?)\w+\b(?:[^^&)\r\n] |\^(?:\r\n|[\s\S]))*/im,
80 lookbehind: true,
81 inside: {
82 'keyword': /^\w+\b/i,
83 'string': string,
84 'parameter': parameter,
85 'label': {
86 pattern: /(^\s*):\S+/m,
87 lookbehind: true,
88 alias: 'property'
89 },
90 'variable': variable,
91 'number': number,
92 'operator': /\^/
93 }
94 }
95 ],
96 'operator': /[&@]/,
97 'punctuation': /[()']/
98 };
99 }(Prism));
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-basic.min.js ('k') | lib/src/prism/components/prism-batch.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698