/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+actionscript+apacheconf+applescript+aspnet+autohotkey+bash+brainfuck+c+csharp+cpp+coffeescript+css-extras+dart+eiffel+erlang+fsharp+fortran+gherkin+git+go+groovy+haml+handlebars+haskell+http+ini+jade+java+julia+keyman+latex+less+lolcode+makefile+markdown+matlab+nasm+nsis+objectivec+pascal+perl+php+php-extras+powershell+python+r+jsx+rest+rip+ruby+rust+sas+sass+scss+scala+scheme+smalltalk+smarty+sql+stylus+swift+twig+typescript+vhdl+wiki+yaml&plugins=line-highlight+line-numbers+show-language+highlight-keywords */
var _self = ( typeof window !== 'undefined' )
? window // if in browser
: (
( typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope )
? self // if in worker
: { } // if in node js
) ;
/ * *
* Prism : Lightweight , robust , elegant syntax highlighting
* MIT license http : //www.opensource.org/licenses/mit-license.php/
* @ author Lea Verou http : //lea.verou.me
* /
var Prism = ( function ( ) {
// Private helper vars
var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i ;
var _ = _self . Prism = {
util : {
encode : function ( tokens ) {
if ( tokens instanceof Token ) {
return new Token ( tokens . type , _ . util . encode ( tokens . content ) , tokens . alias ) ;
} else if ( _ . util . type ( tokens ) === 'Array' ) {
return tokens . map ( _ . util . encode ) ;
} else {
return tokens . replace ( /&/g , '&' ) . replace ( /</g , '<' ) . replace ( /\u00a0/g , ' ' ) ;
}
} ,
type : function ( o ) {
return Object . prototype . toString . call ( o ) . match ( /\[object (\w+)\]/ ) [ 1 ] ;
} ,
// Deep clone a language definition (e.g. to extend it)
clone : function ( o ) {
var type = _ . util . type ( o ) ;
switch ( type ) {
case 'Object' :
var clone = { } ;
for ( var key in o ) {
if ( o . hasOwnProperty ( key ) ) {
clone [ key ] = _ . util . clone ( o [ key ] ) ;
}
}
return clone ;
case 'Array' :
// Check for existence for IE8
return o . map && o . map ( function ( v ) { return _ . util . clone ( v ) ; } ) ;
}
return o ;
}
} ,
languages : {
extend : function ( id , redef ) {
var lang = _ . util . clone ( _ . languages [ id ] ) ;
for ( var key in redef ) {
lang [ key ] = redef [ key ] ;
}
return lang ;
} ,
/ * *
* Insert a token before another token in a language literal
* As this needs to recreate the object ( we cannot actually insert before keys in object literals ) ,
* we cannot just provide an object , we need anobject and a key .
* @ param inside The key ( or language id ) of the parent
* @ param before The key to insert before . If not provided , the function appends instead .
* @ param insert Object with the key / value pairs to insert
* @ param root The object that contains ` inside ` . If equal to Prism . languages , it can be omitted .
* /
insertBefore : function ( inside , before , insert , root ) {
root = root || _ . languages ;
var grammar = root [ inside ] ;
if ( arguments . length == 2 ) {
insert = arguments [ 1 ] ;
for ( var newToken in insert ) {
if ( insert . hasOwnProperty ( newToken ) ) {
grammar [ newToken ] = insert [ newToken ] ;
}
}
return grammar ;
}
var ret = { } ;
for ( var token in grammar ) {
if ( grammar . hasOwnProperty ( token ) ) {
if ( token == before ) {
for ( var newToken in insert ) {
if ( insert . hasOwnProperty ( newToken ) ) {
ret [ newToken ] = insert [ newToken ] ;
}
}
}
ret [ token ] = grammar [ token ] ;
}
}
// Update references in other language definitions
_ . languages . DFS ( _ . languages , function ( key , value ) {
if ( value === root [ inside ] && key != inside ) {
this [ key ] = ret ;
}
} ) ;
return root [ inside ] = ret ;
} ,
// Traverse a language definition with Depth First Search
DFS : function ( o , callback , type ) {
for ( var i in o ) {
if ( o . hasOwnProperty ( i ) ) {
callback . call ( o , i , o [ i ] , type || i ) ;
if ( _ . util . type ( o [ i ] ) === 'Object' ) {
_ . languages . DFS ( o [ i ] , callback ) ;
}
else if ( _ . util . type ( o [ i ] ) === 'Array' ) {
_ . languages . DFS ( o [ i ] , callback , i ) ;
}
}
}
}
} ,
highlightAll : function ( async , callback ) {
var elements = document . querySelectorAll ( 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' ) ;
for ( var i = 0 , element ; element = elements [ i ++ ] ; ) {
_ . highlightElement ( element , async === true , callback ) ;
}
} ,
highlightElement : function ( element , async , callback ) {
// Find language
var language , grammar , parent = element ;
while ( parent && ! lang . test ( parent . className ) ) {
parent = parent . parentNode ;
}
if ( parent ) {
language = ( parent . className . match ( lang ) || [ , '' ] ) [ 1 ] ;
grammar = _ . languages [ language ] ;
}
// Set language on the element, if not present
element . className = element . className . replace ( lang , '' ) . replace ( /\s+/g , ' ' ) + ' language-' + language ;
// Set language on the parent, for styling
parent = element . parentNode ;
if ( /pre/i . test ( parent . nodeName ) ) {
parent . className = parent . className . replace ( lang , '' ) . replace ( /\s+/g , ' ' ) + ' language-' + language ;
}
if ( ! grammar ) {
return ;
}
var code = element . textContent ;
if ( ! code ) {
return ;
}
code = code . replace ( /^(?:\r?\n|\r)/ , '' ) ;
var env = {
element : element ,
language : language ,
grammar : grammar ,
code : code
} ;
_ . hooks . run ( 'before-highlight' , env ) ;
if ( async && _self . Worker ) {
var worker = new Worker ( _ . filename ) ;
worker . onmessage = function ( evt ) {
env . highlightedCode = Token . stringify ( JSON . parse ( evt . data ) , language ) ;
_ . hooks . run ( 'before-insert' , env ) ;
env . element . innerHTML = env . highlightedCode ;
callback && callback . call ( env . element ) ;
_ . hooks . run ( 'after-highlight' , env ) ;
} ;
worker . postMessage ( JSON . stringify ( {
language : env . language ,
code : env . code
} ) ) ;
}
else {
env . highlightedCode = _ . highlight ( env . code , env . grammar , env . language ) ;
_ . hooks . run ( 'before-insert' , env ) ;
env . element . innerHTML = env . highlightedCode ;
callback && callback . call ( element ) ;
_ . hooks . run ( 'after-highlight' , env ) ;
}
} ,
highlight : function ( text , grammar , language ) {
var tokens = _ . tokenize ( text , grammar ) ;
return Token . stringify ( _ . util . encode ( tokens ) , language ) ;
} ,
tokenize : function ( text , grammar , language ) {
var Token = _ . Token ;
var strarr = [ text ] ;
var rest = grammar . rest ;
if ( rest ) {
for ( var token in rest ) {
grammar [ token ] = rest [ token ] ;
}
delete grammar . rest ;
}
tokenloop : for ( var token in grammar ) {
if ( ! grammar . hasOwnProperty ( token ) || ! grammar [ token ] ) {
continue ;
}
var patterns = grammar [ token ] ;
patterns = ( _ . util . type ( patterns ) === "Array" ) ? patterns : [ patterns ] ;
for ( var j = 0 ; j < patterns . length ; ++ j ) {
var pattern = patterns [ j ] ,
inside = pattern . inside ,
lookbehind = ! ! pattern . lookbehind ,
lookbehindLength = 0 ,
alias = pattern . alias ;
pattern = pattern . pattern || pattern ;
for ( var i = 0 ; i < strarr . length ; i ++ ) { // Don’t cache length as it changes during the loop
var str = strarr [ i ] ;
if ( strarr . length > text . length ) {
// Something went terribly wrong, ABORT, ABORT!
break tokenloop ;
}
if ( str instanceof Token ) {
continue ;
}
pattern . lastIndex = 0 ;
var match = pattern . exec ( str ) ;
if ( match ) {
if ( lookbehind ) {
lookbehindLength = match [ 1 ] . length ;
}
var from = match . index - 1 + lookbehindLength ,
match = match [ 0 ] . slice ( lookbehindLength ) ,
len = match . length ,
to = from + len ,
before = str . slice ( 0 , from + 1 ) ,
after = str . slice ( to + 1 ) ;
var args = [ i , 1 ] ;
if ( before ) {
args . push ( before ) ;
}
var wrapped = new Token ( token , inside ? _ . tokenize ( match , inside ) : match , alias ) ;
args . push ( wrapped ) ;
if ( after ) {
args . push ( after ) ;
}
Array . prototype . splice . apply ( strarr , args ) ;
}
}
}
}
return strarr ;
} ,
hooks : {
all : { } ,
add : function ( name , callback ) {
var hooks = _ . hooks . all ;
hooks [ name ] = hooks [ name ] || [ ] ;
hooks [ name ] . push ( callback ) ;
} ,
run : function ( name , env ) {
var callbacks = _ . hooks . all [ name ] ;
if ( ! callbacks || ! callbacks . length ) {
return ;
}
for ( var i = 0 , callback ; callback = callbacks [ i ++ ] ; ) {
callback ( env ) ;
}
}
}
} ;
var Token = _ . Token = function ( type , content , alias ) {
this . type = type ;
this . content = content ;
this . alias = alias ;
} ;
Token . stringify = function ( o , language , parent ) {
if ( typeof o == 'string' ) {
return o ;
}
if ( _ . util . type ( o ) === 'Array' ) {
return o . map ( function ( element ) {
return Token . stringify ( element , language , o ) ;
} ) . join ( '' ) ;
}
var env = {
type : o . type ,
content : Token . stringify ( o . content , language , parent ) ,
tag : 'span' ,
classes : [ 'token' , o . type ] ,
attributes : { } ,
language : language ,
parent : parent
} ;
if ( env . type == 'comment' ) {
env . attributes [ 'spellcheck' ] = 'true' ;
}
if ( o . alias ) {
var aliases = _ . util . type ( o . alias ) === 'Array' ? o . alias : [ o . alias ] ;
Array . prototype . push . apply ( env . classes , aliases ) ;
}
_ . hooks . run ( 'wrap' , env ) ;
var attributes = '' ;
for ( var name in env . attributes ) {
attributes += name + '="' + ( env . attributes [ name ] || '' ) + '"' ;
}
return '<' + env . tag + ' class="' + env . classes . join ( ' ' ) + '" ' + attributes + '>' + env . content + '</' + env . tag + '>' ;
} ;
if ( ! _self . document ) {
if ( ! _self . addEventListener ) {
// in Node.js
return _self . Prism ;
}
// In worker
_self . addEventListener ( 'message' , function ( evt ) {
var message = JSON . parse ( evt . data ) ,
lang = message . language ,
code = message . code ;
_self . postMessage ( JSON . stringify ( _ . util . encode ( _ . tokenize ( code , _ . languages [ lang ] ) ) ) ) ;
_self . close ( ) ;
} , false ) ;
return _self . Prism ;
}
// Get current script and highlight
var script = document . getElementsByTagName ( 'script' ) ;
script = script [ script . length - 1 ] ;
if ( script ) {
_ . filename = script . src ;
if ( document . addEventListener && ! script . hasAttribute ( 'data-manual' ) ) {
document . addEventListener ( 'DOMContentLoaded' , _ . highlightAll ) ;
}
}
return _self . Prism ;
} ) ( ) ;
if ( typeof module !== 'undefined' && module . exports ) {
module . exports = Prism ;
}
;
Prism . languages . markup = {
'comment' : /<!--[\w\W]*?-->/ ,
'prolog' : /<\?[\w\W]+?\?>/ ,
'doctype' : /<!DOCTYPE[\w\W]+?>/ ,
'cdata' : /<!\[CDATA\[[\w\W]*?]]>/i ,
'tag' : {
pattern : /<\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i ,
inside : {
'tag' : {
pattern : /^<\/?[^\s>\/]+/i ,
inside : {
'punctuation' : /^<\/?/ ,
'namespace' : /^[^\s>\/:]+:/
}
} ,
'attr-value' : {
pattern : /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i ,
inside : {
'punctuation' : /[=>"']/
}
} ,
'punctuation' : /\/?>/ ,
'attr-name' : {
pattern : /[^\s>\/]+/ ,
inside : {
'namespace' : /^[^\s>\/:]+:/
}
}
}
} ,
'entity' : /&#?[\da-z]{1,8};/i
} ;
// Plugin to make entity title show the real entity, idea by Roman Komarov
Prism . hooks . add ( 'wrap' , function ( env ) {
if ( env . type === 'entity' ) {
env . attributes [ 'title' ] = env . content . replace ( /&/ , '&' ) ;
}
} ) ;
;
Prism . languages . css = {
'comment' : /\/\*[\w\W]*?\*\// ,
'atrule' : {
pattern : /@[\w-]+?.*?(;|(?=\s*\{))/i ,
inside : {
'rule' : /@[\w-]+/
// See rest below
}
} ,
'url' : /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i ,
'selector' : /[^\{\}\s][^\{\};]*?(?=\s*\{)/ ,
'string' : /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/ ,
'property' : /(\b|\B)[\w-]+(?=\s*:)/i ,
'important' : /\B!important\b/i ,
'function' : /[-a-z0-9]+(?=\()/i ,
'punctuation' : /[(){};:]/
} ;
Prism . languages . css [ 'atrule' ] . inside . rest = Prism . util . clone ( Prism . languages . css ) ;
if ( Prism . languages . markup ) {
Prism . languages . insertBefore ( 'markup' , 'tag' , {
'style' : {
pattern : /<style[\w\W]*?>[\w\W]*?<\/style>/i ,
inside : {
'tag' : {
pattern : /<style[\w\W]*?>|<\/style>/i ,
inside : Prism . languages . markup . tag . inside
} ,
rest : Prism . languages . css
} ,
alias : 'language-css'
}
} ) ;
Prism . languages . insertBefore ( 'inside' , 'attr-value' , {
'style-attr' : {
pattern : /\s*style=("|').*?\1/i ,
inside : {
'attr-name' : {
pattern : /^\s*style/i ,
inside : Prism . languages . markup . tag . inside
} ,
'punctuation' : /^\s*=\s*['"]|['"]\s*$/ ,
'attr-value' : {
pattern : /.+/i ,
inside : Prism . languages . css
}
} ,
alias : 'language-css'
}
} , Prism . languages . markup . tag ) ;
} ;
Prism . languages . clike = {
'comment' : [
{
pattern : /(^|[^\\])\/\*[\w\W]*?\*\// ,
lookbehind : true
} ,
{
pattern : /(^|[^\\:])\/\/.*/ ,
lookbehind : true
}
] ,
'string' : /("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/ ,
'class-name' : {
pattern : /((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i ,
lookbehind : true ,
inside : {
punctuation : /(\.|\\)/
}
} ,
'keyword' : /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/ ,
'boolean' : /\b(true|false)\b/ ,
'function' : /[a-z0-9_]+(?=\()/i ,
'number' : /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/ ,
'operator' : /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/ ,
'punctuation' : /[{}[\];(),.:]/
} ;
;
Prism . languages . javascript = Prism . languages . extend ( 'clike' , {
'keyword' : /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/ ,
'number' : /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/ ,
'function' : /(?!\d)[a-z0-9_$]+(?=\()/i
} ) ;
Prism . languages . insertBefore ( 'javascript' , 'keyword' , {
'regex' : {
pattern : /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/ ,
lookbehind : true
}
} ) ;
Prism . languages . insertBefore ( 'javascript' , 'class-name' , {
'template-string' : {
pattern : /`(?:\\`|\\?[^`])*`/ ,
inside : {
'interpolation' : {
pattern : /\$\{[^}]+\}/ ,
inside : {
'interpolation-punctuation' : {
pattern : /^\$\{|\}$/ ,
alias : 'punctuation'
} ,
rest : Prism . languages . javascript
}
} ,
'string' : /[\s\S]+/
}
}
} ) ;
if ( Prism . languages . markup ) {
Prism . languages . insertBefore ( 'markup' , 'tag' , {
'script' : {
pattern : /<script[\w\W]*?>[\w\W]*?<\/script>/i ,
inside : {
'tag' : {
pattern : /<script[\w\W]*?>|<\/script>/i ,
inside : Prism . languages . markup . tag . inside
} ,
rest : Prism . languages . javascript
} ,
alias : 'language-javascript'
}
} ) ;
}
;
Prism . languages . actionscript = Prism . languages . extend ( 'javascript' , {
'keyword' : /\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/ ,
'operator' : /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
} ) ;
Prism . languages . actionscript [ 'class-name' ] . alias = 'function' ;
if ( Prism . languages . markup ) {
Prism . languages . insertBefore ( 'actionscript' , 'string' , {
'xml' : {
pattern : /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . markup
}
}
} ) ;
} ;
Prism . languages . apacheconf = {
'comment' : /#.*/ ,
'directive-inline' : {
pattern : / ^ ( \ s * ) \ b ( A c c e p t F i l t e r | A c c e p t P a t h I n f o | A c c e s s F i l e N a m e | A c t i o n | A d d A l t | A d d A l t B y E n c o d i n g | A d d A l t B y T y p e | A d d C h a r s e t | A d d D e f a u l t C h a r s e t | A d d D e s c r i p t i o n | A d d E n c o d i n g | A d d H a n d l e r | A d d I c o n | A d d I c o n B y E n c o d i n g | A d d I c o n B y T y p e | A d d I n p u t F i l t e r | A d d L a n g u a g e | A d d M o d u l e I n f o | A d d O u t p u t F i l t e r | A d d O u t p u t F i l t e r B y T y p e | A d d T y p e | A l i a s | A l i a s M a t c h | A l l o w | A l l o w C O N N E C T | A l l o w E n c o d e d S l a s h e s | A l l o w M e t h o d s | A l l o w O v e r r i d e | A l l o w O v e r r i d e L i s t | A n o n y m o u s | A n o n y m o u s _ L o g E m a i l | A n o n y m o u s _ M u s t G i v e E m a i l | A n o n y m o u s _ N o U s e r I D | A n o n y m o u s _ V e r i f y E m a i l | A s y n c R e q u e s t W o r k e r F a c t o r | A u t h B a s i c A u t h o r i t a t i v e | A u t h B a s i c F a k e | A u t h B a s i c P r o v i d e r | A u t h B a s i c U s e D i g e s t A l g o r i t h m | A u t h D B D U s e r P W Q u e r y | A u t h D B D U s e r R e a l m Q u e r y | A u t h D B M G r o u p F i l e | A u t h D B M T y p e | A u t h D B M U s e r F i l e | A u t h D i g e s t A l g o r i t h m | A u t h D i g e s t D o m a i n | A u t h D i g e s t N o n c e L i f e t i m e | A u t h D i g e s t P r o v i d e r | A u t h D i g e s t Q o p | A u t h D i g e s t S h m e m S i z e | A u t h F o r m A u t h o r i t a t i v e | A u t h F o r m B o d y | A u t h F o r m D i s a b l e N o S t o r e | A u t h F o r m F a k e B a s i c A u t h | A u t h F o r m L o c a t i o n | A u t h F o r m L o g i n R e q u i r e d L o c a t i o n | A u t h F o r m L o g i n S u c c e s s L o c a t i o n | A u t h F o r m L o g o u t L o c a t i o n | A u t h F o r m M e t h o d | A u t h F o r m M i m e t y p e | A u t h F o r m P a s s w o r d | A u t h F o r m P r o v i d e r | A u t h F o r m S i t e P a s s p h r a s e | A u t h F o r m S i z e | A u t h F o r m U s e r n a m e | A u t h G r o u p F i l e | A u t h L D A P A u t h o r i z e P r e f i x | A u t h L D A P B i n d A u t h o r i t a t i v e | A u t h L D A P B i n d D N | A u t h L D A P B i n d P a s s w o r d | A u t h L D A P C h a r s e t C o n f i g | A u t h L D A P C o m p a r e A s U s e r | A u t h L D A P C o m p a r e D N O n S e r v e r | A u t h L D A P D e r e f e r e n c e A l i a s e s | A u t h L D A P G r o u p A t t r i b u t e | A u t h L D A P G r o u p A t t r i b u t e I s D N | A u t h L D A P I n i t i a l B i n d A s U s e r | A u t h L D A P I n i t i a l B i n d P a t t e r n | A u t h L D A P M a x S u b G r o u p D e p t h | A u t h L D A P R e m o t e U s e r A t t r i b u t e | A u t h L D A P R e m o t e U s e r I s D N | A u t h L D A P S e a r c h A s U s e r | A u t h L D A P S u b G r o u p A t t r i b u t e | A u t h L D A P S u b G r o u p C l a s s | A u t h L D A P U r l | A u t h M e r g i n g | A u t h N a m e | A u t h n C a c h e C o n t e x t | A u t h n C a c h e E n a b l e | A u t h n C a c h e P r o v i d e F o r | A u t h n C a c h e S O C a c h e | A u t h n C a c h e T i m e o u t | A u t h n z F c g i C h e c k A u t h n P r o v i d e r | A u t h n z F c g i D e f i n e P r o v i d e r | A u t h T y p e | A u t h U s e r F i l e | A u t h z D B D L o g i n T o R e f e r e r | A u t h z D B D Q u e r y | A u t h z D B D R e d i r e c t Q u e r y | A u t h z D B M T y p e | A u t h z S e n d F o r b i d d e n O n F a i l u r e | B a l a n c e r G r o w t h | B a l a n c e r I n h e r i t | B a l a n c e r M e m b e r | B a l a n c e r P e r s i s t | B r o w s e r M a t c h | B r o w s e r M a t c h N o C a s e | B u f f e r e d L o g s | B u f f e r S i z e | C a c h e D e f a u l t E x p i r e | C a c h e D e t a i l H e a d e r | C a c h e D i r L e n g t h | C a c h e D i r L e v e l s | C a c h e D i s a b l e | C a c h e E n a b l e | C a c h e F i l e | C a c h e H e a d e r | C a c h e I g n o r e C a c h e C o n t r o l | C a c h e I g n o r e H e a d e r s | C a c h e I g n o r e N o L a s t M o d | C a c h e I g n o r e Q u e r y S t r i n g | C a c h e I g n o r e U R L S e s s i o n I d e n t i f i e r s | C a c h e K e y B a s e U R L | C a c h e L a s t M o d i f i e d F a c t o r | C a c h e L o c k | C a c h e L o c k M a x A g e | C a c h e L o c k P a t h | C a c h e M a x E x p i r e | C a c h e M a x F i l e S i z e | C a c h e M i n E x p i r e | C a c h e M i n F i l e S i z e | C a c h e N e g o t i a t e d D o c s | C a c h e Q u i c k H a n d l e r | C a c h e R e a d S i z e | C a c h e R e a d T i m e | C a c h e R o o t | C a c h e S o c a c h e | C a c h e S o c a c h e M a x S i z e | C a c h e S o c a c h e M a x T i m e | C a c h e S o c a c h e M i n T i m e | C a c h e S o c a c h e R e a d S i z e | C a c h e S o c a c h e R e a d T i m e | C a c h e S t a l e O n E r r o r | C a c h e S t o r e E x p i r e d | C a c h e S t o r e N o S t o r e | C a c h e S t o r e P r i v a t e | C G I D S c r i p t T i m e o u t | C G I M a p E x t e n s i o n | C h a r s e t D e f a u l t | C h a r s e t O p t i o n s | C h a r s e t S o u r c e E n c | C h e c k C a s e O n l y | C h e c k S p e l l i n g | C h r o o t D i r | C o n t e n t D i g e s t | C o o k i e D o m a i n | C o o k i e E x p i r e s | C o o k i e N a m e | C o o k i e S t y l e | C o o k i e T r a c k i n g | C o r e D u m p D i r e c t o r y | C u s t o m L o g | D a v | D a v D e p t h I n f i n i t y | D a v G e n e r i c L o c k D B | D a v L o c k D B | D a v M i n T i m e o u t | D B D E x p t i m e | D B D I n i t S Q L | D B D K e e p | D B D M a x | D B D M i n | D B D P a r a m s | D B D P e r s i s t | D B D P r e p a r e S Q L | D B D r i v e r | D e f a u l t I c o n | D e f a u l t L a n g u a g e | D e f a u l t R u n t i m e D i r | D e f a u l t T y p e | D e f i n e | D e f l a t e B u f f e r S i z e | D e f l a t e C o m p r e s s i o n L e v e l | D e f l a t e F i l t e r N o t e | D e f l a t e I n f l a t e L i m i t R e q u e s t B o d y | D e f l a t e I n f l a t e R a t i o B u r s t | D e f l a t e I n f l a t e R a t i o L i m i t | D e f l a t e M e m L e v e l | D e f l a t e W i n d o w S i z e | D e n y | D i r e c t o r y C h e c k H a n d l e r | D i r e c t o r y I n d e x | D i r e c t o r y I n d e x R e d i r e c t | D i r e c t o r y S l a s h | D o c u m e n t R o o t | D T r a c e P r i v i l e g e s | D u m p I O I n p u t | D u m p I O O u t p u t | E n a b l e E x c e p t i o n H o o k | E n a b l e M M A P | E n a b l e S e n d f i l e | E r r o r | E r r o r D o c u m e n t | E r r o r L o g | E r r o r L o g F o r m a t | E x a m p l e | E x p i r e s A c t i v e | E x p i r e s B y T y p e | E x p i r e s D e f a u l t | E x t e n d e d S t a t u s | E x t F i l t e r D e f i n e | E x t F i l t e r O p t i o n s | F a l l b a c k R e s o u r c e | F i l e E T a g | F i l t e r C h a i n | F i l t e r D e c l a r e | F i l t e r P r o t o c o l | F i l t e r P r o v i d e r | F i l t e r T r a c e | F o r c e L a n g u a g e P r i o r i t y | F o r c e T y p e | F o r e n s i c L o g | G p r o f D i r | G r a c e f u l S h u t d o w n T i m e o u t | G r o u p | H e a d e r | H e a d e r N a m e | H e a r t b e a t A d d r e s s | H e a r t b e a t L i s t e n | H e a r t b e a t M a x S e r v e r s | H e a r t b e a t S t o r a g e | H e a r t b e a t S t o r a g e | H o s t n a m e L o o k u p s | I d e n t i t y C h e c k | I d e n t i t y C h e c k T i m e o u t | I m a p B a s e | I m a p D e f a u l t | I m a p M e n u | I n c l u d e | I n c l u d e O p t i o n a l | I n d e x H e a d I n s e r t | I n d e x I g n o r e | I n d e x I g n o r e R e s e t | I n d e x O p t i o n s | I n d e x O r d e r D e f a u l t | I n d e x S t y l e S h e e t | I n p u t S e d | I S A P I A p p e n d L o g T o E r r o r s | I S A P I A p p e n d L o g T o Q u e r y | I S A P I C a c h e F i l e
lookbehind : true ,
alias : 'property'
} ,
'directive-block' : {
pattern : /<\/?\b(AuthnProviderAlias|AuthzProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|RequireAll|RequireAny|RequireNone|VirtualHost)\b *.*>/i ,
inside : {
'directive-block' : {
pattern : /^<\/?\w+/ ,
inside : {
'punctuation' : /^<\/?/
} ,
alias : 'tag'
} ,
'directive-block-parameter' : {
pattern : /.*[^>]/ ,
inside : {
'punctuation' : /:/ ,
'string' : {
pattern : /("|').*\1/ ,
inside : {
'variable' : /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/
}
}
} ,
alias : 'attr-value'
} ,
'punctuation' : />/
} ,
alias : 'tag'
} ,
'directive-flags' : {
pattern : /\[(\w,?)+\]/ ,
alias : 'keyword'
} ,
'string' : {
pattern : /("|').*\1/ ,
inside : {
'variable' : /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/
}
} ,
'variable' : /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/ ,
'regex' : /\^?.*\$|\^.*\$?/
} ;
;
Prism . languages . applescript = {
'comment' : [
// Allow one level of nesting
/\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/ ,
/--.+/ ,
/#.+/
] ,
'string' : /"(?:\\?.)*?"/ ,
'number' : /\b-?\d*\.?\d+([Ee]-?\d+)?\b/ ,
'operator' : [
/[&=≠≤≥*+\-\/÷^]|[<>]=?/ ,
/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/
] ,
'keyword' : /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/ ,
'class' : {
pattern : /\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/ ,
alias : 'builtin'
} ,
'punctuation' : /[{}():,¬«»《》]/
} ; ;
Prism . languages . aspnet = Prism . languages . extend ( 'markup' , {
'page-directive tag' : {
pattern : /<%\s*@.*%>/i ,
inside : {
'page-directive tag' : /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i ,
rest : Prism . languages . markup . tag . inside
}
} ,
'directive tag' : {
pattern : /<%.*%>/i ,
inside : {
'directive tag' : /<%\s*?[$=%#:]{0,2}|%>/i ,
rest : Prism . languages . csharp
}
}
} ) ;
// Regexp copied from prism-markup, with a negative look-ahead added
Prism . languages . aspnet . tag . pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i ;
// match directives of attribute value foo="<% Bar %>"
Prism . languages . insertBefore ( 'inside' , 'punctuation' , {
'directive tag' : Prism . languages . aspnet [ 'directive tag' ]
} , Prism . languages . aspnet . tag . inside [ "attr-value" ] ) ;
Prism . languages . insertBefore ( 'aspnet' , 'comment' , {
'asp comment' : /<%--[\w\W]*?--%>/
} ) ;
// script runat="server" contains csharp, not javascript
Prism . languages . insertBefore ( 'aspnet' , Prism . languages . javascript ? 'script' : 'tag' , {
'asp script' : {
pattern : /<script(?=.*runat=['"]?server['"]?)[\w\W]*?>[\w\W]*?<\/script>/i ,
inside : {
tag : {
pattern : /<\/?script\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/i ,
inside : Prism . languages . aspnet . tag . inside
} ,
rest : Prism . languages . csharp || { }
}
}
} ) ;
// Hacks to fix eager tag matching finishing too early: <script src="<% Foo.Bar %>"> => <script src="<% Foo.Bar %>
if ( Prism . languages . aspnet . style ) {
Prism . languages . aspnet . style . inside . tag . pattern = /<\/?style\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/i ;
Prism . languages . aspnet . style . inside . tag . inside = Prism . languages . aspnet . tag . inside ;
}
if ( Prism . languages . aspnet . script ) {
Prism . languages . aspnet . script . inside . tag . pattern = Prism . languages . aspnet [ 'asp script' ] . inside . tag . pattern ;
Prism . languages . aspnet . script . inside . tag . inside = Prism . languages . aspnet . tag . inside ;
} ;
// NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl
Prism . languages . autohotkey = {
'comment' : {
pattern : /(^[^";\n]*("[^"\n]*?"[^"\n]*?)*)(;.*$|^\s*\/\*[\s\S]*\n\*\/)/m ,
lookbehind : true
} ,
'string' : /"(([^"\n\r]|"")*)"/m ,
'function' : /[^\(\); \t,\n\+\*\-=\?>:\\\/<&%\[\]]+?(?=\()/m , //function - don't use .*\) in the end bcoz string locks it
'tag' : /^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m , //labels
'variable' : /%\w+%/ ,
'number' : /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/ ,
'operator' : /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/ ,
'punctuation' : /[\{}[\]\(\):,]/ ,
'boolean' : /\b(true|false)\b/ ,
'selector' : /\b(AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i ,
'constant' : /\b(a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i ,
'builtin' : /\b(abs|acos|asc|asin|atan|ceil|chr|class|cos|dllcall|exp|fileexist|Fileopen|floor|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i ,
'symbol' : /\b(alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i ,
'important' : /#\b(AllowSameLineComments|ClipboardTimeout|CommentFlag|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InstallKeybdHook|InstallMouseHook|KeyHistory|LTrim|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|WinActivateForce)\b/i ,
'keyword' : /\b(Abort|AboveNormal|Add|ahk_class|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i
} ; ;
Prism . languages . bash = Prism . languages . extend ( 'clike' , {
'comment' : {
pattern : /(^|[^"{\\])#.*/ ,
lookbehind : true
} ,
'string' : {
//allow multiline string
pattern : /("|')(\\?[\s\S])*?\1/ ,
inside : {
//'property' class reused for bash variables
'property' : /\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^\}]+\})/
}
} ,
// Redefined to prevent highlighting of numbers in filenames
'number' : {
pattern : /([^\w\.])-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/ ,
lookbehind : true
} ,
// Originally based on http://ss64.com/bash/
'function' : /\b(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)\b/ ,
'keyword' : /\b(if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)\b/
} ) ;
Prism . languages . insertBefore ( 'bash' , 'keyword' , {
//'property' class reused for bash variables
'property' : /\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^}]+\})/
} ) ;
Prism . languages . insertBefore ( 'bash' , 'comment' , {
//shebang must be before comment, 'important' class from css reused
'important' : /^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/
} ) ;
;
Prism . languages . brainfuck = {
'pointer' : {
pattern : /<|>/ ,
alias : 'keyword'
} ,
'increment' : {
pattern : /\+/ ,
alias : 'inserted'
} ,
'decrement' : {
pattern : /-/ ,
alias : 'deleted'
} ,
'branching' : {
pattern : /\[|\]/ ,
alias : 'important'
} ,
'operator' : /[.,]/ ,
'comment' : /\S+/
} ; ;
Prism . languages . c = Prism . languages . extend ( 'clike' , {
'keyword' : /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/ ,
'operator' : /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/
} ) ;
Prism . languages . insertBefore ( 'c' , 'string' , {
'macro' : {
// allow for multiline macro definitions
// spaces after the # character compile fine with gcc
pattern : /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im ,
lookbehind : true ,
alias : 'property' ,
inside : {
// highlight the path of the include statement as a string
'string' : {
pattern : /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/ ,
lookbehind : true
}
}
}
} ) ;
delete Prism . languages . c [ 'class-name' ] ;
delete Prism . languages . c [ 'boolean' ] ; ;
Prism . languages . csharp = Prism . languages . extend ( 'clike' , {
'keyword' : /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/ ,
'string' : [
/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/ ,
/("|')(\\?.)*?\1/
] ,
'number' : /\b-?(0x[\da-f]+|\d*\.?\d+)\b/i
} ) ;
Prism . languages . insertBefore ( 'csharp' , 'keyword' , {
'preprocessor' : {
pattern : /(^\s*)#.*/m ,
lookbehind : true
}
} ) ;
;
Prism . languages . cpp = Prism . languages . extend ( 'c' , {
'keyword' : /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/ ,
'boolean' : /\b(true|false)\b/ ,
'operator' : /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/
} ) ;
Prism . languages . insertBefore ( 'cpp' , 'keyword' , {
'class-name' : {
pattern : /(class\s+)[a-z0-9_]+/i ,
lookbehind : true
}
} ) ; ;
( function ( Prism ) {
// Ignore comments starting with { to privilege string interpolation highlighting
var comment = /#(?!\{).+/ ,
interpolation = {
pattern : /#\{[^}]+\}/ ,
alias : 'variable'
} ;
Prism . languages . coffeescript = Prism . languages . extend ( 'javascript' , {
'comment' : comment ,
'string' : [
// Strings are multiline
/'(?:\\?[^\\])*?'/ ,
{
// Strings are multiline
pattern : /"(?:\\?[^\\])*?"/ ,
inside : {
'interpolation' : interpolation
}
}
] ,
'keyword' : /\b(and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/ ,
'class-member' : {
pattern : /@(?!\d)\w+/ ,
alias : 'variable'
}
} ) ;
Prism . languages . insertBefore ( 'coffeescript' , 'comment' , {
'multiline-comment' : {
pattern : /###[\s\S]+?###/ ,
alias : 'comment'
} ,
// Block regexp can contain comments and interpolation
'block-regex' : {
pattern : /\/{3}[\s\S]*?\/{3}/ ,
alias : 'regex' ,
inside : {
'comment' : comment ,
'interpolation' : interpolation
}
}
} ) ;
Prism . languages . insertBefore ( 'coffeescript' , 'string' , {
'inline-javascript' : {
pattern : /`(?:\\?[\s\S])*?`/ ,
inside : {
'delimiter' : {
pattern : /^`|`$/ ,
alias : 'punctuation'
} ,
rest : Prism . languages . javascript
}
} ,
// Block strings
'multiline-string' : [
{
pattern : /'''[\s\S]*?'''/ ,
alias : 'string'
} ,
{
pattern : /"""[\s\S]*?"""/ ,
alias : 'string' ,
inside : {
interpolation : interpolation
}
}
]
} ) ;
Prism . languages . insertBefore ( 'coffeescript' , 'keyword' , {
// Object property
'property' : /(?!\d)\w+(?=\s*:(?!:))/
} ) ;
} ( Prism ) ) ; ;
Prism . languages . css . selector = {
pattern : /[^\{\}\s][^\{\}]*(?=\s*\{)/ ,
inside : {
'pseudo-element' : /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/ ,
'pseudo-class' : /:[-\w]+(?:\(.*\))?/ ,
'class' : /\.[-:\.\w]+/ ,
'id' : /#[-:\.\w]+/
}
} ;
Prism . languages . insertBefore ( 'css' , 'function' , {
'hexcode' : /#[\da-f]{3,6}/i ,
'entity' : /\\[\da-f]{1,8}/i ,
'number' : /[\d%\.]+/
} ) ; ;
Prism . languages . dart = Prism . languages . extend ( 'clike' , {
'string' : [
/r?("""|''')[\s\S]*?\1/ ,
/r?("|')(\\?.)*?\1/
] ,
'keyword' : [
/\b(?:async|sync|yield)\*/ ,
/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/
] ,
'operator' : /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
} ) ;
Prism . languages . insertBefore ( 'dart' , 'function' , {
'metadata' : {
pattern : /@\w+/ ,
alias : 'symbol'
}
} ) ; ;
Prism . languages . eiffel = {
'string' : [
// Aligned-verbatim-strings
/"([^[]*)\[[\s\S]+?\]\1"/ ,
// Non-aligned-verbatim-strings
/"([^{]*)\{[\s\S]+?\}\1"/ ,
// Single-line string
/"(?:%\s+%|%"|.)*?"/
] ,
// (comments including quoted strings not supported)
'comment' : /--.*/ ,
// normal char | special char | char code
'char' : /'(?:%'|.)+?'/ ,
'keyword' : /\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i ,
'boolean' : /\b(?:True|False)\b/i ,
'number' : [
// hexa | octal | bin
/\b0[xcb][\da-f](?:_*[\da-f])*\b/i ,
// Decimal
/(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/
] ,
'punctuation' : /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/ ,
'operator' : /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/
} ;
;
Prism . languages . erlang = {
'comment' : /%.+/ ,
'string' : /"(?:\\?.)*?"/ ,
'quoted-function' : {
pattern : /'(?:\\.|[^'\\])+'(?=\()/ ,
alias : 'function'
} ,
'quoted-atom' : {
pattern : /'(?:\\.|[^'\\])+'/ ,
alias : 'atom'
} ,
'boolean' : /\b(?:true|false)\b/ ,
'keyword' : /\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/ ,
'number' : [
/\$\\?./ ,
/\d+#[a-z0-9]+/i ,
/(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/
] ,
'function' : /\b[a-z][\w@]*(?=\()/ ,
'variable' : {
// Look-behind is used to prevent wrong highlighting of atoms containing "@"
pattern : /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/ ,
lookbehind : true
} ,
'operator' : [
/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/ ,
{
// We don't want to match <<
pattern : /(^|[^<])<(?!<)/ ,
lookbehind : true
} ,
{
// We don't want to match >>
pattern : /(^|[^>])>(?!>)/ ,
lookbehind : true
}
] ,
'atom' : /\b[a-z][\w@]*/ ,
'punctuation' : /[()[\]{}:;,.#|]|<<|>>/
} ; ;
Prism . languages . fsharp = Prism . languages . extend ( 'clike' , {
'comment' : [
{
pattern : /(^|[^\\])\(\*[\w\W]*?\*\)/ ,
lookbehind : true
} ,
{
pattern : /(^|[^\\:])\/\/.*/ ,
lookbehind : true
}
] ,
'keyword' : /\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|let|let!|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|then|to|true|try|type|upcast|use|use!|val|void|when|while|with|yield|yield!|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/ ,
'string' : /@?("""|"|')((\\|\n)?.)*?\1B?/ ,
'preprocessor' : /^\s*#.*/m ,
'number' : [
/\b-?0x[\da-fA-F]+(un|lf|LF)?\b/ ,
/\b-?0b[01]+(y|uy)?\b/ ,
/\b-?(\d+\.|\d*\.?\d+)([fFmM]|[eE][+-]?\d+)?\b/ ,
/\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/
]
} ) ; ;
Prism . languages . fortran = {
'quoted-number' : {
pattern : /[BOZ](['"])[A-F0-9]+\1/i ,
alias : 'number'
} ,
'string' : {
pattern : /(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/ ,
inside : {
'comment' : {
pattern : /(&(?:\r\n?|\n)\s*)!.*/ ,
lookbehind : true
}
}
} ,
'comment' : /!.*/ ,
'boolean' : /\.(?:TRUE|FALSE)\.(?:_\w+)?/i ,
'number' : /(?:\b|[+-])(?:\d+(?:\.\d*)?|\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i ,
'keyword' : [
// Types
/\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i ,
// END statements
/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i ,
// Statements
/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i ,
// Others
/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i
] ,
'operator' : [
/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.(?:EQ|NE|LT|LE|GT|GE|NOT|AND|OR|EQV|NEQV)\.|\.[A-Z]+\./i ,
{
// Use lookbehind to prevent confusion with (/ /)
pattern : /(^|(?!\().)\/(?!\))/ ,
lookbehind : true
}
] ,
'punctuation' : /\(\/|\/\)|[(),;:&]/
} ; ;
Prism . languages . gherkin = {
'pystring' : {
pattern : /("""|''')[\s\S]+?\1/ ,
alias : 'string'
} ,
'comment' : {
pattern : /((^|\n)[ \t]*)#.*/ ,
lookbehind : true
} ,
'tag' : {
pattern : /((^|\n)[ \t]*)@.*/ ,
lookbehind : true
} ,
'feature' : {
pattern : /((^|\n)[ \t]*)(Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِ یژگی|रू प ले ख|ਖਾ ਸੀ ਅਤ|ਨਕਸ਼ ਨੁ ਹਾ ਰ|ਮੁ ਹਾ ਂ ਦਰਾ |గు ణము |ಹೆ ಚ್ ಚಳ|ความต้ องการทางธุ รกิ จ|ความสามารถ|โครงหลั ก|기능|フィーチャ|功能|機能):([^:]+\n)*/ ,
lookbehind : true ,
inside : {
'important' : {
pattern : /(:)[^\n]+/ ,
lookbehind : true
} ,
keyword : /[^:\n]+:/
}
} ,
'scenario' : {
pattern : / ( ( ^ | \ n ) [ \ t ] * ) ( A b s t r a c t S c e n a r i o | A b s t r a k t S c e n a r i o | A c h t e r g r o n d | A e r | Æ r | A g t e r g r o n d | A l l y ' a l l | A n t e c e d e n t e s | A n t e c e d e n t s | A t b u r ð a r á s | A t b u r ð a r á s i r | A w w w , l o o k m a t e | B 4 | B a c k g r o u n d | B a g g r u n d | B a k g r u n d | B a k g r u n n | B a k g r u n n u r | B e i s p i e l e | B e i s p i l l e r | B ố i c ả n h | C e f n d i r | C e n a r i o | C e n á r i o | C e n a r i o d e F u n d o | C e n á r i o d e F u n d o | C e n a r i o s | C e n á r i o s | C o n t e s t o | C o n t e x t | C o n t e x t e | C o n t e x t o | C o n t o | C o n t o h | C o n t o n e | D æ m i | D a s a r | D e a d m e n t e l l n o t a l e s | D e l i n e a c a o d o C e n a r i o | D e l i n e a ç ã o d o C e n á r i o | D i s i s w h a t w e n t d o w n | D ữ l i ệ u | D y a g r a m s e n a r y o | D y a g r a m S e n a r y o | E g z a n p | E j e m p l o s | E k s e m p l e r | E k z e m p l o j | E n g h r e i f f t i a u | E s b o z o d o e s c e n a r i o | E s c e n a r i | E s c e n a r i o | E s e m p i | E s q u e m a d e l ' e s c e n a r i | E s q u e m a d e l e s c e n a r i o | E s q u e m a d o C e n a r i o | E s q u e m a d o C e n á r i o | E x a m p l e s | E X A M P L Z | E x e m p e l | E x e m p l e | E x e m p l e s | E x e m p l o s | F i r s t o f f | F o n o | F o r g a t ó k ö n y v | F o r g a t ó k ö n y v v á z l a t | F u n d o | G e ç m i ş | g h a n t o H | G r u n d l a g e | H a n n e r g r o n d | H á t t é r | H e a v e t o | I s t o r i k | J u h t u m i d | K e a d a a n | K h u n g k ị c h b ả n | K h u n g t ì n h h u ố n g | K ị c h b ả n | K o n c e p t | K o n s e p s k e n a r i o | K o n t è k s | K o n t e k s t | K o n t e k s t a s | K o n t e k s t s | K o n t e x t | K o n t u r o d e l a s c e n a r o | L a t a r B e l a k a n g | l u t | l u t c h o v n a t l h | l u t m e y | L ý s i n g A t b u r ð a r á s a r | L ý s i n g D æ m a | M e n g g a r i s k a n S e n a r i o | M I S H U N | M I S H U N S R S L Y | m o ' | N á č r t S c e n á r a | N á č r t S c é n á ř e | N á č r t S c e n á r u | O r i s s c e n a r i j a | Ö r n e k l e r | O s n o v a | O s n o v a S c e n á r a | O s n o v a s c é n á ř e | O s n u t e k | O z a d j e | P a r a u g s | P a v y z d ž i a i | P é l d á k | P i e m ē r i | P l a n d u s c é n a r i o | P l a n d u S c é n a r i o | P l a n s e n a r y o | P l a n S e n a r y o | P l a n g v u m S z e n a r i o | P o z a d í | P o z a d i e | P o z a d i n a | P r í k l a d y | P ř í k l a d y | P r i m e r | P r i m e r i | P r i m j e r i | P r z y k ł a d y | R a a m s t s e n a a r i u m | R e c k o n i t ' s l i k e | R e r e f o n s | S c e n á r | S c é n á ř | S c e n a r i e | S c e n a r i j | S c e n a r i j a i | S c e n a r i j a u s š a b l o n a s | S c e n a r i j i | S c e n ā r i j s | S c e n ā r i j s p ē c p a r a u g a | S c e n a r i j u s | S c e n a r i o | S c é n a r i o | S c e n a r i o A m l i n e l l o l | S c e n a r i o O u t l i n e | S c e n a r i o T e m p l a t e | S c e n a r i o m a l | S c e n a r i o m a l l | S c e n a r i o s | S c e n a r i u | S c e n a r i u s z | S c e n a r o | S c h e m a d e l l o s c e n a r i o | S e ð e | S e t h e | S e þ e | S e n a r i o | S e n a r y o | S e n a r y o d e s k r i p s y o n | S e n a r y o D e s k r i p s y o n | S e n a r y o t a s l a ğ ı | S h i v e r m e t i m b e r s | S i t u ā c i j a | S i t u a i | S i t u a s i e | S i t u a s i e U i t e e n s e t t i n g | S k e n a r i o | S k e n a r i o k o n s e p | S k i c a | S t r u c t u r a s c e n a r i u | S t r u c t u r ă s c e n a r i u | S t r u k t u r a s c e n a r i j a | S t s e n a a r i u m | S w a | S w a h w a e r s w a | S w a h w æ r s w a | S z a b l o n s c e n a r i u s z a | S z e n a r i o | S z e n a r i o g r u n d r i s s | T a p a u k s e t | T a p a u s | T a p a u s a i h i o | T a u s t | T a u s t a | T e m p l a t e K e a d a a n | T e m p l a t e S e n a r i o | T e m p l a t e S i t u a i | T h e t h i n g o f i t i s | T ì n h h u ố n g | V a r i a n t a i | V o o r b e e l d e | V o o r b e e l d e n | W h a r r i m e a n i s | Y o \ - h o \ - h o | Y o u ' l l w a n n a | Z a ł o ż e n i a | Π α ρ α δ ε ί γ μ α τ α | Π ε ρ ι γ ρ α φ ή Σ ε ν α ρ ί ο υ | Σ ε ν ά ρ ι α | Σ ε ν ά ρ ι ο | Υ π ό β α θ ρ ο | К е р е ш | К о н т е к с т | К о н ц е п т | М и с а л л а р | М и с о л л а р | О с н о в а | П е р е д у м о в а | П о з а д и н а | П р е д и с т о р и я | П р е д ы с т о р и я | П р и к л а д и | П р и м е р | П р и м е р и | П р и м е р ы | Р а м к а н а с ц е н а р и й | С к и ц а | С т р у к т у р а с ц е н а р и ј а | С т р у к т у р а с ц е н а р и я | С т р у к т у р а с ц е н а р і ю | С ц е н а р и й | С ц е н а р и й с т р у к т у р а с и | С ц е н а р и й н ы ң т ө з е л е ш е | С ц е н а р и ј и | С ц е н а р и о | С ц е н а р і й | Т а р и х | Ү р н ә к л ә р | ד ו ג מ א ו ת | ר ק ע | ת ב נ י ת ת ר ח י ש | ת ר ח י ש | ا ل خ ل ف ي ة | ا ل گ و ی س ن ا ر ی و | ا م ث ل ة | پ س م ن ظ ر | ز م ی ن ه | س ن ا ر ی و | س ي ن ا ر ي و | س ي ن ا ر ي و م خ ط ط | م ث ا ل ی ں | م ن ظ ر ن ا م ے ک ا خ ا ک ہ | م ن ظ ر ن ا م ہ | ن م و ن ه ه ا | उ द ा ह र ण | प र ि द ृ श ् य | प र ि द ृ श ् य र ू प र े ख ा | प ृ ष ् ठ भ ू म ि | ਉ ਦ ਾ ਹ ਰ ਨ ਾ ਂ | ਪ ਟ ਕ ਥ ਾ | ਪ ਟ ਕ ਥ ਾ ਢ ਾ ਂ ਚ ਾ | ਪ ਟ ਕ ਥ ਾ ਰ ੂ ਪ ਰ ੇ ਖ ਾ | ਪ ਿ ਛ ੋ ਕ ੜ | ఉ ద ా హ ర ణ ల ు | క థ న ం | న ే ప థ ్ య ం | స న ్ న ి వ ే శ ం | ಉ ದ ಾ ಹ ರ ಣ ೆ ಗ ಳ ು | ಕ ಥ ಾ ಸ ಾ ರ ಾ ಂ ಶ | ವ ಿ ವ ರ ಣ ೆ | ಹ ಿ ನ ್ ನ ೆ ಲ ೆ | โ ค ร ง ส ร ้ า ง ข อ ง เ ห ต ุ ก า ร ณ ์ | ช ุ ด ข อ ง ต ั ว อ ย ่ า ง | ช ุ ด ข อ ง เ ห ต ุ ก า ร ณ ์ | แ น ว ค ิ ด | ส ร ุ ป เ ห ต ุ ก า ร ณ ์ | เ ห ต ุ ก า ร ณ ์ | 배 경 | 시 나 리 오 | 시 나 리 오 개 요 | 예 | サ ン プ ル | シ ナ リ オ | シ ナ リ オ ア ウ
lookbehind : true ,
inside : {
'important' : {
pattern : /(:)[^\n]*/ ,
lookbehind : true
} ,
keyword : /[^:\n]+:/
}
} ,
'table-body' : {
pattern : /(\n[ \t]*\|.+\|[^\n]*)+/ ,
lookbehind : true ,
inside : {
'outline' : {
pattern : /<[^>]+?>/ ,
alias : 'variable'
} ,
'td' : {
pattern : /[^|]+/ ,
alias : 'string'
} ,
'punctuation' : /\|/
}
} ,
'table-head' : {
pattern : /(\n[ \t]*\|.+\|[^\n]*)/ ,
inside : {
'th' : {
pattern : /[^|]+/ ,
alias : 'variable'
} ,
'punctuation' : /\|/
}
} ,
'atrule' : {
pattern : /(\n[ \t]+)('ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa|Þá|Þa þe|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً |اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा |कि न् तु |चू ं कि |जब|तथा |तदा |तब|परन् तु |पर|यदि |ਅਤੇ |ਜਦੋ ਂ |ਜਿ ਵੇ ਂ ਕਿ |ਜੇ ਕਰ|ਤਦ|ਪਰ|అప్ పు డు |ఈ పరి స్ థి తి లో |కా ని |చె ప్ పబడి నది |మరి యు |ಆದರೆ |ನಂ ತರ|ನಿ ೕ ಡಿ ದ|ಮತ್ ತು |ಸ್ ಥಿ ತಿ ಯನ್ ನು |กำหนดให้ |ดั งนั ้ น|แต่ |เมื ่ อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t]+)/ ,
lookbehind : true
} ,
'string' : {
pattern : /("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/ ,
inside : {
'outline' : {
pattern : /<[^>]+?>/ ,
alias : 'variable'
}
}
} ,
'outline' : {
pattern : /<[^>]+?>/ ,
alias : 'variable'
}
} ;
;
Prism . languages . git = {
/ *
* A simple one line comment like in a git status command
* For instance :
* $ git status
* # On branch infinite - scroll
* # Your branch and 'origin/sharedBranches/frontendTeam/infinite-scroll' have diverged ,
* # and have 1 and 2 different commits each , respectively .
* nothing to commit ( working directory clean )
* /
'comment' : /^#.*$/m ,
/ *
* a string ( double and simple quote )
* /
'string' : /("|')(\\?.)*?\1/m ,
/ *
* a git command . It starts with a random prompt finishing by a $ , then "git" then some other parameters
* For instance :
* $ git add file . txt
* /
'command' : {
pattern : /^.*\$ git .*$/m ,
inside : {
/ *
* A git command can contain a parameter starting by a single or a double dash followed by a string
* For instance :
* $ git diff -- cached
* $ git log - p
* /
'parameter' : /\s(--|-)\w+/m
}
} ,
/ *
* Coordinates displayed in a git diff command
* For instance :
* $ git diff
* diff -- git file . txt file . txt
* index 6214953. . 1 d54a52 100644
* -- - file . txt
* ++ + file . txt
* @ @ - 1 + 1 , 2 @ @
* - Here ' s my tetx file
* + Here ' s my text file
* + And this is the second line
* /
'coord' : /^@@.*@@$/m ,
/ *
* Regexp to match the changed lines in a git diff output . Check the example above .
* /
'deleted' : /^-(?!-).+$/m ,
'inserted' : /^\+(?!\+).+$/m ,
/ *
* Match a "commit [SHA1]" line in a git log output .
* For instance :
* $ git log
* commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09
* Author : lgiraudel
* Date : Mon Feb 17 11 : 18 : 34 2014 + 0100
*
* Add of a new line
* /
'commit_sha1' : /^commit \w{40}$/m
} ;
;
Prism . languages . go = Prism . languages . extend ( 'clike' , {
'keyword' : /\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/ ,
'builtin' : /\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64|)|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(ln)?|real|recover)\b/ ,
'boolean' : /\b(_|iota|nil|true|false)\b/ ,
'operator' : /([(){}\[\]]|[*\/%^!]=?|\+[=+]?|-[>=-]?|\|[=|]?|>[=>]?|<(<|[=-])?|==?|&(&|=|^=?)?|\.(\.\.)?|[,;]|:=?)/ ,
'number' : /\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/i ,
'string' : /("|'|`)(\\?.|\r|\n)*?\1/
} ) ;
delete Prism . languages . go [ 'class-name' ] ;
;
Prism . languages . groovy = Prism . languages . extend ( 'clike' , {
'keyword' : /\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/ ,
'string' : /("""|''')[\W\w]*?\1|("|'|\/)(?:\\?.)*?\2|(\$\/)(\$\/\$|[\W\w])*?\/\$/ ,
'number' : /\b0b[01_]+\b|\b0x[\da-f_]+(\.[\da-f_p\-]+)?\b|\b[\d_]+(\.[\d_]+[e]?[\d]*)?[glidf]\b|[\d_]+(\.[\d_]+)?\b/i ,
'operator' : {
pattern : /(^|[^.])(={0,2}~|\?\.|\*?\.@|\.&|\.{1,2}(?!\.)|\.{2}<?(?=\w)|->|\?:|[-+]{1,2}|!|<=>|>{1,3}|<{1,2}|={1,2}|&{1,2}|\|{1,2}|\?|\*{1,2}|\/|\^|%)/ ,
lookbehind : true
} ,
'punctuation' : /\.+|[{}[\];(),:$]/
} ) ;
Prism . languages . insertBefore ( 'groovy' , 'string' , {
'shebang' : {
pattern : /#!.+/ ,
alias : 'comment'
}
} ) ;
Prism . languages . insertBefore ( 'groovy' , 'punctuation' , {
'spock-block' : /\b(setup|given|when|then|and|cleanup|expect|where):/
} ) ;
Prism . languages . insertBefore ( 'groovy' , 'function' , {
'annotation' : {
pattern : /(^|[^.])@\w+/ ,
lookbehind : true
}
} ) ;
Prism . hooks . add ( 'wrap' , function ( env ) {
if ( env . language === 'groovy' && env . type === 'string' ) {
var delimiter = env . content [ 0 ] ;
if ( delimiter != "'" ) {
var pattern = /([^\\])(\$(\{.*?\}|[\w\.]+))/ ;
if ( delimiter === '$' ) {
pattern = /([^\$])(\$(\{.*?\}|[\w\.]+))/ ;
}
env . content = Prism . highlight ( env . content , {
'expression' : {
pattern : pattern ,
lookbehind : true ,
inside : Prism . languages . groovy
}
} ) ;
env . classes . push ( delimiter === '/' ? 'regex' : 'gstring' ) ;
}
}
} ) ;
;
/ * T O D O
Handle multiline code after tag
% foo = some |
multiline |
code |
* /
( function ( Prism ) {
Prism . languages . haml = {
// Multiline stuff should appear before the rest
'multiline-comment' : [
{
pattern : /((?:^|\n)([\t ]*))\/.*(\n\2[\t ]+.+)*/ ,
lookbehind : true ,
alias : 'comment'
} ,
{
pattern : /((?:^|\n)([\t ]*))-#.*(\n\2[\t ]+.+)*/ ,
lookbehind : true ,
alias : 'comment'
}
] ,
'multiline-code' : [
{
pattern : /((?:^|\n)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(\n\2[\t ]+.*,[\t ]*)*(\n\2[\t ]+.+)/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . ruby
}
} ,
{
pattern : /((?:^|\n)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(\n\2[\t ]+.*\|[\t ]*)*/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . ruby
}
}
] ,
// See at the end of the file for known filters
'filter' : {
pattern : /((?:^|\n)([\t ]*)):[\w-]+(\n(?:\2[\t ]+.+|\s*?(?=\n)))+/ ,
lookbehind : true ,
inside : {
'filter-name' : {
pattern : /^:[\w-]+/ ,
alias : 'variable'
}
}
} ,
'markup' : {
pattern : /((?:^|\n)[\t ]*)<.+/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . markup
}
} ,
'doctype' : {
pattern : /((?:^|\n)[\t ]*)!!!(?: .+)?/ ,
lookbehind : true
} ,
'tag' : {
// Allows for one nested group of braces
pattern : /((?:^|\n)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^}])+\}|\[[^\]]+\])*[\/<>]*/ ,
lookbehind : true ,
inside : {
'attributes' : [
{
// Lookbehind tries to prevent interpolations for breaking it all
// Allows for one nested group of braces
pattern : /(^|[^#])\{(?:\{[^}]+\}|[^}])+\}/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . ruby
}
} ,
{
pattern : /\([^)]+\)/ ,
inside : {
'attr-value' : {
pattern : /(=\s*)(?:"(?:\\?.)*?"|[^)\s]+)/ ,
lookbehind : true
} ,
'attr-name' : /[\w:-]+(?=\s*!?=|\s*[,)])/ ,
'punctuation' : /[=(),]/
}
} ,
{
pattern : /\[[^\]]+\]/ ,
inside : {
rest : Prism . languages . ruby
}
}
] ,
'punctuation' : /[<>]/
}
} ,
'code' : {
pattern : /((?:^|\n)[\t ]*(?:[~-]|[&!]?=)).+/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . ruby
}
} ,
// Interpolations in plain text
'interpolation' : {
pattern : /#\{[^}]+\}/ ,
inside : {
'delimiter' : {
pattern : /^#\{|\}$/ ,
alias : 'punctuation'
} ,
rest : Prism . languages . ruby
}
} ,
'punctuation' : {
pattern : /((?:^|\n)[\t ]*)[~=\-&!]/ ,
lookbehind : true
}
} ;
var filter _pattern = '((?:^|\\n)([\\t ]*)):{{filter_name}}(\\n(?:\\2[\\t ]+.+|\\s*?(?=\\n)))+' ;
// Non exhaustive list of available filters and associated languages
var filters = [
'css' ,
{ filter : 'coffee' , language : 'coffeescript' } ,
'erb' ,
'javascript' ,
'less' ,
'markdown' ,
'ruby' ,
'scss' ,
'textile'
] ;
var all _filters = { } ;
for ( var i = 0 , l = filters . length ; i < l ; i ++ ) {
var filter = filters [ i ] ;
filter = typeof filter === 'string' ? { filter : filter , language : filter } : filter ;
if ( Prism . languages [ filter . language ] ) {
all _filters [ 'filter-' + filter . filter ] = {
pattern : RegExp ( filter _pattern . replace ( '{{filter_name}}' , filter . filter ) ) ,
lookbehind : true ,
inside : {
'filter-name' : {
pattern : /^:[\w-]+/ ,
alias : 'variable'
} ,
rest : Prism . languages [ filter . language ]
}
}
}
}
Prism . languages . insertBefore ( 'haml' , 'filter' , all _filters ) ;
} ( Prism ) ) ; ;
( function ( Prism ) {
var handlebars _pattern = /\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g ;
Prism . languages . handlebars = Prism . languages . extend ( 'markup' , {
'handlebars' : {
pattern : handlebars _pattern ,
inside : {
'delimiter' : {
pattern : /^\{\{\{?|\}\}\}?$/i ,
alias : 'punctuation'
} ,
'string' : /(["'])(\\?.)+?\1/ ,
'number' : /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/ ,
'boolean' : /\b(true|false)\b/ ,
'block' : {
pattern : /^(\s*~?\s*)[#\/]\S+/i ,
lookbehind : true ,
alias : 'keyword'
} ,
'brackets' : {
pattern : /\[[^\]]+\]/ ,
inside : {
punctuation : /\[|\]/ ,
variable : /[\w\W]+/
}
} ,
'punctuation' : /[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/ ,
'variable' : /[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/
}
}
} ) ;
// Comments are inserted at top so that they can
// surround markup
Prism . languages . insertBefore ( 'handlebars' , 'tag' , {
'handlebars-comment' : {
pattern : /\{\{![\w\W]*?\}\}/ ,
alias : [ 'handlebars' , 'comment' ]
}
} ) ;
// Tokenize all inline Handlebars expressions that are wrapped in {{ }} or {{{ }}}
// This allows for easy Handlebars + markup highlighting
Prism . hooks . add ( 'before-highlight' , function ( env ) {
if ( env . language !== 'handlebars' ) {
return ;
}
env . tokenStack = [ ] ;
env . backupCode = env . code ;
env . code = env . code . replace ( handlebars _pattern , function ( match ) {
env . tokenStack . push ( match ) ;
return '___HANDLEBARS' + env . tokenStack . length + '___' ;
} ) ;
} ) ;
// Restore env.code for other plugins (e.g. line-numbers)
Prism . hooks . add ( 'before-insert' , function ( env ) {
if ( env . language === 'handlebars' ) {
env . code = env . backupCode ;
delete env . backupCode ;
}
} ) ;
// Re-insert the tokens after highlighting
// and highlight them with defined grammar
Prism . hooks . add ( 'after-highlight' , function ( env ) {
if ( env . language !== 'handlebars' ) {
return ;
}
for ( var i = 0 , t ; t = env . tokenStack [ i ] ; i ++ ) {
env . highlightedCode = env . highlightedCode . replace ( '___HANDLEBARS' + ( i + 1 ) + '___' , Prism . highlight ( t , env . grammar , 'handlebars' ) ) ;
}
env . element . innerHTML = env . highlightedCode ;
} ) ;
} ( Prism ) ) ;
;
Prism . languages . haskell = {
'comment' : {
pattern : /(^|[^-!#$%*+=\?&@|~.:<>^\\])(--[^-!#$%*+=\?&@|~.:<>^\\].*(\r?\n|$)|{-[\w\W]*?-})/m ,
lookbehind : true
} ,
'char' : /'([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/ ,
'string' : /"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/ ,
'keyword' : /\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/ ,
'import_statement' : {
// The imported or hidden names are not included in this import
// statement. This is because we want to highlight those exactly like
// we do for the names in the program.
pattern : /(\n|^)\s*(import)\s+(qualified\s+)?(([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*)(\s+(as)\s+(([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*))?(\s+hiding\b)?/m ,
inside : {
'keyword' : /\b(import|qualified|as|hiding)\b/
}
} ,
// These are builtin variables only. Constructors are highlighted later as a constant.
'builtin' : /\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/ ,
// decimal integers and floating point numbers | octal integers | hexadecimal integers
'number' : /\b(\d+(\.\d+)?([eE][+-]?\d+)?|0[Oo][0-7]+|0[Xx][0-9a-fA-F]+)\b/ ,
// Most of this is needed because of the meaning of a single '.'.
// If it stands alone freely, it is the function composition.
// It may also be a separator between a module name and an identifier => no
// operator. If it comes together with other special characters it is an
// operator too.
'operator' : /\s\.\s|([-!#$%*+=\?&@|~:<>^\\]*\.[-!#$%*+=\?&@|~:<>^\\]+)|([-!#$%*+=\?&@|~:<>^\\]+\.[-!#$%*+=\?&@|~:<>^\\]*)|[-!#$%*+=\?&@|~:<>^\\]+|(`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`)/ ,
// In Haskell, nearly everything is a variable, do not highlight these.
'hvariable' : /\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/ ,
'constant' : /\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/ ,
'punctuation' : /[{}[\];(),.:]/
} ;
;
Prism . languages . http = {
'request-line' : {
pattern : /^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b\shttps?:\/\/\S+\sHTTP\/[0-9.]+/ ,
inside : {
// HTTP Verb
property : /^\b(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/ ,
// Path or query argument
'attr-name' : /:\w+/
}
} ,
'response-status' : {
pattern : /^HTTP\/1.[01] [0-9]+.*/ ,
inside : {
// Status, e.g. 200 OK
property : /[0-9]+[A-Z\s-]+$/i
}
} ,
// HTTP header name
keyword : /^[\w-]+:(?=.+)/m
} ;
// Create a mapping of Content-Type headers to language definitions
var httpLanguages = {
'application/json' : Prism . languages . javascript ,
'application/xml' : Prism . languages . markup ,
'text/xml' : Prism . languages . markup ,
'text/html' : Prism . languages . markup
} ;
// Insert each content type parser that has its associated language
// currently loaded.
for ( var contentType in httpLanguages ) {
if ( httpLanguages [ contentType ] ) {
var options = { } ;
options [ contentType ] = {
pattern : new RegExp ( '(content-type:\\s*' + contentType + '[\\w\\W]*?)\\n\\n[\\w\\W]*' , 'i' ) ,
lookbehind : true ,
inside : {
rest : httpLanguages [ contentType ]
}
} ;
Prism . languages . insertBefore ( 'http' , 'keyword' , options ) ;
}
}
;
Prism . languages . ini = {
'comment' : /^\s*;.*$/m ,
'important' : /\[.*?\]/m ,
'constant' : /^\s*[^\s=]+?(?=[ \t]*=)/m ,
'attr-value' : {
pattern : /=.*/m ,
inside : {
'punctuation' : /^[=]/
}
}
} ; ;
( function ( Prism ) {
Prism . languages . jade = {
// Multiline stuff should appear before the rest
'multiline-comment' : {
pattern : /((?:^|\n)([\t ]*))\/\/.*(\n\2[\t ]+.+)*/ ,
lookbehind : true ,
alias : 'comment'
} ,
// All the tag-related part is in lookbehind
// so that it can be highlighted by the "tag" pattern
'multiline-script' : {
pattern : /((?:^|\n)([\t ]*)script\b.*\.[\t ]*)(\n(?:\2[\t ]+.+|\s*?(?=\n)))+/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . javascript
}
} ,
// See at the end of the file for known filters
'filter' : {
pattern : /((?:^|\n)([\t ]*)):.+(\n(?:\2[\t ]+.+|\s*?(?=\n)))+/ ,
lookbehind : true ,
inside : {
'filter-name' : {
pattern : /^:[\w-]+/ ,
alias : 'variable'
}
}
} ,
'multiline-plain-text' : {
pattern : /((?:^|\n)([\t ]*)[\w\-#.]+\.[\t ]*)(\n(?:\2[\t ]+.+|\s*?(?=\n)))+/ ,
lookbehind : true
} ,
'markup' : {
pattern : /((?:^|\n)[\t ]*)<.+/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . markup
}
} ,
'comment' : {
pattern : /((?:^|\n)[\t ]*)\/\/.+/ ,
lookbehind : true
} ,
'doctype' : {
pattern : /((?:^|\n)[\t ]*)doctype(?: .+)?/ ,
lookbehind : true
} ,
// This handle all conditional and loop keywords
'flow-control' : {
pattern : /((?:^|\n)[\t ]*)(?:if|unless|else|case|when|default|each|while)(?: .+)?/ ,
lookbehind : true ,
inside : {
'each' : {
pattern : /((?:^|\n)[\t ]*)each .+? in\b/ ,
lookbehind : true ,
inside : {
'keyword' : /\b(?:each|in)\b/ ,
'punctuation' : /,/
}
} ,
'branch' : {
pattern : /((?:^|\n)[\t ]*)(?:if|unless|else|case|when|default|while)/ ,
lookbehind : true ,
alias : 'keyword'
} ,
rest : Prism . languages . javascript
}
} ,
'keyword' : {
pattern : /((?:^|\n)[\t ]*)(?:block|extends|include|append|prepend)\b.+/ ,
lookbehind : true
} ,
'mixin' : [
// Declaration
{
pattern : /((?:^|\n)[\t ]*)mixin .+/ ,
lookbehind : true ,
inside : {
'keyword' : /^mixin/ ,
'function' : /\w+(?=\s*\(|\s*$)/ ,
'punctuation' : /[(),.]/
}
} ,
// Usage
{
pattern : /((?:^|\n)[\t ]*)\+.+/ ,
lookbehind : true ,
inside : {
'name' : {
pattern : /^\+\w+/ ,
alias : 'function'
} ,
'rest' : Prism . languages . javascript
}
}
] ,
'script' : {
pattern : /((?:^|\n)[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*) .+/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . javascript
}
} ,
'plain-text' : {
pattern : /((?:^|\n)[\t ]*(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?[\t ]+).+/ ,
lookbehind : true
} ,
'tag' : {
pattern : /((?:^|\n)[\t ]*)(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?:?/ ,
lookbehind : true ,
inside : {
'attributes' : [
{
pattern : /&[^(]+\([^)]+\)/ ,
inside : {
rest : Prism . languages . javascript
}
} ,
{
pattern : /\([^)]+\)/ ,
inside : {
'attr-value' : {
pattern : /(=\s*)(?:\{[^}]*\}|[^,)\n]+)/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . javascript
}
} ,
'attr-name' : /[\w-]+(?=\s*!?=|\s*[,)])/ ,
'punctuation' : /[!=(),]/
}
}
] ,
'punctuation' : /[:]/
}
} ,
'code' : [
{
pattern : /((?:^|\n)[\t ]*(?:-|!?=)).+/ ,
lookbehind : true ,
inside : {
rest : Prism . languages . javascript
}
}
] ,
'punctuation' : /[.\-!=|]/
} ;
var filter _pattern = '((?:^|\\n)([\\t ]*)):{{filter_name}}(\\n(?:\\2[\\t ]+.+|\\s*?(?=\\n)))+' ;
// Non exhaustive list of available filters and associated languages
var filters = [
{ filter : 'atpl' , language : 'twig' } ,
{ filter : 'coffee' , language : 'coffeescript' } ,
'ejs' ,
'handlebars' ,
'hogan' ,
'less' ,
'livescript' ,
'markdown' ,
'mustache' ,
'plates' ,
{ filter : 'sass' , language : 'scss' } ,
'stylus' ,
'swig'
] ;
var all _filters = { } ;
for ( var i = 0 , l = filters . length ; i < l ; i ++ ) {
var filter = filters [ i ] ;
filter = typeof filter === 'string' ? { filter : filter , language : filter } : filter ;
if ( Prism . languages [ filter . language ] ) {
all _filters [ 'filter-' + filter . filter ] = {
pattern : RegExp ( filter _pattern . replace ( '{{filter_name}}' , filter . filter ) ) ,
lookbehind : true ,
inside : {
'filter-name' : {
pattern : /^:[\w-]+/ ,
alias : 'variable'
} ,
rest : Prism . languages [ filter . language ]
}
}
}
}
Prism . languages . insertBefore ( 'jade' , 'filter' , all _filters ) ;
} ( Prism ) ) ; ;
Prism . languages . java = Prism . languages . extend ( 'clike' , {
'keyword' : /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/ ,
'number' : /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+[e]?[\d]*[df]\b|\b\d*\.?\d+\b/i ,
'operator' : {
pattern : /(^|[^\.])(?:\+=|\+\+?|-=|--?|!=?|<{1,2}=?|>{1,3}=?|==?|&=|&&?|\|=|\|\|?|\?|\*=?|\/=?|%=?|\^=?|:|~)/m ,
lookbehind : true
}
} ) ; ;
Prism . languages . julia = {
'comment' : {
pattern : /(^|[^\\])#.*?(\r?\n|$)/ ,
lookbehind : true
} ,
'string' : /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/ ,
'keyword' : /\b(abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|let|local|macro|module|print|println|quote|return|try|type|typealias|using|while)\b/ ,
'boolean' : /\b(true|false)\b/ ,
'number' : /\b-?(0[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i ,
'operator' : /[-+]{1,2}|=?<|=?>|!|={1,2}|&{1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/ ,
'punctuation' : /[{}[\];(),.:]/
} ; ;
Prism . languages . keyman = {
'comment' : /\bc\s.*/i ,
'function' : /\[\s*((CTRL|SHIFT|ALT|LCTRL|RCTRL|LALT|RALT|CAPS|NCAPS)\s+)*([TKU]_[a-z0-9_?]+|".+?"|'.+?')\s*\]/i , // virtual key
'string' : /("|')((?!\1).)*\1/ ,
'keyword' : /\b(any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|return|reset|save|set|store|use)\b/i , // rule keywords
'atrule' : /\b(ansi|begin|unicode|group|using keys|match|nomatch)\b/i , // structural keywords
'bold' : [ // header statements, system stores and variable system stores
/&(baselayout|bitmap|capsononly|capsalwaysoff|shiftfreescaps|copyright|ethnologuecode|hotkey|includecodes|keyboardversion|kmw_embedcss|kmw_embedjs|kmw_helpfile|kmw_helptext|kmw_rtl|language|layer|layoutfile|message|mnemoniclayout|name|oldcharposmatching|platform|targets|version|visualkeyboard|windowslanguages)\b/i ,
/\b(bitmap|bitmaps|caps on only|caps always off|shift frees caps|copyright|hotkey|language|layout|message|name|version)\b/i
] ,
'number' : /\b(U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i , // U+####, x###, d### characters and numbers
'operator' : /[+>\\,()]/ ,
'tag' : /\$(keyman|kmfl|weaver|keymanweb|keymanonly):/i // prefixes
} ; ;
Prism . languages . latex = {
'comment' : /%.*?(\r?\n|$)$/m ,
'string' : /(\$)(\\?.)*?\1/ ,
'punctuation' : /[{}]/ ,
'selector' : /\\[a-z;,:\.]*/i
} ; ;
/ * F I X M E :
: extend ( ) is not handled specifically : its highlighting is buggy .
Mixin usage must be inside a ruleset to be highlighted .
At - rules ( e . g . import ) containing interpolations are buggy .
Detached rulesets are highlighted as at - rules .
A comment before a mixin usage prevents the latter to be properly highlighted .
* /
Prism . languages . less = Prism . languages . extend ( 'css' , {
'comment' : [
/\/\*[\w\W]*?\*\// ,
{
pattern : /(^|[^\\])\/\/.*/ ,
lookbehind : true
}
] ,
'atrule' : {
pattern : /@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i ,
inside : {
'punctuation' : /[:()]/
}
} ,
// selectors and mixins are considered the same
'selector' : {
pattern : /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/ ,
inside : {
// mixin parameters
'variable' : /@+[\w-]+/
}
} ,
'property' : /(\b|\B)(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i ,
'punctuation' : /[{}();:,]/ ,
'operator' : /[+\-*\/]/
} ) ;
// Invert function and punctuation positions
Prism . languages . insertBefore ( 'less' , 'punctuation' , {
'function' : Prism . languages . less . function
} ) ;
Prism . languages . insertBefore ( 'less' , 'property' , {
'variable' : [
// Variable declaration (the colon must be consumed!)
{
pattern : /@[\w-]+\s*:/ ,
inside : {
"punctuation" : /:/
}
} ,
// Variable usage
/@@?[\w-]+/
] ,
'mixin-usage' : {
pattern : /([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/ ,
lookbehind : true ,
alias : 'function'
}
} ) ;
;
Prism . languages . lolcode = {
'comment' : [
/\bOBTW\s+[\s\S]*?\s+TLDR\b/ ,
/\bBTW.+/
] ,
'string' : {
pattern : /"(?::.|[^"])*"/ ,
inside : {
'variable' : /:\{[^}]+\}/ ,
'symbol' : [
/:\([a-f\d]+\)/i ,
/:\[[^\]]+\]/ ,
/:[)>o":]/
]
}
} ,
'number' : /(-|\b)\d*\.?\d+/ ,
'symbol' : {
pattern : /(^|\s)(?:A )?(?:YARN|NUMBR|NUMBAR|TROOF|BUKKIT|NOOB)(?=\s|,|$)/ ,
lookbehind : true ,
inside : {
'keyword' : /A(?=\s)/
}
} ,
'label' : {
pattern : /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/ ,
lookbehind : true ,
alias : 'string'
} ,
'function' : {
pattern : /((?:^|\s)(?:I IZ|HOW IZ I|IZ) )[a-zA-Z]\w*/ ,
lookbehind : true
} ,
'keyword' : [
{
pattern : /(^|\s)(?:O HAI IM|KTHX|HAI|KTHXBYE|I HAS A|ITZ(?: A)?|R|AN|MKAY|SMOOSH|MAEK|IS NOW(?: A)?|VISIBLE|GIMMEH|O RLY\?|YA RLY|NO WAI|OIC|MEBBE|WTF\?|OMG|OMGWTF|GTFO|IM IN YR|IM OUTTA YR|FOUND YR|YR|TIL|WILE|UPPIN|NERFIN|I IZ|HOW IZ I|IF U SAY SO|SRS|HAS A|LIEK(?: A)?|IZ)(?=\s|,|$)/ ,
lookbehind : true
} ,
/'Z(?=\s|,|$)/
] ,
'boolean' : {
pattern : /(^|\s)(?:WIN|FAIL)(?=\s|,|$)/ ,
lookbehind : true
} ,
'variable' : {
pattern : /(^|\s)(?:IT)(?=\s|,|$)/ ,
lookbehind : true
} ,
'operator' : {
pattern : /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:SUM|DIFF|PRODUKT|QUOSHUNT|MOD|BIGGR|SMALLR|BOTH|EITHER|WON|ALL|ANY) OF)(?=\s|,|$)/ ,
lookbehind : true
} ,
'punctuation' : /\.{3}|\u2026|,|!/
} ; ;
Prism . languages . makefile = {
'comment' : {
pattern : /(^|[^\\])#(?:\\[\s\S]|.)*/ ,
lookbehind : true
} ,
'string' : /(["'])(?:\\[\s\S]|(?!\1)[^\\\r\n])*\1/ ,
// Built-in target names
'builtin' : /\.[A-Z][^:#=\s]+(?=\s*:(?!=))/ ,
// Targets
'symbol' : {
pattern : /^[^:=\r\n]+(?=\s*:(?!=))/m ,
inside : {
'variable' : /\$+(?:[^(){}:#=\s]+|(?=[({]))/
}
} ,
'variable' : /\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/ ,
'keyword' : [
// Directives
/\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|-?include|override|private|sinclude|undefine|unexport|vpath)\b/ ,
// Functions
{
pattern : /(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/ ,
lookbehind : true
}
] ,
'operator' : /(?:::|[?:+!])?=|[|@]/ ,
'punctuation' : /[:;(){}]/
} ; ;
Prism . languages . markdown = Prism . languages . extend ( 'markup' , { } ) ;
Prism . languages . insertBefore ( 'markdown' , 'prolog' , {
'blockquote' : {
// > ...
pattern : /(^|\n)>(?:[\t ]*>)*/ ,
lookbehind : true ,
alias : 'punctuation'
} ,
'code' : [
{
// Prefixed by 4 spaces or 1 tab
pattern : /(^|\n)(?: {4}|\t).+/ ,
lookbehind : true ,
alias : 'keyword'
} ,
{
// `code`
// ``code``
pattern : /``.+?``|`[^`\n]+`/ ,
alias : 'keyword'
}
] ,
'title' : [
{
// title 1
// =======
// title 2
// -------
pattern : /\w+.*\n(?:==+|--+)/ ,
alias : 'important' ,
inside : {
punctuation : /==+$|--+$/
}
} ,
{
// # title 1
// ###### title 6
pattern : /((?:^|\n)\s*)#+.+/ ,
lookbehind : true ,
alias : 'important' ,
inside : {
punctuation : /^#+|#+$/
}
}
] ,
'hr' : {
// ***
// ---
// * * *
// -----------
pattern : /((?:^|\n)\s*)([*-])([\t ]*\2){2,}(?=\s*(?:\n|$))/ ,
lookbehind : true ,
alias : 'punctuation'
} ,
'list' : {
// * item
// + item
// - item
// 1. item
pattern : /((?:^|\n)\s*)(?:[*+-]|\d+\.)(?=[\t ].)/ ,
lookbehind : true ,
alias : 'punctuation'
} ,
'url-reference' : {
// [id]: http://example.com "Optional title"
// [id]: http://example.com 'Optional title'
// [id]: http://example.com (Optional title)
// [id]: <http://example.com> "Optional title"
pattern : /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:[^>]|\\>)+>)(?:[\t ]+(?:"(?:[^"]|\\")*"|'(?:[^']|\\')*'|\((?:[^)]|\\\))*\)))?/ ,
inside : {
'variable' : {
pattern : /^(!?\[)[^\]]+/ ,
lookbehind : true
} ,
'string' : /(?:"(?:[^"]|\\")*"|'(?:[^']|\\')*'|\((?:[^)]|\\\))*\))$/ ,
'punctuation' : /[[\]\(\)<>:]/
} ,
alias : 'url'
} ,
'bold' : {
// **strong**
// __strong__
// Allow only one line break
pattern : /(^|[^\\])(\*\*|__)(?:\n(?!\n)|.)+?\2/ ,
lookbehind : true ,
inside : {
'punctuation' : /^\*\*|^__|\*\*\s*$|__\s*$/
}
} ,
'italic' : {
// *em*
// _em_
// Allow only one line break
pattern : /(^|[^\\])(?:\*(?:\n(?!\n)|.)+?\*|_(?:\n(?!\n)|.)+?_)/ ,
lookbehind : true ,
inside : {
'punctuation' : /^[*_]|[*_]$/
}
} ,
'url' : {
// [example](http://example.com "Optional title")
// [example] [id]
pattern : /!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:[^"]|\\")*")?\)| ?\[[^\]\n]*\])/ ,
inside : {
'variable' : {
pattern : /(!?\[)[^\]]+(?=\]$)/ ,
lookbehind : true
} ,
'string' : {
pattern : /"(?:[^"]|\\")*"(?=\)$)/
}
}
}
} ) ;
Prism . languages . markdown [ 'bold' ] . inside [ 'url' ] = Prism . util . clone ( Prism . languages . markdown [ 'url' ] ) ;
Prism . languages . markdown [ 'italic' ] . inside [ 'url' ] = Prism . util . clone ( Prism . languages . markdown [ 'url' ] ) ;
Prism . languages . markdown [ 'bold' ] . inside [ 'italic' ] = Prism . util . clone ( Prism . languages . markdown [ 'italic' ] ) ;
Prism . languages . markdown [ 'italic' ] . inside [ 'bold' ] = Prism . util . clone ( Prism . languages . markdown [ 'bold' ] ) ; ;
Prism . languages . matlab = {
// We put string before comment, because of printf() patterns that contain "%"
'string' : {
pattern : /(^|\W)'(?:''|[^'\n])*'/ ,
lookbehind : true
} ,
'comment' : [
/%\{[\s\S]*?\}%/ ,
/%.+/
] ,
// FIXME We could handle imaginary numbers as a whole
'number' : /\b-?(?:\d*\.?\d+(?:[eE][+-]?\d+)?(?:[ij])?|[ij])\b/ ,
'keyword' : /\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/ ,
'function' : /(?!\d)\w+(?=\s*\()/ ,
'operator' : /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/ ,
'punctuation' : /\.{3}|[.,;\[\](){}!]/
} ; ;
Prism . languages . nasm = {
'comment' : /;.*$/m ,
'string' : /("|'|`)(\\?.)*?\1/m ,
'label' : {
pattern : /^\s*[A-Za-z\._\?\$][\w\.\?\$@~#]*:/m ,
alias : 'function'
} ,
'keyword' : [
/\[?BITS (16|32|64)\]?/m ,
/^\s*section\s*[a-zA-Z\.]+:?/im ,
/(?:extern|global)[^;]*/im ,
/(?:CPU|FLOAT|DEFAULT).*$/m
] ,
'register' : {
pattern : /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(bp|sp|si|di)|[cdefgs]s)\b/i ,
alias : 'variable'
} ,
'number' : /(\b|-|(?=\$))(0[hx][\da-f]*\.?[\da-f]+(p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(\.?e[+-]?\d+)?[dt]?)\b/i ,
'operator' : /[\[\]\*+\-\/%<>=&|\$!]/m
} ;
;
/ * *
* Original by Jan T . Sott ( http : //github.com/idleberg)
*
* Includes all commands and plug - ins shipped with NSIS 3.0 a2
* /
Prism . languages . nsis = {
'comment' : {
pattern : /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(#|;).*?(\r?\n|$))/ ,
lookbehind : true
} ,
'string' : /("|')(\\?.)*?\1/ ,
'keyword' : /\b(Abort|Add(BrandingImage|Size)|AdvSplash|Allow(RootDirInstall|SkipFiles)|AutoCloseWindow|Banner|BG(Font|Gradient|Image)|BrandingText|BringToFront|Call(\b|InstDLL)|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|Create(Directory|Font|ShortCut)|Delete(\b|INISec|INIStr|RegKey|RegValue)|Detail(Print|sButtonText)|Dialer|Dir(Text|Var|Verify)|EnableWindow|Enum(RegKey|RegValue)|Exch|Exec(\b|Shell|Wait)|ExpandEnvStrings|File(\b|BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|WriteUTF16LE|Seek|Write|WriteByte|WriteWord)|Find(Close|First|Next|Window)|FlushINI|Get(CurInstType|CurrentAddress|DlgItem|DLLVersion|DLLVersionLocal|ErrorLevel|FileTime|FileTimeLocal|FullPathName|Function(\b|Address|End)|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|Install(ButtonText|Colors|Dir|DirRegKey)|InstProgressFlags|Inst(Type|TypeGetText|TypeSetText)|Int(Cmp|CmpU|Fmt|Op)|IsWindow|Lang(DLL|String)|License(BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(Set|Text)|Manifest(DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|Name|Nop|ns(Dialogs|Exec)|NSISdl|OutFile|Page(\b|Callbacks)|Pop|Push|Quit|Read(EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|Section(\b|End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)|SendMessage|Set(AutoClose|BrandingImage|Compress|Compressor|CompressorDictSize|CtlColors|CurInstType|DatablockOptimize|DateSave|DetailsPrint|DetailsView|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(InstDetails|UninstDetails|Window)|Silent(Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(Cmp|CmpS|Cpy|Len)|SubCaption|System|Unicode|Uninstall(ButtonText|Caption|Icon|SubCaption|Text)|UninstPage|UnRegDLL|UserInfo|Var|VI(AddVersionKey|FileVersion|ProductVersion)|VPatch|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|Write(RegStr|Uninstaller)|XPStyle)\b/ ,
'property' : /\b(admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user|ARCHIVE|FILE_(ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(CR|CU|DD|LM|PD|U)|HKEY_(CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)\b/ ,
'variable' : /(\$(\(|\{)?[-_\w]+)(\)|\})?/i ,
'number' : /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/ ,
'operator' : /[-+]{1,2}|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/ ,
'punctuation' : /[{}[\];(),.:]/ ,
'important' : /!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversionsystem|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|searchparse|searchreplace|tempfile|undef|verbose|warning)\b/i
} ;
;
Prism . languages . objectivec = Prism . languages . extend ( 'c' , {
'keyword' : /(\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b)|((?=[\w|@])(@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b)/ ,
'string' : /(?:("|')([^\n\\\1]|\\.|\\\r*\n)*?\1)|(@"([^\n\\"]|\\.|\\\r*\n)*?")/ ,
'operator' : /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|@/
} ) ;
;
// Based on Free Pascal
/ * T O D O
Support inline asm ?
* /
Prism . languages . pascal = {
'comment' : [
/\(\*[\s\S]+?\*\)/ ,
/\{[\s\S]+?\}/ ,
/\/\/.*/
] ,
'string' : [
/(?:'(?:''|[^'\n])*'|#[&$%]?[a-f\d]+)+/i ,
// Char
/\^[a-z]/i
] ,
'keyword' : [
{
// Turbo Pascal
pattern : /(^|(?!&)[\s\S])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i ,
lookbehind : true
} ,
{
// Free Pascal
pattern : /(^|(?!&)[\s\S])\b(?:dispose|exit|false|new|true)\b/i ,
lookbehind : true
} ,
{
// Object Pascal
pattern : /(^|(?!&)[\s\S])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i ,
lookbehind : true
} ,
{
// Modifiers
pattern : /(^|(?!&)[\s\S])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i ,
lookbehind : true
}
] ,
'number' : [
// Hexadecimal, octal and binary
/[+-]?(?:[&%]\d+|\$[a-f\d]+)/i ,
// Decimal
/([+-]|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?/i
] ,
'operator' : [
/\.\.|\*\*|:=|[<>]{2}|[<>+\-*\/]=?|[@^=]/i ,
{
pattern : /(^|(?!&)[\s\S])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/ ,
lookbehind : true
}
] ,
'punctuation' : /\(\.|\.\)|[()\[\]:;,.]/
} ; ;
Prism . languages . perl = {
'comment' : [
{
// POD
pattern : /((?:^|\n)\s*)=\w+[\s\S]*?=cut.*/ ,
lookbehind : true
} ,
{
pattern : /(^|[^\\$])#.*?(\r?\n|$)/ ,
lookbehind : true
}
] ,
// TODO Could be nice to handle Heredoc too.
'string' : [
// q/.../
/\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1/ ,
// q a...a
/\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(\\?.)*?\s*\1/ ,
// q(...)
/\b(?:q|qq|qx|qw)\s*\(([^()]|\\.)*\s*\)/ ,
// q{...}
/\b(?:q|qq|qx|qw)\s*\{([^{}]|\\.)*\s*\}/ ,
// q[...]
/\b(?:q|qq|qx|qw)\s*\[([^[\]]|\\.)*\s*\]/ ,
// q<...>
/\b(?:q|qq|qx|qw)\s*<([^<>]|\\.)*\s*>/ ,
// "...", '...', `...`
/("|'|`)(\\?.)*?\1/
] ,
'regex' : [
// m/.../
/\b(?:m|qr)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1[msixpodualgc]*/ ,
// m a...a
/\b(?:m|qr)\s+([a-zA-Z0-9])(\\?.)*?\s*\1[msixpodualgc]*/ ,
// m(...)
/\b(?:m|qr)\s*\(([^()]|\\.)*\s*\)[msixpodualgc]*/ ,
// m{...}
/\b(?:m|qr)\s*\{([^{}]|\\.)*\s*\}[msixpodualgc]*/ ,
// m[...]
/\b(?:m|qr)\s*\[([^[\]]|\\.)*\s*\][msixpodualgc]*/ ,
// m<...>
/\b(?:m|qr)\s*<([^<>]|\\.)*\s*>[msixpodualgc]*/ ,
// s/.../.../
/\b(?:s|tr|y)\s*([^a-zA-Z0-9\s\{\(\[<])(\\?.)*?\s*\1\s*((?!\1).|\\.)*\s*\1[msixpodualgcer]*/ ,
// s a...a...a
/\b(?:s|tr|y)\s+([a-zA-Z0-9])(\\?.)*?\s*\1\s*((?!\1).|\\.)*\s*\1[msixpodualgcer]*/ ,
// s(...)(...)
/\b(?:s|tr|y)\s*\(([^()]|\\.)*\s*\)\s*\(\s*([^()]|\\.)*\s*\)[msixpodualgcer]*/ ,
// s{...}{...}
/\b(?:s|tr|y)\s*\{([^{}]|\\.)*\s*\}\s*\{\s*([^{}]|\\.)*\s*\}[msixpodualgcer]*/ ,
// s[...][...]
/\b(?:s|tr|y)\s*\[([^[\]]|\\.)*\s*\]\s*\[\s*([^[\]]|\\.)*\s*\][msixpodualgcer]*/ ,
// s<...><...>
/\b(?:s|tr|y)\s*<([^<>]|\\.)*\s*>\s*<\s*([^<>]|\\.)*\s*>[msixpodualgcer]*/ ,
// /.../
/\/(\[.+?]|\\.|[^\/\r\n])*\/[msixpodualgc]*(?=\s*($|[\r\n,.;})&|\-+*=~<>!?^]|(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/
] ,
// FIXME Not sure about the handling of ::, ', and #
'variable' : [
// ${^POSTMATCH}
/[&*\$@%]\{\^[A-Z]+\}/ ,
// $^V
/[&*\$@%]\^[A-Z_]/ ,
// ${...}
/[&*\$@%]#?(?=\{)/ ,
// $foo
/[&*\$@%]#?((::)*'?(?!\d)[\w$]+)+(::)*/i ,
// $1
/[&*\$@%]\d+/ ,
// $_, @_, %!
/[\$@%][!"#\$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/
] ,
'filehandle' : {
// <>, <FOO>, _
pattern : /<(?!=).*>|\b_\b/ ,
alias : 'symbol'
} ,
'vstring' : {
// v1.2, 1.2.3
pattern : /v\d+(\.\d+)*|\d+(\.\d+){2,}/ ,
alias : 'string'
} ,
'function' : {
pattern : /sub [a-z0-9_]+/i ,
inside : {
keyword : /sub/
}
} ,
'keyword' : /\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|say|state|sub|switch|undef|unless|until|use|when|while)\b/ ,
'number' : /(\n|\b)-?(0x[\dA-Fa-f](_?[\dA-Fa-f])*|0b[01](_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee]-?\d+)?)\b/ ,
'operator' : /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|[-+*=~\/|&]{1,2}|<=?|>=?|\.{1,3}|[!?\\^]|\b(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b/ ,
'punctuation' : /[{}[\];(),:]/
} ;
;
/ * *
* Original by Aaron Harun : http : //aahacreative.com/2012/07/31/php-syntax-highlighting-prism/
* Modified by Miles Johnson : http : //milesj.me
*
* Supports the following :
* - Extends clike syntax
* - Support for PHP 5.3 + ( namespaces , traits , generators , etc )
* - Smarter constant and function matching
*
* Adds the following new token classes :
* constant , delimiter , variable , function , package
* /
Prism . languages . php = Prism . languages . extend ( 'clike' , {
'keyword' : /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i ,
'constant' : /\b[A-Z0-9_]{2,}\b/ ,
'comment' : {
pattern : /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/).*?(\r?\n|$))/ ,
lookbehind : true
}
} ) ;
// Shell-like comments are matched after strings, because they are less
// common than strings containing hashes...
Prism . languages . insertBefore ( 'php' , 'class-name' , {
'shell-comment' : {
pattern : /(^|[^\\])#.*?(\r?\n|$)/ ,
lookbehind : true ,
alias : 'comment'
}
} ) ;
Prism . languages . insertBefore ( 'php' , 'keyword' , {
'delimiter' : /(\?>|<\?php|<\?)/i ,
'variable' : /(\$\w+)\b/i ,
'package' : {
pattern : /(\\|namespace\s+|use\s+)[\w\\]+/ ,
lookbehind : true ,
inside : {
punctuation : /\\/
}
}
} ) ;
// Must be defined after the function pattern
Prism . languages . insertBefore ( 'php' , 'operator' , {
'property' : {
pattern : /(->)[\w]+/ ,
lookbehind : true
}
} ) ;
// Add HTML support of the markup language exists
if ( Prism . languages . markup ) {
// Tokenize all inline PHP blocks that are wrapped in <?php ?>
// This allows for easy PHP + markup highlighting
Prism . hooks . add ( 'before-highlight' , function ( env ) {
if ( env . language !== 'php' ) {
return ;
}
env . tokenStack = [ ] ;
env . backupCode = env . code ;
env . code = env . code . replace ( /(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig , function ( match ) {
env . tokenStack . push ( match ) ;
return '{{{PHP' + env . tokenStack . length + '}}}' ;
} ) ;
} ) ;
// Restore env.code for other plugins (e.g. line-numbers)
Prism . hooks . add ( 'before-insert' , function ( env ) {
if ( env . language === 'php' ) {
env . code = env . backupCode ;
delete env . backupCode ;
}
} ) ;
// Re-insert the tokens after highlighting
Prism . hooks . add ( 'after-highlight' , function ( env ) {
if ( env . language !== 'php' ) {
return ;
}
for ( var i = 0 , t ; t = env . tokenStack [ i ] ; i ++ ) {
env . highlightedCode = env . highlightedCode . replace ( '{{{PHP' + ( i + 1 ) + '}}}' , Prism . highlight ( t , env . grammar , 'php' ) ) ;
}
env . element . innerHTML = env . highlightedCode ;
} ) ;
// Wrap tokens in classes that are missing them
Prism . hooks . add ( 'wrap' , function ( env ) {
if ( env . language === 'php' && env . type === 'markup' ) {
env . content = env . content . replace ( /(\{\{\{PHP[0-9]+\}\}\})/g , "<span class=\"token php\">$1</span>" ) ;
}
} ) ;
// Add the rules before all others
Prism . languages . insertBefore ( 'php' , 'comment' , {
'markup' : {
pattern : /<[^?]\/?(.*?)>/ ,
inside : Prism . languages . markup
} ,
'php' : /\{\{\{PHP[0-9]+\}\}\}/
} ) ;
}
;
Prism . languages . insertBefore ( 'php' , 'variable' , {
'this' : /\$this/ ,
'global' : /\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/ ,
'scope' : {
pattern : /\b[\w\\]+::/ ,
inside : {
keyword : /(static|self|parent)/ ,
punctuation : /(::|\\)/
}
}
} ) ; ;
Prism . languages . powershell = {
'comment' : [
{
pattern : /(^|[^`])<#[\w\W]*?#>/ ,
lookbehind : true
} ,
{
pattern : /(^|[^`])#.*?(\r?\n|$)/ ,
lookbehind : true
}
] ,
'string' : {
pattern : /("|')(`?[\w\W])*?\1/m ,
inside : { }
} ,
// Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
'namespace' : /\[[a-z][\w\W]*?\]/i ,
'boolean' : /\$(true|false)\b/i ,
'variable' : /\$\w+\b/i ,
// per http://technet.microsoft.com/en-us/library/hh847744.aspx
'keyword' : /\b(Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|In|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i ,
// Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example
// Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" }
// Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" }
'function' : /\b(Add-(Computer|Content|History|Member|PSSnapin|Type)|Checkpoint-(Computer|Content|EventLog|History|Item|ItemProperty|Variable)|Compare-(Object)|Complete-(Transaction)|Connect-(PSSession)|ConvertFrom-(Csv|Json|StringData)|Convert-(Path)|ConvertTo-(Csv|Html|Json|Xml)|Copy-(Item|ItemProperty)|Debug-(Process)|Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Disconnect-(PSSession)|Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Enter-(PSSession)|Exit-(PSSession)|Export-(Alias|Clixml|Console|Csv|FormatData|ModuleMember|PSSession)|ForEach-(Object)|Format-(Custom|List|Table|Wide)|Get-(Alias|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Culture|Date|Event|EventLog|EventSubscriber|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|WmiObject)|Group-(Object)|Import-(Alias|Clixml|Csv|LocalizedData|Module|PSSession)|Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)|Join-(Path)|Limit-(EventLog)|Measure-(Command)|Measure-(Object)|Move-(Item|ItemProperty)|New-(Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy)|Out-(Default|File|GridView|Host|Null|Printer|String)|Pop-(Location)|Push-(Location)|Read-(Host)|Receive-(Job)|Receive-(PSSession)|Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Remove-(Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)|Rename-(Computer|Item|ItemProperty)|Reset-(ComputerMachinePassword)|Resolve-(Path)|Restart-(Computer|Service)|Restore-(Computer)|Resume-(Job|Service)|Save-(Help)|Select-(Object|String|Xml)|Send-(MailMessage)|Set-(Alias|Content|Date|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)|Show-(Command|ControlPanelItem|EventLog)|Sort-(Object)|Split-(Path)|Start-(Job|Process|Service|Sleep|Transaction)|Stop-(Computer|Job|Process|Service)|Suspend-(Job|Service)|Tee-(Object)|Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)|Trace-(Command)|Unblock-(File)|Undo-(Transaction)|Unregister-(Event|PSSessionConfiguration)|Update-(FormatData)|Update-(Help|List|TypeData)|Use-(Transaction)|Wait-(Event|Job|Process)|Where-(Object)|Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)|ac|cat|cd|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i ,
'operator' : {
pattern : /(\W)-(and|x?or|not|eq|ne|gt|ge|lt|le|Like|(Not)?(Like|Match|Contains|In)|Replace)\b/i ,
lookbehind : true
} ,
'punctuation' : /[|{}[\];(),.]/
} ;
// Variable interpolation inside strings
Prism . languages . powershell . string . inside . boolean = Prism . languages . powershell . boolean ;
Prism . languages . powershell . string . inside . variable = Prism . languages . powershell . variable ; ;
Prism . languages . python = {
'comment' : {
pattern : /(^|[^\\])#.*?(\r?\n|$)/ ,
lookbehind : true
} ,
'string' : /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/ ,
'function' : {
pattern : /((^|\s)def[ \t]+)([a-zA-Z_][a-zA-Z0-9_]*(?=\())/g ,
lookbehind : true
} ,
'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/ ,
'boolean' : /\b(True|False)\b/ ,
'number' : /\b-?(0[bo])?(?:(\d|0x[a-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i ,
'operator' : /[-+]|<=?|>=?|!|={1,2}|&{1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/ ,
'punctuation' : /[{}[\];(),.:]/
} ; ;
Prism . languages . r = {
'comment' : /#.+/ ,
'string' : /(['"])(?:\\?.)*?\1/ ,
'percent-operator' : {
// Includes user-defined operators
// and %%, %*%, %/%, %in%, %o%, %x%
pattern : /%[^%]*?%/ ,
alias : 'operator'
} ,
'boolean' : /\b(?:TRUE|FALSE)\b/ ,
'ellipsis' : /\.\.(?:\.|\d+)/ ,
'number' : [
/\b(?:NaN|Inf)\b/ ,
/\b(?:0x[\dA-Fa-f]+(?:\.\d*)?|\d*\.?\d+)(?:[EePp][+-]??\d+)?[iL]?\b/
] ,
'keyword' : /\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/ ,
'operator' : /->>?|<?<-|[<>!=]=?|::?|&&?|\|\|?|[+\-*\/^$@~]/ ,
'punctuation' : /[(){}\[\],;]/
} ; ;
( function ( Prism ) {
var javascript = Prism . util . clone ( Prism . languages . javascript ) ;
Prism . languages . jsx = Prism . languages . extend ( 'markup' , javascript ) ;
Prism . languages . jsx . tag . pattern = /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?\s*)*\/?>/i ;
Prism . languages . jsx . tag . inside [ 'attr-value' ] . pattern = /=[^\{](?:('|")[\w\W]*?(\1)|[^\s>]+)/i ;
Prism . languages . insertBefore ( 'inside' , 'attr-value' , {
'script' : {
pattern : /=(\{[\w\W]*?\})/i ,
inside : {
'function' : Prism . languages . javascript . function ,
'punctuation' : /[={}[\];(),.:]/ ,
'keyword' : Prism . languages . javascript . keyword
} ,
'alias' : 'language-javascript'
}
} , Prism . languages . jsx . tag ) ;
} ( Prism ) ) ;
;
Prism . languages . rest = {
'table' : [
{
pattern : /(\s*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1(?:[+|].+)+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/ ,
lookbehind : true ,
inside : {
'punctuation' : /\||(?:\+[=-]+)+\+/
}
} ,
{
pattern : /(\s*)(?:=+ +)+=+((?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1(?:=+ +)+=+(?=(?:\r?\n|\r){2}|\s*$)/ ,
lookbehind : true ,
inside : {
'punctuation' : /[=-]+/
}
}
] ,
// Directive-like patterns
'substitution-def' : {
pattern : /(^\s*\.\. )\|(?:[^|\s]|[^|\s][^|]*[^|\s])\| [^:]+::/m ,
lookbehind : true ,
inside : {
'substitution' : {
pattern : /^\|(?:[^|\s]|[^|\s][^|]*[^|\s])\|/ ,
alias : 'attr-value' ,
inside : {
'punctuation' : /^\||\|$/
}
} ,
'directive' : {
pattern : /( )[^:]+::/ ,
lookbehind : true ,
alias : 'function' ,
inside : {
'punctuation' : /::$/
}
}
}
} ,
'link-target' : [
{
pattern : /(^\s*\.\. )\[[^\]]+\]/m ,
lookbehind : true ,
alias : 'string' ,
inside : {
'punctuation' : /^\[|\]$/
}
} ,
{
pattern : /(^\s*\.\. )_(?:`[^`]+`|(?:\\:|[^:])+):/m ,
lookbehind : true ,
alias : 'string' ,
inside : {
'punctuation' : /^_|:$/
}
}
] ,
'directive' : {
pattern : /(^\s*\.\. )[^:]+::/m ,
lookbehind : true ,
alias : 'function' ,
inside : {
'punctuation' : /::$/
}
} ,
'comment' : {
pattern : /(^\s*\.\.\s).*(?:(?:\r?\n|\r).*)*?(?=(?:\r?\n|\r){2}|$)/m ,
lookbehind : true
} ,
'title' : [
// Overlined and underlined
{
pattern : /^([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]{2,})(?:\r?\n|\r).+(?:\r?\n|\r)\1$/m ,
inside : {
'punctuation' : /^[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/ ,
'important' : /.+/
}
} ,
// Underlined only
{
pattern : /(^|(?:\r?\n|\r){2}).+(?:\r?\n|\r)[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]{2,}(?=\r?\n|\r|$)/ ,
lookbehind : true ,
inside : {
'punctuation' : /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/ ,
'important' : /.+/
}
}
] ,
'hr' : {
pattern : /((?:\r?\n|\r){2})[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]{4,}(?=(?:\r?\n|\r){2})/ ,
lookbehind : true ,
alias : 'punctuation'
} ,
'list-bullet' : {
pattern : /(^\s*)(?:[*+\-•‣⁃]|\(?(?:\d+|[a-z]|[ivxdclm]+)\)|(?:\d+|[a-z]|[ivxdclm]+)\.)(?= )/im ,
lookbehind : true ,
alias : 'punctuation'
} ,
'field' : {
pattern : /(^\s*):[^:]+:(?= )/m ,
lookbehind : true ,
alias : 'attr-name'
} ,
'command-line-option' : {
pattern : /(^\s*)(?:[+-][a-z\d]|(?:\-\-|\/)[a-z\d-]+)(?:[ =](?:[a-z][a-z\d_-]*|<[^<>]+>))?(?:, (?:[+-][a-z\d]|(?:\-\-|\/)[a-z\d-]+)(?:[ =](?:[a-z][a-z\d_-]*|<[^<>]+>))?)*(?=(?:\r?\n|\r)? {2,}[\S])/im ,
lookbehind : true ,
alias : 'symbol'
} ,
'literal-block' : {
pattern : /::(?:\r?\n|\r){2}([ \t]+).+(?:(?:\r?\n|\r)\1.+)*/ ,
inside : {
'literal-block-punctuation' : {
pattern : /^::/ ,
alias : 'punctuation'
}
}
} ,
'quoted-literal-block' : {
pattern : /::(?:\r?\n|\r){2}([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]).*(?:(?:\r?\n|\r)\1.*)*/ ,
inside : {
'literal-block-punctuation' : {
pattern : /^(?:::|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])/m ,
alias : 'punctuation'
}
}
} ,
'doctest-block' : {
pattern : /(^\s*)>>> .+(?:(?:\r?\n|\r).+)*/m ,
lookbehind : true ,
inside : {
'punctuation' : /^>>>/
}
} ,
'inline' : [
{
pattern : /(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s).*?[^\s]\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m ,
lookbehind : true ,
inside : {
'bold' : {
pattern : /(^\*\*).+(?=\*\*$)/ ,
lookbehind : true
} ,
'italic' : {
pattern : /(^\*).+(?=\*$)/ ,
lookbehind : true
} ,
'inline-literal' : {
pattern : /(^``).+(?=``$)/ ,
lookbehind : true ,
alias : 'symbol'
} ,
'role' : {
pattern : /^:[^:]+:|:[^:]+:$/ ,
alias : 'function' ,
inside : {
'punctuation' : /^:|:$/
}
} ,
'interpreted-text' : {
pattern : /(^`).+(?=`$)/ ,
lookbehind : true ,
alias : 'attr-value'
} ,
'substitution' : {
pattern : /(^\|).+(?=\|$)/ ,
lookbehind : true ,
alias : 'attr-value'
} ,
'punctuation' : /\*\*?|``?|\|/
}
}
] ,
'link' : [
{
pattern : /\[[^\]]+\]_(?=[\s\-.,:;!?\\\/'")\]}]|$)/ ,
alias : 'string' ,
inside : {
'punctuation' : /^\[|\]_$/
}
} ,
{
pattern : /(?:\b[a-z\d](?:[_.:+]?[a-z\d]+)?_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i ,
alias : 'string' ,
inside : {
'punctuation' : /^_?`|`?_?_$/
}
}
] ,
// Line block start,
// quote attribution,
// explicit markup start,
// and anonymous hyperlink target shortcut (__)
'punctuation' : {
pattern : /(^\s*)(?:\|(?= |$)|(?:---?|—|\.\.|__)(?= )|\.\.$)/m ,
lookbehind : true
}
} ; ;
Prism . languages . rip = {
'comment' : /#[^\r\n]*(\r?\n|$)/ ,
'keyword' : /(?:=>|->)|\b(?:class|if|else|switch|case|return|exit|try|catch|finally|raise)\b/ ,
'builtin' : /\b(@|System)\b/ ,
'boolean' : /\b(true|false)\b/ ,
'date' : /\b\d{4}-\d{2}-\d{2}\b/ ,
'time' : /\b\d{2}:\d{2}:\d{2}\b/ ,
'datetime' : /\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/ ,
'number' : /[+-]?(?:(?:\d+\.\d+)|(?:\d+))/ ,
'character' : /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/ ,
'regex' : {
pattern : /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/(?=\s*($|[\r\n,.;})]))/ ,
lookbehind : true
} ,
'symbol' : /:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/ ,
'string' : /("|')(\\?.)*?\1/ ,
'punctuation' : /(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/ ,
'reference' : /[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/
} ;
;
/ * *
* Original by Samuel Flores
*
* Adds the following new token classes :
* constant , builtin , variable , symbol , regex
* /
Prism . languages . ruby = Prism . languages . extend ( 'clike' , {
'comment' : /#(?!\{[^\r\n]*?\})[^\r\n]*(\r?\n|$)/ ,
'keyword' : /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/ ,
'builtin' : /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/ ,
'constant' : /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/
} ) ;
Prism . languages . insertBefore ( 'ruby' , 'keyword' , {
'regex' : {
pattern : /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/ ,
lookbehind : true
} ,
'variable' : /[@$]+\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/ ,
'symbol' : /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/
} ) ;
Prism . languages . ruby . string = {
pattern : /("|')(#\{[^}]+\}|\\\n|\\?.)*?\1/ ,
inside : {
'interpolation' : {
pattern : /#\{[^}]+\}/ ,
inside : {
'delimiter' : {
pattern : /^#\{|\}$/ ,
alias : 'tag'
} ,
rest : Prism . util . clone ( Prism . languages . ruby )
}
}
}
} ;
;
/ * T O D O
Add support for Markdown notation inside doc comments
Add support for nested block comments ...
Match closure params even when not followed by dash or brace
Add better support for macro definition
* /
Prism . languages . rust = {
'comment' : [
{
pattern : /(^|[^\\])\/\*[\w\W]*?\*\// ,
lookbehind : true
} ,
{
pattern : /(^|[^\\:])\/\/.*?(\r?\n|$)/ ,
lookbehind : true
}
] ,
'string' : [
/b?r(#*)"(?:\\?.)*?"\1/ ,
/b?("|')(?:\\?.)*?\1/
] ,
'keyword' : /\b(?:abstract|alignof|as|be|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|offsetof|once|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/ ,
'attribute' : {
pattern : /#!?\[.+?\]/ ,
alias : 'attr-name'
} ,
'function' : [
/[a-z0-9_]+(?=\s*\()/i ,
// Macros can use parens or brackets
/[a-z0-9_]+!(?=\s*\(|\[)/i
] ,
'macro-rules' : {
pattern : /[a-z0-9_]+!/i ,
alias : 'function'
} ,
// Hex, oct, bin, dec numbers with visual separators and type suffix
'number' : /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32)?|f32|f64))?\b/ ,
// Closure params should not be confused with bitwise OR |
'closure-params' : {
pattern : /\|[^|]*\|(?=\s*[{-])/ ,
inside : {
'punctuation' : /[\|:,]/ ,
'operator' : /[&*]/
}
} ,
'punctuation' : /[{}[\];(),.:]|->/ ,
'operator' : /[-+]{1,2}|!=?|<=?|>=?|={1,3}|&&?|\|\|?|\*|\/|\^|%|<<|>>@/
} ; ;
Prism . languages . sas = {
'datalines' : {
pattern : /(^|[\r\n])\s*(?:(?:data)?lines|cards);[\s\S]+?[\r\n];/i ,
lookbehind : true ,
inside : {
'keyword' : {
pattern : /^(\s*)(?:(?:data)?lines|cards)/i ,
lookbehind : true
} ,
'punctuation' : /;/ ,
'data' : {
pattern : /[\s\S]+/ ,
alias : 'string'
}
}
} ,
'comment' : [
{
pattern : /(^\s*|;\s*)\*.*;/m ,
lookbehind : true
} ,
/\/\*[\s\S]+?\*\//
] ,
'datetime' : {
// '1jan2013'd, '9:25:19pm't, '18jan2003:9:27:05am'dt
pattern : /'[^']+'(?:d|d?t)\b/i ,
alias : 'number'
} ,
'string' : /(["'])(?:\1\1|(?!\1)[\s\S])*\1/ ,
'keyword' : /\b(?:data|else|format|if|input|proc|run|then)\b/i ,
// Decimal (1.2e23), hexadecimal (0c1x)
'number' : /(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i ,
'operator' : /\*\*|\|\||!!|¦¦|<>|><|[~¬^<>]?=|[*\/+\-<>&\|!¦~¬^]|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i ,
'punctuation' : /[$%@.(){}\[\];,\\]/
} ; ;
( function ( Prism ) {
Prism . languages . sass = Prism . languages . extend ( 'css' , {
// Sass comments don't need to be closed, only indented
'comment' : /^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t]+.+)*/m
} ) ;
Prism . languages . insertBefore ( 'sass' , 'atrule' , {
// We want to consume the whole line
'atrule-line' : {
// Includes support for = and + shortcuts
pattern : /^(?:[ \t]*)[@+=].+/m ,
inside : {
'atrule' : /^(?:[ \t]*)(?:@[\w-]+|[+=])/m
}
}
} ) ;
delete Prism . languages . sass . atrule ;
var variable = /((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i ;
var operator = /[-+]{1,2}|==?|!=|\|?\||\?|\*|\/|%/ ;
Prism . languages . insertBefore ( 'sass' , 'property' , {
// We want to consume the whole line
'variable-line' : {
pattern : /(^|(?:\r?\n|\r))[ \t]*\$.+/ ,
lookbehind : true ,
inside : {
'punctuation' : /:/ ,
'variable' : variable ,
'operator' : operator
}
} ,
// We want to consume the whole line
'property-line' : {
pattern : /(^|(?:\r?\n|\r))[ \t]*(?:[^:\s]+[ ]*:.*|:[^:\s]+.*)/i ,
lookbehind : true ,
inside : {
'property' : [
/[^:\s]+(?=\s*:)/ ,
{
pattern : /(:)[^:\s]+/ ,
lookbehind : true
}
] ,
'punctuation' : /:/ ,
'variable' : variable ,
'operator' : operator ,
'important' : Prism . languages . sass . important
}
}
} ) ;
delete Prism . languages . sass . property ;
delete Prism . languages . sass . important ;
// Now that whole lines for other patterns are consumed,
// what's left should be selectors
delete Prism . languages . sass . selector ;
Prism . languages . insertBefore ( 'sass' , 'punctuation' , {
'selector' : {
pattern : /([ \t]*).+(?:,(?:\r?\n|\r)\1[ \t]+.+)*/ ,
lookbehind : true
}
} ) ;
} ( Prism ) ) ; ;
Prism . languages . scss = Prism . languages . extend ( 'css' , {
'comment' : {
pattern : /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/ ,
lookbehind : true
} ,
'atrule' : {
pattern : /@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+(\{|;))/i ,
inside : {
'rule' : /@[\w-]+/
// See rest below
}
} ,
// url, compassified
'url' : /([-a-z]+-)*url(?=\()/i ,
// CSS selector regex is not appropriate for Sass
// since there can be lot more things (var, @ directive, nesting..)
// a selector must start at the end of a property or after a brace (end of other rules or nesting)
// it can contain some caracters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable
// the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var
// can "pass" as a selector- e.g: proper#{$erty})
// this one was ard to do, so please be careful if you edit this one :)
'selector' : {
pattern : /([^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m ,
inside : {
'placeholder' : /%[-_\w]+/i
}
}
} ) ;
Prism . languages . insertBefore ( 'scss' , 'atrule' , {
'keyword' : /@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)|(?=@for\s+\$[-_\w]+\s)+from/i
} ) ;
Prism . languages . insertBefore ( 'scss' , 'property' , {
// var and interpolated vars
'variable' : /((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i
} ) ;
Prism . languages . insertBefore ( 'scss' , 'function' , {
'placeholder' : {
pattern : /%[-_\w]+/i ,
alias : 'selector'
} ,
'statement' : /\B!(default|optional)\b/i ,
'boolean' : /\b(true|false)\b/ ,
'null' : /\b(null)\b/ ,
'operator' : /\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|%)\s+/
} ) ;
Prism . languages . scss [ 'atrule' ] . inside . rest = Prism . util . clone ( Prism . languages . scss ) ; ;
Prism . languages . scala = Prism . languages . extend ( 'java' , {
'keyword' : /(<-|=>)|\b(abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/ ,
'builtin' : /\b(String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/ ,
'number' : /\b0x[\da-f]*\.?[\da-f\-]+\b|\b\d*\.?\d+[e]?[\d]*[dfl]?\b/i ,
'symbol' : /'([^\d\s]\w*)/ ,
'string' : /(""")[\W\w]*?\1|("|\/)[\W\w]*?\2|('.')/
} ) ;
delete Prism . languages . scala [ 'class-name' ] ;
delete Prism . languages . scala [ 'function' ] ;
;
Prism . languages . scheme = {
'boolean' : /#(t|f){1}/ ,
'comment' : /;.*/ ,
'keyword' : {
pattern : /([(])(define(-syntax|-library|-values)?|(case-)?lambda|let(-values|(rec)?(\*)?)?|else|if|cond|begin|delay|delay-force|parameterize|guard|set!|(quasi-)?quote|syntax-rules)/ ,
lookbehind : true
} ,
'builtin' : {
pattern : /([(])(cons|car|cdr|null\?|pair\?|boolean\?|eof-object\?|char\?|procedure\?|number\?|port\?|string\?|vector\?|symbol\?|bytevector\?|list|call-with-current-continuation|call\/cc|append|abs|apply|eval)\b/ ,
lookbehind : true
} ,
'string' : /(["])(?:(?=(\\?))\2.)*?\1|'[^('|\s)]+/ , //thanks http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks
'number' : /(\s|\))[-+]?[0-9]*\.?[0-9]+((\s*)[-+]{1}(\s*)[0-9]*\.?[0-9]+i)?/ ,
'operator' : /(\*|\+|\-|%|\/|<=|=>|>=|<|=|>)/ ,
'function' : {
pattern : /([(])[^(\s|\))]*\s/ ,
lookbehind : true
} ,
'punctuation' : /[()]/
} ;
;
Prism . languages . smalltalk = {
'comment' : /"(?:""|[^"])+"/ ,
'string' : /'(?:''|[^'])+'/ ,
'symbol' : /#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i ,
'block-arguments' : {
pattern : /(\[\s*)(?=:)[^\[|]+?\|/ ,
lookbehind : true ,
inside : {
'variable' : /:[\da-z]+/i ,
'punctuation' : /\|/
}
} ,
'temporary-variables' : {
pattern : /\|[^|]+\|/ ,
inside : {
'variable' : /[\da-z]+/i ,
'punctuation' : /\|/
}
} ,
'keyword' : /\b(?:nil|true|false|self|super|new)\b/ ,
'character' : {
pattern : /\$./ ,
alias : 'string'
} ,
'number' : [
/\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/ ,
/(?:\B-|\b)\d+(?:\.\d+)?(?:e-?\d+)?/
] ,
'operator' : /[:=~<>]=|~~|\/\/|\\\\|>>|[!^=<>+\-*\/&|,@]/ ,
'punctuation' : /[.;:?\[\](){}]/
} ; ;
/ * T O D O
Add support for variables inside double quoted strings
Add support for { php }
* /
( function ( Prism ) {
var smarty _pattern = /\{\*[\w\W]+?\*\}|\{[\w\W]+?\}/g ;
var smarty _litteral _start = '{literal}' ;
var smarty _litteral _end = '{/literal}' ;
var smarty _litteral _mode = false ;
Prism . languages . smarty = Prism . languages . extend ( 'markup' , {
'smarty' : {
pattern : smarty _pattern ,
inside : {
'delimiter' : {
pattern : /^\{|\}$/i ,
alias : 'punctuation'
} ,
'string' : /(["'])(\\?.)*?\1/ ,
'number' : /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/ ,
'variable' : [
/\$(?!\d)\w+/ ,
/#(?!\d)\w+#/ ,
{
pattern : /(\.|->)(?!\d)\w+/ ,
lookbehind : true
} ,
{
pattern : /(\[)(?!\d)\w+(?=\])/ ,
lookbehind : true
}
] ,
'function' : [
{
pattern : /(\|\s*)@?(?!\d)\w+/ ,
lookbehind : true
} ,
/^\/?(?!\d)\w+/ ,
/(?!\d)\w+(?=\()/
] ,
'attr-name' : {
// Value is made optional because it may have already been tokenized
pattern : /\w+\s*=\s*(?:(?!\d)\w+)?/ ,
inside : {
"variable" : {
pattern : /(=\s*)(?!\d)\w+/ ,
lookbehind : true
} ,
"punctuation" : /=/
}
} ,
'punctuation' : /[\[\]().,=\|:`]|\->/ ,
'operator' : [
/[+\-*\/%]|===?|[!<>]=?|&&|\|\|/ ,
/\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/ ,
/\b(?:eq|neq?|gt|lt|gt?e|lt?e|not|mod|or|and)\b/
] ,
'keyword' : /\b(?:false|off|on|no|true|yes)\b/
}
}
} ) ;
// Comments are inserted at top so that they can
// surround markup
Prism . languages . insertBefore ( 'smarty' , 'tag' , {
'smarty-comment' : {
pattern : /\{\*[\w\W]*?\*\}/ ,
alias : [ 'smarty' , 'comment' ]
}
} ) ;
// Tokenize all inline Smarty expressions
Prism . hooks . add ( 'before-highlight' , function ( env ) {
if ( env . language !== 'smarty' ) {
return ;
}
env . tokenStack = [ ] ;
env . backupCode = env . code ;
env . code = env . code . replace ( smarty _pattern , function ( match ) {
// Smarty tags inside {literal} block are ignored
if ( match === smarty _litteral _end ) {
smarty _litteral _mode = false ;
}
if ( ! smarty _litteral _mode ) {
if ( match === smarty _litteral _start ) {
smarty _litteral _mode = true ;
}
env . tokenStack . push ( match ) ;
return '___SMARTY' + env . tokenStack . length + '___' ;
}
return match ;
} ) ;
} ) ;
// Restore env.code for other plugins (e.g. line-numbers)
Prism . hooks . add ( 'before-insert' , function ( env ) {
if ( env . language === 'smarty' ) {
env . code = env . backupCode ;
delete env . backupCode ;
}
} ) ;
// Re-insert the tokens after highlighting
// and highlight them with defined grammar
Prism . hooks . add ( 'after-highlight' , function ( env ) {
if ( env . language !== 'smarty' ) {
return ;
}
for ( var i = 0 , t ; t = env . tokenStack [ i ] ; i ++ ) {
env . highlightedCode = env . highlightedCode . replace ( '___SMARTY' + ( i + 1 ) + '___' , Prism . highlight ( t , env . grammar , 'smarty' ) ) ;
}
env . element . innerHTML = env . highlightedCode ;
} ) ;
} ( Prism ) ) ; ;
Prism . languages . sql = {
'comment' : {
pattern : /(^|[^\\])(\/\*[\w\W]*?\*\/|((--)|(\/\/)|#).*?(\r?\n|$))/ ,
lookbehind : true
} ,
'string' : {
pattern : /(^|[^@])("|')(\\?[\s\S])*?\2/ ,
lookbehind : true
} ,
'variable' : /@[\w.$]+|@("|'|`)(\\?[\s\S])+?\1/ ,
'function' : /\b(?:COUNT|SUM|AVG|MIN|MAX|FIRST|LAST|UCASE|LCASE|MID|LEN|ROUND|NOW|FORMAT)(?=\s*\()/i , // Should we highlight user defined functions too?
'keyword' : /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALTER|ANALYZE|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADE|CASCADED|CASE|CHAIN|CHAR VARYING|CHARACTER VARYING|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLUMN|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATA|DATABASE|DATABASES|DATETIME|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DOUBLE PRECISION|DROP|DUMMY|DUMP|DUMPFILE|DUPLICATE KEY|ELSE|ENABLE|ENCLOSED BY|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPE|ESCAPED BY|EXCEPT|EXEC|EXECUTE|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR|FOR EACH ROW|FORCE|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GEOMETRY|GEOMETRYCOLLECTION|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|IDENTITY|IDENTITY_INSERT|IDENTITYCOL|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTO|INVOKER|ISOLATION LEVEL|JOIN|KEY|KEYS|KILL|LANGUAGE SQL|LAST|LEFT|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONGBLOB|LONGTEXT|MATCH|MATCHED|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MERGE|MIDDLEINT|MODIFIES SQL DATA|MODIFY|MULTILINESTRING|MULTIPOINT|MULTIPOLYGON|NATIONAL|NATIONAL CHAR VARYING|NATIONAL CHARACTER|NATIONAL CHARACTER VARYING|NATIONAL VARCHAR|NATURAL|NCHAR|NCHAR VARCHAR|NEXT|NO|NO SQL|NOCHECK|NOCYCLE|NONCLUSTERED|NULLIF|NUMERIC|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUT|OUTER|OUTFILE|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREV|PRIMARY|PRINT|PRIVILEGES|PROC|PROCEDURE|PUBLIC|PURGE|QUICK|RAISERROR|READ|READS SQL DATA|READTEXT|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEATABLE|REPLICATION|REQUIRE|RESTORE|RESTRICT|RETURN|RETURNS|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROWCOUNT|ROWGUIDCOL|ROWS?|RTREE|RULE|SAVE|SAVEPOINT|SCHEMA|SELECT|SERIAL|SERIALIZABLE|SESSION|SESSION_USER|SET|SETUSER|SHARE MODE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|START|STARTING BY|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLE|TABLES|TABLESPACE|TEMP(?:ORARY)?|TEMPTABLE|TERMINATED BY|TEXT|TEXTSIZE|THEN|TIMESTAMP|TINYBLOB|TINYINT|TINYTEXT|TO|TOP|TRAN|TRANSACTION|TRANSACTIONS|TRIGGER|TRUNCATE|TSEQUAL|TYPE|TYPES|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNPIVOT|UPDATE|UPDATETEXT|USAGE|USE|USER|USING|VALUE|VALUES|VARBINARY|VARCHAR|VARCHARACTER|VARYING|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH|WITH ROLLUP|WITHIN|WORK|WRITE|WRITETEXT)\b/i ,
'boolean' : /\b(?:TRUE|FALSE|NULL)\b/i ,
'number' : /\b-?(0x)?\d*\.?[\da-f]+\b/ ,
'operator' : /\b(?:ALL|AND|ANY|BETWEEN|EXISTS|IN|LIKE|NOT|OR|IS|UNIQUE|CHARACTER SET|COLLATE|DIV|OFFSET|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b|[-+]|!|[=<>]{1,2}|(&){1,2}|\|?\||\?|\*|\//i ,
'punctuation' : /[;[\]()`,.]/
} ; ;
Prism . languages . stylus = {
'comment' : {
pattern : /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g ,
lookbehind : true
} ,
'keyword' : /(px|r?em|ex|ch|vw|vh|vmin|vmax|deg|grad|rad|turn|m?s|k?Hz|dpi|dppx|dpcm)\b|\b(is|defined|not|isnt|and|or|unless|for|in)\b/g ,
'atrule' : /@[\w-]+(?=\s+\S+)/gi ,
'url' : /url\((["']?).*?\1\)/gi ,
'variable' : /^\s*([\w-]+)(?=\s*[+-\\]?=)/gm ,
'string' : /("|')(\\\n|\\?.)*?\1/g ,
'important' : /\B!important\b/gi ,
'hexcode' : /#[\da-f]{3,6}/gi ,
'entity' : /\\[\da-f]{1,8}/gi ,
'number' : /\d+\.?\d*%?/g ,
'selector' : [
{
pattern : /::?(after|before|first-letter|first-line|selection)/g ,
alias : 'pseudo-element'
} , {
pattern : /:(?:active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|in-range|invalid|lang|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-of-type|only-child|optional|out-of-range|read-only|read-write|required|root|target|valid|visited)(?:\(.*\))?/g ,
alias : 'pseudo-class'
} , {
pattern : /\[[\w-]+?\s*[*~$^|=]?(?:=\s*\S+)?\]/g ,
inside : {
"attr-name" :
{
pattern : /(\[)([\w-]+)(?=\s*[*~$^|=]{0,2})/g ,
lookbehind : true
} ,
"punctuation" : /\[|\]/g ,
"operator" : /[*~$^|=]/g ,
"attr-value" : {
pattern : /\S+/
} ,
} ,
alias : 'attr'
} ,
{
pattern : /\.[a-z-]+/i ,
alias : 'class'
} ,
{
pattern : /#[a-z-]+/i ,
alias : 'id'
} ,
{
pattern : /\b(html|head|title|base|link|meta|style|script|noscript|template|body|section|nav|article|aside|h[1-6]|header|footer|address|main|p|hr|pre|blockquote|ol|ul|li|dl|dt|dd|figure|figcaption|div|a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|dbo|span|br|wbr|ins|del|image|iframe|embed|object|param|video|audio|source|track|canvas|map|area|sv|math|table|caption|colgroup|col|tbody|thead|tfoot|tr|td|th|form|fieldset|legeng|label|input|button|select|datalist|optgroup|option|textarea|keygen|output|progress|meter|details|summary|menuitem|menu)\b/g ,
alias : 'tag'
} ,
] ,
'property' : [
/^\s*([a-z-]+)(?=\s+[\w\W]+|\s*:)(?!\s*\{|\r?\n)/mig ,
{
pattern : /(\(\s*)([a-z-]+)(?=\s*:)/ig ,
lookbehind : true
}
] ,
'function' : /[-a-z0-9]+(?=\()/ig ,
'punctuation' : /[\{\};:]/g ,
'operator' : /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/g
}
;
// issues: nested multiline comments, highlighting inside string interpolations
Prism . languages . swift = Prism . languages . extend ( 'clike' , {
'keyword' : /\b(as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|dynamicType|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|Protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__COLUMN__|__FILE__|__FUNCTION__|__LINE__)\b/ ,
'number' : /\b([\d_]+(\.[\de_]+)?|0x[a-f0-9_]+(\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i ,
'constant' : /\b(nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/ ,
'atrule' : /@\b(IBOutlet|IBDesignable|IBAction|IBInspectable|class_protocol|exported|noreturn|NSCopying|NSManaged|objc|UIApplicationMain|auto_closure)\b/ ,
'builtin' : /\b([A-Z]\S+|abs|advance|alignof|alignofValue|assert|contains|count|countElements|debugPrint|debugPrintln|distance|dropFirst|dropLast|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lazy|lexicographicalCompare|map|max|maxElement|min|minElement|numericCast|overlaps|partition|prefix|print|println|reduce|reflect|reverse|sizeof|sizeofValue|sort|sorted|split|startsWith|stride|strideof|strideofValue|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|withExtendedLifetime|withUnsafeMutablePointer|withUnsafeMutablePointers|withUnsafePointer|withUnsafePointers|withVaList)\b/
} ) ;
;
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
}
} ;
;
Prism . languages . typescript = Prism . languages . extend ( 'javascript' , {
'keyword' : /\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield|module|declare|constructor|string|Function|any|number|boolean|Array|enum)\b/
} ) ;
;
Prism . languages . vhdl = {
'comment' : /--.+/ ,
// support for all logic vectors
'vhdl-vectors' : {
'pattern' : /\b[oxb]"[\da-f_]+"|"[01uxzwlh-]+"/i ,
'alias' : 'number'
} ,
'string' : /"(\\\n|\\?.)*?"/ ,
'constant' : /\b(use|library)\b/i ,
// support for predefined attributes included
'keyword' : /\b('active|'ascending|'base|'delayed|'driving|'driving_value|'event|'high|'image|'instance_name|'last_active|'last_event|'last_value|'left|'leftof|'length|'low|'path_name|'pos|'pred|'quiet|'range|'reverse_range|'right|'rightof|'simple_name|'stable|'succ|'transaction|'val|'value|access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with)\b/i ,
'boolean' : /\b(true|false)\b/i ,
'function' : {
// support for operator overloading included
pattern : /([a-z0-9_]+|"\S+")\(/i ,
inside : {
punctuation : /\(/
}
} ,
// decimal, based, physical, and exponential numbers supported
'number' : /'[01uxzwlh-]'|\b\d+[_.]*(#[\da-f_.]+#)?(e[-+]?\d+)?/i ,
'operator' : /<=?|>=?|:=|[-+*/&=]|\b(abs|not|mod|rem|sll|srl|sla|sra|rol|ror|and|or|nand|xnor|xor|nor)\b/i ,
'punctuation' : /[{}[\];(),.:]/
} ;
;
Prism . languages . wiki = Prism . languages . extend ( 'markup' , {
'block-comment' : {
pattern : /(^|[^\\])\/\*[\w\W]*?\*\// ,
lookbehind : true ,
alias : 'comment'
} ,
'heading' : {
pattern : /^(=+).+?\1/m ,
inside : {
'punctuation' : /^=+|=+$/ ,
'important' : /.+/
}
} ,
'emphasis' : {
pattern : /('{2,4}).+?\1/ ,
inside : {
'bold italic' : {
pattern : /('''').+?(?=\1)/ ,
lookbehind : true
} ,
'bold' : {
pattern : /(''').+?(?=\1)/ ,
lookbehind : true
} ,
'italic' : {
pattern : /('').+?(?=\1)/ ,
lookbehind : true
} ,
'punctuation' : /^''+|''+$/
}
} ,
'hr' : {
pattern : /^-{4,}/m ,
alias : 'punctuation'
} ,
'url' : [
/ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b/i ,
/(?:RFC|PMID) +\d+/ ,
/\[\[.+?\]\]/ ,
/\[.+?\]/
] ,
'variable' : [
/__[A-Z]+__/ ,
/\{{3}.+?\}{3}/ ,
/\{\{.+?}}/
] ,
'symbol' : [
/^#redirect/im ,
/~{3,5}/
] ,
// Handle table attrs:
// {|
// ! style="text-align:left;"| Item
// |}
'table-tag' : {
pattern : /((?:^|[|!])[|!])[^|\r\n]+\|(?!\|)/m ,
lookbehind : true ,
inside : {
'table-bar' : {
pattern : /\|$/ ,
alias : 'punctuation'
} ,
rest : Prism . languages . markup [ 'tag' ] . inside
}
} ,
'punctuation' : /^(?:\{\||\|\}|\|-|[*#:;!|])|\|\||!!/m
} ) ;
Prism . languages . insertBefore ( 'wiki' , 'tag' , {
// Prevent highlighting inside <nowiki>, <source> and <pre> tags
'nowiki' : {
pattern : /<(nowiki|pre|source)\b[\w\W]*?>[\w\W]*?<\/\1>/i ,
inside : {
'tag' : {
pattern : /<(?:nowiki|pre|source)\b[\w\W]*?>|<\/(?:nowiki|pre|source)>/i ,
inside : Prism . languages . markup [ 'tag' ] . inside
}
}
}
} ) ;
;
Prism . languages . yaml = {
'scalar' : {
pattern : /([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:(\n[ \t]+)[^\r\n]+(?:\3[^\r\n]+)*)/ ,
lookbehind : true ,
alias : 'string'
} ,
'comment' : /#[^\n]+/ ,
'key' : {
pattern : /(\s*[:\-,[{\n?][ \t]*(![^\s]+)?[ \t]*)[^\n{[\]},#]+?(?=\s*:\s)/ ,
lookbehind : true ,
alias : 'atrule'
} ,
'directive' : {
pattern : /((^|\n)[ \t]*)%[^\n]+/ ,
lookbehind : true ,
alias : 'important'
} ,
'datetime' : {
pattern : /([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[ \t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*(\n|$|,|]|}))/ ,
lookbehind : true ,
alias : 'number'
} ,
'boolean' : {
pattern : /([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=\n|$|,|]|})/i ,
lookbehind : true ,
alias : 'important'
} ,
'null' : {
pattern : /([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=\n|$|,|]|})/i ,
lookbehind : true ,
alias : 'important'
} ,
'string' : {
pattern : /([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')(?=[ \t]*(\n|$|,|]|}))/ ,
lookbehind : true
} ,
'number' : {
pattern : /([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\dA-Fa-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=\n|$|,|]|})/i ,
lookbehind : true
} ,
'tag' : /![^\s]+/ ,
'important' : /[&*][\w]+/ ,
'punctuation' : /([:[\]{}\-,|>?]|---|\.\.\.)/
} ;
;
( function ( ) {
if ( ! self . Prism ) {
return ;
}
function $$ ( expr , con ) {
return Array . prototype . slice . call ( ( con || document ) . querySelectorAll ( expr ) ) ;
}
function hasClass ( element , className ) {
className = " " + className + " " ;
return ( " " + element . className + " " ) . replace ( /[\n\t]/g , " " ) . indexOf ( className ) > - 1
}
var CRLF = crlf = /\r?\n|\r/g ;
function highlightLines ( pre , lines , classes ) {
var ranges = lines . replace ( /\s+/g , '' ) . split ( ',' ) ,
offset = + pre . getAttribute ( 'data-line-offset' ) || 0 ;
var lineHeight = parseFloat ( getComputedStyle ( pre ) . lineHeight ) ;
for ( var i = 0 , range ; range = ranges [ i ++ ] ; ) {
range = range . split ( '-' ) ;
var start = + range [ 0 ] ,
end = + range [ 1 ] || start ;
var line = document . createElement ( 'div' ) ;
line . textContent = Array ( end - start + 2 ) . join ( ' \n' ) ;
line . className = ( classes || '' ) + ' line-highlight' ;
//if the line-numbers plugin is enabled, then there is no reason for this plugin to display the line numbers
if ( ! hasClass ( pre , 'line-numbers' ) ) {
line . setAttribute ( 'data-start' , start ) ;
if ( end > start ) {
line . setAttribute ( 'data-end' , end ) ;
}
}
line . style . top = ( start - offset - 1 ) * lineHeight + 'px' ;
//allow this to play nicely with the line-numbers plugin
if ( hasClass ( pre , 'line-numbers' ) ) {
//need to attack to pre as when line-numbers is enabled, the code tag is relatively which screws up the positioning
pre . appendChild ( line ) ;
} else {
( pre . querySelector ( 'code' ) || pre ) . appendChild ( line ) ;
}
}
}
function applyHash ( ) {
var hash = location . hash . slice ( 1 ) ;
// Remove pre-existing temporary lines
$$ ( '.temporary.line-highlight' ) . forEach ( function ( line ) {
line . parentNode . removeChild ( line ) ;
} ) ;
var range = ( hash . match ( /\.([\d,-]+)$/ ) || [ , '' ] ) [ 1 ] ;
if ( ! range || document . getElementById ( hash ) ) {
return ;
}
var id = hash . slice ( 0 , hash . lastIndexOf ( '.' ) ) ,
pre = document . getElementById ( id ) ;
if ( ! pre ) {
return ;
}
if ( ! pre . hasAttribute ( 'data-line' ) ) {
pre . setAttribute ( 'data-line' , '' ) ;
}
highlightLines ( pre , range , 'temporary ' ) ;
document . querySelector ( '.temporary.line-highlight' ) . scrollIntoView ( ) ;
}
var fakeTimer = 0 ; // Hack to limit the number of times applyHash() runs
Prism . hooks . add ( 'after-highlight' , function ( env ) {
var pre = env . element . parentNode ;
var lines = pre && pre . getAttribute ( 'data-line' ) ;
if ( ! pre || ! lines || ! /pre/i . test ( pre . nodeName ) ) {
return ;
}
clearTimeout ( fakeTimer ) ;
$$ ( '.line-highlight' , pre ) . forEach ( function ( line ) {
line . parentNode . removeChild ( line ) ;
} ) ;
highlightLines ( pre , lines ) ;
fakeTimer = setTimeout ( applyHash , 1 ) ;
} ) ;
addEventListener ( 'hashchange' , applyHash ) ;
} ) ( ) ;
;
Prism . hooks . add ( 'after-highlight' , function ( env ) {
// works only for <code> wrapped inside <pre> (not inline)
var pre = env . element . parentNode ;
var clsReg = /\s*\bline-numbers\b\s*/ ;
if (
! pre || ! /pre/i . test ( pre . nodeName ) ||
// Abort only if nor the <pre> nor the <code> have the class
( ! clsReg . test ( pre . className ) && ! clsReg . test ( env . element . className ) )
) {
return ;
}
if ( clsReg . test ( env . element . className ) ) {
// Remove the class "line-numbers" from the <code>
env . element . className = env . element . className . replace ( clsReg , '' ) ;
}
if ( ! clsReg . test ( pre . className ) ) {
// Add the class "line-numbers" to the <pre>
pre . className += ' line-numbers' ;
}
var linesNum = ( 1 + env . code . split ( '\n' ) . length ) ;
var lineNumbersWrapper ;
var lines = new Array ( linesNum ) ;
lines = lines . join ( '<span></span>' ) ;
lineNumbersWrapper = document . createElement ( 'span' ) ;
lineNumbersWrapper . className = 'line-numbers-rows' ;
lineNumbersWrapper . innerHTML = lines ;
if ( pre . hasAttribute ( 'data-start' ) ) {
pre . style . counterReset = 'linenumber ' + ( parseInt ( pre . getAttribute ( 'data-start' ) , 10 ) - 1 ) ;
}
env . element . appendChild ( lineNumbersWrapper ) ;
$ ( ".line-numbers-rows > span" ) . on ( "click" , function ( ) {
var line = $ ( this ) . index ( ) + 1 ;
$ ( pre ) . attr ( "data-line" , line ) ;
Prism . highlightAll ( ) ;
} ) ;
} ) ; ;
( function ( ) {
if ( ! self . Prism ) {
return ;
}
var Languages = {
'csharp' : 'C#' ,
'cpp' : 'C++'
} ;
Prism . hooks . add ( 'before-highlight' , function ( env ) {
var pre = env . element . parentNode ;
if ( ! pre || ! /pre/i . test ( pre . nodeName ) ) {
return ;
}
var language = Languages [ env . language ] || env . language ;
pre . setAttribute ( 'data-language' , language ) ;
} ) ;
} ) ( ) ;
;
( function ( ) {
if ( ! self . Prism ) {
return ;
}
Prism . hooks . add ( 'wrap' , function ( env ) {
if ( env . type !== "keyword" ) {
return ;
}
env . classes . push ( 'keyword-' + env . content ) ;
} ) ;
} ) ( ) ;
;