History

Update Prism.js with Python syntax

Thibaut committed 12 years ago

Commit 58785511 parent e96b1731 file · +16 −0Browse files

Unified · Split

assets/javascripts/vendor/prism.js+16−0
@@ -492,6 +492,21 @@ Prism.languages.insertBefore('coffeescript', 'keyword', { · 491 unmodified lines
492 },492 },
493 'attr-name': /[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g493 'attr-name': /[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g
494});494});
495;
496Prism.languages.python= {
497 'comment': {
498 pattern: /(^|[^\\])#.*?(\r?\n|$)/g,
499 lookbehind: true
500 },
501 'string' : /("|')(\\?.)*?\1/g,
502 '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/g,
503 'boolean' : /\b(True|False)\b/g,
504 'number' : /\b-?(0x)?\d*\.?[\da-f]+\b/g,
505 'operator' : /[-+]{1,2}|=?<|=?>|!|={1,2}|(&){1,2}|(&){1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/g,
506 'ignore' : /&(lt|gt|amp);/gi,
507 'punctuation' : /[{}[\];(),.:]/g
508};
509
495;510;
496/**511/**
497 * Original by Samuel Flores512 * Original by Samuel Flores
@@ -514,4 +529,5 @@ Prism.languages.insertBefore('ruby', 'keyword', { · 16 unmodified lines
514 'variable': /[@$&]+\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g,529 'variable': /[@$&]+\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g,
515 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g530 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g
516});531});
532
517;533;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t