MCPcopy Create free account
hub / github.com/TruthHun/BookStack / tokenChain

Function tokenChain

static/editor.md/lib/codemirror/mode/perl/perl.js:483–501  ·  view source on GitHub ↗
(stream,state,chain,style,tail)

Source from the content-addressed store, hash-verified

481 var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type
482
483 function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)
484 state.chain=null; // 12 3tail
485 state.style=null;
486 state.tail=null;
487 state.tokenize=function(stream,state){
488 var e=false,c,i=0;
489 while(c=stream.next()){
490 if(c===chain[i]&&!e){
491 if(chain[++i]!==undefined){
492 state.chain=chain[i];
493 state.style=style;
494 state.tail=tail;}
495 else if(tail)
496 stream.eatWhile(tail);
497 state.tokenize=tokenPerl;
498 return style;}
499 e=!e&&c=="\\";}
500 return style;};
501 return state.tokenize(stream,state);}
502
503 function tokenSOMETHING(stream,state,string){
504 state.tokenize=function(stream,state){

Callers 1

tokenPerlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected