test_no_newlinesk 771 B

1
  1. / :`i$"A"; // 65/ :`i$"Z"; // 90/ :`i$"0"; // 48/ :`i$"9"; // 57/ :`i$":"; // 58/ :`i$"$"; // 36testAtZ: { i:`i$x; $[(i>64) & (i<91);1;0] };test0t9: { i:`i$x; $[(i>47) & (i<58);1;0] };testcol: { i:`i$x; $[i=58;1;0] };testend: { i:`i$x; $[i=36;1;0] };s0: ((testAtZ; 1);(test0t9; 2));s1: ((test0t9; 2);(testcol; 3));s2: ((testend; 7); (testcol;5));s3: (,(testAtZ; 5));s4: ((testAtZ; 5); (test0t9; 6));s5: (,(testend; 7));s6: (,(testend; 7));s7: (({`0:"SUCCESS"};7));// 7 is donestates:: (s0;s1;s2;s3;s4;s5;s6;s7);i: 1;run: {[str] str,:"$"; `0:str; s: 0; o:s {[s;c] r:{t: x[0][y]; `0:`k@(y); o:$[t;x[1];0]; o}[;c]'states[y]; ns:states@(&r); ns}\str; o};// todo: don't be using $// prepare for matching pattern and returning the start index and lengthtest: "A:A";run[test]\n