Farabi

 view release on metacpan or  search on metacpan

lib/Farabi/files/public/assets/codemirror/mode/markdown/markdown.js  view on Meta::CPAN

      return getType(state);
    }

    // Matches link titles present on next line
    if (state.linkTitle) {
      state.linkTitle = false;
      var matchCh = ch;
      if (ch === '(') {
        matchCh = ')';
      }
      matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
      var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
      if (stream.match(new RegExp(regex), true)) {
        return linkhref;
      }
    }

    // If this block is changed, it may need to be updated in GFM mode
    if (ch === '`') {
      var previousFormatting = state.formatting;
      if (modeCfg.highlightFormatting) state.formatting = "code";

lib/Farabi/files/public/assets/codemirror/mode/markdown/markdown.js  view on Meta::CPAN

      stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
    }
    state.f = state.inline = inlineNormal;
    return linkhref;
  }

  var savedInlineRE = [];
  function inlineRE(endChar) {
    if (!savedInlineRE[endChar]) {
      // Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741)
      endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
      // Match any non-endChar, escaped character, as well as the closing
      // endChar.
      savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')');
    }
    return savedInlineRE[endChar];
  }

  var mode = {
    startState: function() {
      return {

lib/Farabi/files/public/assets/codemirror/mode/perl/perl.js  view on Meta::CPAN

                '%ERRNO'                        :    5,
                '%!'                            :    5,
                '$CHILD_ERROR'                  :    5,
                '$?'                            :    5,
                '$EVAL_ERROR'                   :    5,
                '$@'                            :    5,
                '$OFMT'                         :    5,
                '$#'                            :    5,
                '$*'                            :    5,
                '$ARRAY_BASE'                   :    5,
                '$['                            :    5,
                '$OLD_PERL_VERSION'             :    5,
                '$]'                            :    5,
                                                //      PERL blocks
                'if'                            :[1,1],
                elsif                           :[1,1],
                'else'                          :[1,1],
                'while'                         :[1,1],
                unless                          :[1,1],
                'for'                           :[1,1],
                foreach                         :[1,1],

lib/Farabi/files/public/assets/codemirror/mode/php/php.js  view on Meta::CPAN


    if (stream.current() == '"') return "string";

    // "Complex" syntax
    if (stream.match("${", false) || stream.match("{$", false)) {
      state.tokenize = null;
      return "string";
    }

    // Simple syntax
    if (stream.match(/\$[a-zA-Z_][a-zA-Z0-9_]*/)) {
      // After the variable name there may appear array or object operator.
      if (stream.match("[", false)) {
        // Match array operator
        state.tokenize = matchSequence([
          [["[", null]],
          [[/\d[\w\.]*/, "number"],
           [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"],
           [/[\w\$]+/, "variable"]],
          [["]", null]]
        ]);
      }
      if (stream.match(/\-\>\w/, false)) {
        // Match object operator
        state.tokenize = matchSequence([
          [["->", null]],
          [[/[\w]+/, "variable"]]
        ]);
      }
      return "variable-2";
    }

    // Normal string
    while (
      !stream.eol() &&
      (!stream.match("{$", false)) &&
      (!stream.match(/(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false) || escaped)
    ) {
      next = stream.next();
      if (!escaped && next == '"') { end = true; break; }
      escaped = !escaped && next == "\\";
    }
    if (end) {
      state.tokenize = null;
      state.phpEncapsStack.pop();
    }
    return "string";

lib/Farabi/files/public/assets/codemirror/mode/php/test.js  view on Meta::CPAN

  var mode = CodeMirror.getMode({indentUnit: 2}, "php");
  function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }

  MT('simple_test',
     '[meta <?php] ' +
     '[keyword echo] [string "aaa"]; ' +
     '[meta ?>]');

  MT('variable_interpolation_non_alphanumeric',
     '[meta <?php]',
     '[keyword echo] [string "aaa$~$!$@$#$$$%$^$&$*$($)$.$<$>$/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]',
     '[meta ?>]');

  MT('variable_interpolation_digits',
     '[meta <?php]',
     '[keyword echo] [string "aaa$1$2$3$4$5$6$7$8$9$0aaa"]',
     '[meta ?>]');

  MT('variable_interpolation_simple_syntax_1',
     '[meta <?php]',
     '[keyword echo] [string "aaa][variable-2 $aaa][string .aaa"];',

lib/Farabi/files/public/assets/codemirror/mode/q/index.html  view on Meta::CPAN

DELIM:","
ZAPHDRS:0b / lowercase and remove _ from colhdrs (junk characters are always removed)
WIDTHHDR:25000 / number of characters read to get the header
READLINES:222 / number of lines read and used to guess the types
SYMMAXWIDTH:11 / character columns narrower than this are stored as symbols
SYMMAXGR:10 / max symbol granularity% before we give up and keep as a * string
FORCECHARWIDTH:30 / every field (of any type) with values this wide or more is forced to character "*"
DISCARDEMPTY:0b / completely ignore empty columns if true else set them to "C"
CHUNKSIZE:50000000 / used in fs2 (modified .Q.fs)

k)nameltrim:{$[~@x;.z.s'x;~(*x)in aA:.Q.a,.Q.A;(+/&\~x in aA)_x;x]}
k)fs2:{[f;s]((-7!s)>){[f;s;x]i:1+last@&0xa=r:1:(s;x;CHUNKSIZE);f@`\:i#r;x+i}[f;s]/0j}
cleanhdrs:{{$[ZAPHDRS;lower x except"_";x]}x where x in DELIM,.Q.an}
cancast:{nw:x$"";if[not x in"BXCS";nw:(min 0#;max 0#;::)@\:nw];$[not any nw in x$(11&count y)#y;$[11<count y;not any nw in x$y;1b];0b]}

read:{[file]data[file;info[file]]}  
read10:{[file]data10[file;info[file]]}  

colhdrs:{[file]
	`$nameltrim DELIM vs cleanhdrs first read0(file;0;1+first where 0xa=read1(file;0;WIDTHHDR))}
data:{[file;info]
	(exec c from info where not t=" ")xcol(exec t from info;enlist DELIM)0:file}
data10:{[file;info]
	data[;info](file;0;1+last 11#where 0xa=read1(file;0;15*WIDTHHDR))}

lib/Farabi/files/public/assets/codemirror/mode/q/index.html  view on Meta::CPAN

	info:update t:"U",rule:140,maybe:1b from info where t="H",mw in 3 4,7<count each dchar,{all x like"*[0-9][0-5][0-9]"}peach sdv,.csv.cancast["U"]peach sdv; /2359
	info:update t:"U",rule:150,maybe:0b from info where t="n",mw in 4 5,mdot=0,{all x like"*[0-9]:[0-5][0-9]"}peach sdv,.csv.cancast["U"]peach sdv;
	info:update t:"T",rule:160,maybe:0b from info where t="n",mw within 7 12,mdot<2,{all x like"*[0-9]:[0-5][0-9]:[0-5][0-9]*"}peach sdv,.csv.cancast["T"]peach sdv;
	info:update t:"V",rule:170,maybe:0b from info where t="T",mw in 7 8,mdot=0,.csv.cancast["V"]peach sdv;
	info:update t:"T",rule:180,maybe:1b from info where t in"EF",mw within 7 10,mdot=1,{all x like"*[0-9][0-5][0-9][0-5][0-9].*"}peach sdv,.csv.cancast["T"]peach sdv;
	info:update t:"Z",rule:190,maybe:0b from info where t="n",mw within 11 24,mdot<4,.csv.cancast["Z"]peach sdv;
	info:update t:"P",rule:200,maybe:1b from info where t="n",mw within 12 29,mdot<4,{all x like"[12]*"}peach sdv,.csv.cancast["P"]peach sdv;
	info:update t:"N",rule:210,maybe:1b from info where t="n",mw within 3 28,mdot=1,.csv.cancast["N"]peach sdv;
	info:update t:"?",rule:220,maybe:0b from info where t="n"; / reset remaining maybe numeric
	info:update t:"C",rule:230,maybe:0b from info where t="?",mw=1; / char
	info:update t:"B",rule:240,maybe:0b from info where t in"HC",mw=1,mdot=0,{$[all x in"01tTfFyYnN";(any"0fFnN"in x)and any"1tTyY"in x;0b]}each dchar; / boolean
	info:update t:"B",rule:250,maybe:1b from info where t in"HC",mw=1,mdot=0,{all x in"01tTfFyYnN"}each dchar; / boolean
	info:update t:"X",rule:260,maybe:0b from info where t="?",mw=2,{$[all x in"0123456789abcdefABCDEF";(any .Q.n in x)and any"abcdefABCDEF"in x;0b]}each dchar; /hex
	info:update t:"S",rule:270,maybe:1b from info where t="?",mw<.csv.SYMMAXWIDTH,mw>1,gr<.csv.SYMMAXGR; / symbols (max width permitting)
	info:update t:"*",rule:280,maybe:0b from info where t="?"; / the rest as strings
	/ flag those S/* columns which could be encoded to integers (.Q.j10/x10/j12/x12) to avoid symbols
	info:update j12:1b from info where t in"S*",mw<13,{all x in .Q.nA}each dchar;
	info:update j10:1b from info where t in"S*",mw<11,{all x in .Q.b6}each dchar; 
	select c,ci,t,maybe,empty,res,j10,j12,ipa,mw,mdot,rule,gr,ndv,dchar from info}
info:info0[;()] / by default don't restrict columns
infolike:{[file;pattern] info0[file;{x where x like y}[lower colhdrs[file];pattern]]} / .csv.infolike[file;"*time"]

\d .
/ DATA:()
bulkload:{[file;info]
	if[not`DATA in system"v";'`DATA.not.defined];
	if[count DATA;'`DATA.not.empty];
	loadhdrs:exec c from info where not t=" ";loadfmts:exec t from info;
	.csv.fs2[{[file;loadhdrs;loadfmts] `DATA insert $[count DATA;flip loadhdrs!(loadfmts;.csv.DELIM)0:file;loadhdrs xcol(loadfmts;enlist .csv.DELIM)0:file]}[file;loadhdrs;loadfmts]];
	count DATA}
@[.:;"\\l csvutil.custom.q";::]; / save your custom settings in csvutil.custom.q to override those set at the beginning of the file 
</textarea></div>

    <script>
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,
        matchBrackets: true
      });
    </script>

lib/Farabi/files/public/assets/perlito/perlito5.min.js  view on Meta::CPAN

else{throw(p5context([v_m_var],p5want));};if((p5pkg["Perlito5::Grammar::String"].substr([v_str,(v_m||(v_m=new p5HashRef({})))._hash_.p5hget('to'),1],0)==']')){null;}
else{throw(p5context([v_m_var],p5want));};})();};(v_p)++;(v_m_index=(p5call(p5pkg["Perlito5::Expression"],"list_parse",[v_str,v_p],0)));if(p5bool(v_m_index)){(function(){var v_exp;(v_exp=((v_m_index||(v_m_index=new p5HashRef({})))._hash_.p5hget('capt...
catch(err){if(err instanceof Error){throw(err);}
else{return(err);}}});p5make_sub("Perlito5::Grammar::String","double_quoted_var",function(List__,p5want){try{var v_self;(v_self=(List__.p5aget(0)));var v_str;(v_str=(List__.p5aget(1)));var v_pos;(v_pos=(List__.p5aget(2)));var v_delimiter;(v_delimiter...
else{throw(p5context([v_m],p5want));};var v_var;(v_var=((p5pkg["Perlito5::Match"].flat([v_m],p5want)||(p5pkg["Perlito5::Match"].flat([v_m],p5want)=new p5ArrayRef([])))._array_.p5aget(1)));(v_m||(v_m=new p5HashRef({})))._hash_.p5hset('capture',(v_var)...
else{if(((p5str(v_c)=='$')&&(p5pkg["Perlito5::Grammar::String"].substr([v_str,(p5num(v_pos)+1),p5pkg["Perlito5::Grammar::String"].length([v_delimiter],0)],0)!=p5str(v_delimiter)))){(function(){var v_m;(v_m=(p5call(p5pkg["Perlito5::Grammar::Sigil"],"t...
else{throw(p5context([v_m],p5want));};(v_m||(v_m=new p5HashRef({})))._hash_.p5hset('capture',((v_m||(v_m=new p5HashRef({})))._hash_.p5hget_array('capture')._array_.p5aget(1)));throw(p5call(v_self,"double_quoted_var_with_subscript",[v_m,v_interpolate]...
else{if(((p5str(v_c)=='@')&&(p5pkg["Perlito5::Grammar::String"].substr([v_str,(p5num(v_pos)+1),p5pkg["Perlito5::Grammar::String"].length([v_delimiter],0)],0)!=p5str(v_delimiter)))){(function(){var v_m;(v_m=(p5call(p5pkg["Perlito5::Grammar::Sigil"],"t...
else{throw(p5context([v_m],p5want));};(v_m||(v_m=new p5HashRef({})))._hash_.p5hset('capture',((v_m||(v_m=new p5HashRef({})))._hash_.p5hget_array('capture')._array_.p5aget(1)));(v_m=(p5call(v_self,"double_quoted_var_with_subscript",[v_m,v_interpolate]...
catch(err){if(err instanceof Error){throw(err);}
else{return(err);}}});1;})();(function(){null;var p5153=p5make_package("Perlito5::Grammar::Sigil");;p5pkg["Perlito5::Precedence"].add_term(['$',function(List__,p5want){return(p5call(p5pkg["Perlito5::Grammar::Sigil"],"term_sigil",p5list_to_a(List__.p5...
else{if((Hash_special_var).hasOwnProperty(v_s)){(v_len=(3));}
else{(v_s=(p5pkg["Perlito5::Grammar::Sigil"].substr([v_str,v_pos,2],0)));if((Hash_special_var).hasOwnProperty(v_s)){(v_len=(2));};};};if(p5bool(v_len)){(function(){var v_c0;(v_c0=(p5pkg["Perlito5::Grammar::Sigil"].substr([v_str,((p5num(v_pos)+p5num(v...
else{throw((new p5HashRef(p5a_to_h(p5list_to_a('str',v_str,'from',v_pos,'to',(p5num(v_pos)+p5num(v_len)),'capture',(new p5ArrayRef(p5list_to_a('term',p5call(p5pkg["Perlito5::AST::Var"],"new",p5list_to_a('sigil',p5pkg["Perlito5::Grammar::Sigil"].subst...
catch(err){if(err instanceof Error){throw(err);}
else{return(err);}}});var Hash_sigil={};(Hash_sigil={'$':1,'%':1,'@':1,'&':1,'*':1});p5make_sub("Perlito5::Grammar::Sigil","term_sigil",function(List__,p5want){try{var v_self;(v_self=(List__.p5aget(0)));var v_str;(v_str=(List__.p5aget(1)));var v_pos;...
else{throw(p5context([],p5want));};var v_p;(v_p=((p5num(v_pos)+1)));var v_sigil;(v_sigil=(v_c1));if((p5pkg["Perlito5::Grammar::Sigil"].substr([v_str,v_pos,2],0)=='$#')){(v_sigil=('$#'));(v_p)++;};var v_m;(v_m=(p5call(p5pkg["Perlito5::Grammar::Space"]...
catch(err){if(err instanceof Error){throw(err);}
else{return(err);}}});1;})();(function(){var p5154=p5make_package("Perlito5::Grammar::Use");;;;p5pkg["Perlito5::Precedence"].add_term(['no',function(List__,p5want){return(p5call(p5pkg["Perlito5::Grammar::Use"],"term_use",p5list_to_a(List__.p5aget(0),...
else{return(p5context([0],p5want));}})()],0),function(){return p5context([(function(){var v_m2;(v_m2=(p5call(p5pkg["Perlito5::Grammar::Space"],"ws",p5list_to_a(v_str,(v_MATCH||(v_MATCH=new p5HashRef({})))._hash_.p5hget('to')),0)));if(p5bool(v_m2)){(v...
else{return(p5context([0],p5want));}})()],0)}),function(){return p5context([(function(){var v_pos1;(v_pos1=((v_MATCH||(v_MATCH=new p5HashRef({})))._hash_.p5hget('to')));return(p5or(p5context([(function(){return(p5and(p5context([(function(){var v_m2;(...

lib/Farabi/files/public/assets/perlito/perlito5.min.js  view on Meta::CPAN

else{return(p5context([0],p5want));}})()],0),function(){return p5context([(function(){var v_m2;(v_m2=(p5call(v_grammar,"opt_ws",p5list_to_a(v_str,(v_MATCH||(v_MATCH=new p5HashRef({})))._hash_.p5hget('to')),0)));if(p5bool(v_m2)){(v_MATCH||(v_MATCH=new...
else{return(p5context([0],p5want));}})()],0)}),function(){return p5context([p5and(('{'==p5pkg["Perlito5::Grammar"].substr([v_str,(v_MATCH||(v_MATCH=new p5HashRef({})))._hash_.p5hget('to'),1],0)),function(){return p5context([(v_MATCH||(v_MATCH=new p5H...
else{return(p5context([0],p5want));}})()],0)}),function(){return p5context([(function(){var v_m2;(v_m2=(p5call(v_grammar,"exp_stmts",p5list_to_a(v_str,(v_MATCH||(v_MATCH=new p5HashRef({})))._hash_.p5hget('to')),0)));if(p5bool(v_m2)){(v_MATCH||(v_MATC...
else{return(p5context([0],p5want));}})()],0)}),function(){return p5context([(function(){var v_m2;(v_m2=(p5call(v_grammar,"opt_ws",p5list_to_a(v_str,(v_MATCH||(v_MATCH=new p5HashRef({})))._hash_.p5hget('to')),0)));if(p5bool(v_m2)){(v_MATCH||(v_MATCH=n...
else{return(p5context([0],p5want));}})()],0)}),function(){return p5context([(function(){var v_pos1;(v_pos1=((v_MATCH||(v_MATCH=new p5HashRef({})))._hash_.p5hget('to')));return(p5or(p5context([(function(){return(p5and(('}'==p5pkg["Perlito5::Grammar"]....
catch(err){if(err instanceof Error){throw(err);}
else{return(err);}}});var p5159=p5make_package("Perlito5::AST::Do");p5make_sub("Perlito5::AST::Do","simplify",function(List__,p5want){try{var v_self;(v_self=(List__.p5aget(0)));var v_block;if(p5bool(p5call((v_self||(v_self=new p5HashRef({})))._hash_....
else{(v_block=((new p5ArrayRef(p5list_to_a((v_self||(v_self=new p5HashRef({})))._hash_.p5hget('block'))))));};if((p5num(((v_block||(v_block=new p5ArrayRef([])))._array_))==1)){(function(){var v_stmt;(v_stmt=((v_block||(v_block=new p5ArrayRef([])))._a...
catch(err){if(err instanceof Error){throw(err);}
else{return(err);}}});})();;(function(){var p5160=p5make_package("Perlito5::Runtime");;if(p5bool(p5pkg["main"]["v_]"])){null;}
else{(p5pkg["main"]["v_]"]=(5.014001));};(p5pkg["Perlito5"]["v_EXPAND_USE"]=(1));(p5pkg["Perlito5"]["v_STRICT"]=(0));(p5pkg["Perlito5"]["v_WARNINGS"]=(0));(p5pkg["Perlito5"]["v_UTF8"]=(0));(p5pkg["Perlito5"]["v_BYTES"]=(0));(p5pkg["Perlito5"]["v_CALL...



( run in 0.845 second using v1.01-cache-2.11-cpan-cc502c75498 )