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

Side by Side Diff: lib/src/prism/components/prism-python.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.python= { 1 Prism.languages.python= {
2 'comment': { 2 'comment': {
3 » » pattern: /(^|[^\\])#.*?(\r?\n|$)/, 3 » » pattern: /(^|[^\\])#.*/,
4 lookbehind: true 4 lookbehind: true
5 }, 5 },
6 » 'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/, 6 » 'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,
7 'function' : { 7 'function' : {
8 » » pattern: /((^|\s)def[ \t]+)([a-zA-Z_][a-zA-Z0-9_]*(?=\())/g, 8 » » pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,
9 lookbehind: true 9 lookbehind: true
10 }, 10 },
11 » 'keyword' : /\b(as|assert|break|class|continue|def|del|elif|else|except| exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try| while|with|yield)\b/, 11 » 'class-name': {
12 » 'boolean' : /\b(True|False)\b/, 12 » » pattern: /(\bclass\s+)[a-z0-9_]+/i,
13 » 'number' : /\b-?(0[bo])?(?:(\d|0x[a-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+ )?j?\b/i, 13 » » lookbehind: true
14 » 'operator' : /[-+]|<=?|>=?|!|={1,2}|&{1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|a nd|not)\b/, 14 » },
15 » 'keyword' : /\b(?:as|assert|async|await|break|class|continue|def|del|eli f|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|rai se|return|try|while|with|yield)\b/,
16 » 'boolean' : /\b(?:True|False)\b/,
17 » 'number' : /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+ -]?\d+)?j?\b/i,
18 » 'operator' : /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or| and|not)\b/,
15 'punctuation' : /[{}[\];(),.:]/ 19 'punctuation' : /[{}[\];(),.:]/
16 }; 20 };
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-pure.min.js ('k') | lib/src/prism/components/prism-python.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698