Unable to parse complex expression

Oct 12, 2013 at 6:33 PM
I wanted to parse this expression (it is valid expression because browser can deal with it):
<script type="text/javascript">eval(function(p,r,o,x,y,s){y=function(c){return(c<r?'':y(parseInt(c/r)))+((c=c%r)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(o--){s[y(o)]=x[o]||y(o)}x=[function(y){return s[y]}];y=function(){return'\\w+'};o=1};while(o--){if(x[o]){p=p.replace(new RegExp('\\b'+y(o)+'\\b','g'),x[o])}}return p}('s=6;c=D^C;t=B^E;g=F^A;q=G^I;p=9;d=4;j=y^u;h=1;e=w^z;i=x^v;n=8;r=7;f=0;l=5;b=3;o=H^T;a=W^V;k=2;m=X^U;J=f^j;N=h^i;M=k^g;L=b^a;K=d^e;O=l^m;P=s^t;S=r^q;R=n^o;Q=p^c;',60,60,'^^^^^^^^^^NineFiveNine^Seven^Six2Five^Six^Nine9Two^Five^SixFiveThree^Two^Five3Eight^Six9Six^Nine^Eight^Three4Four^Three^TwoTwoOne^Four^ThreeNineSeven^Zero^One^TwoFourZero^8090^8118^5618^12015^308^8888^6588^2097^8000^3456^80^3022^7923^9897^808^Zero1ZeroThree^Nine7FiveFive^FiveThreeSixFour^FiveFourNineNine^OneEightTwoSeven^Six0EightEight^Nine8SevenZero^TwoThreeOneOne^SevenSevenThreeTwo^NineNineFourSix^1080^3129^8088^10455^9596'.split('\u005e'),0,{}))
In the end I want to get the values for (those are numbers):

Maybe I'm using jint wrongly.
I just passed whole expression between <script> tags as argument to Run function. And that function throws exception.

Can someone help?
Oct 15, 2013 at 10:13 PM
Works ok for me - the result is 8, is that what you were expecting?
Admittedly I've made a few mods to Jint (including the grammar) but I can't see why it would affect anything there.
Oct 16, 2013 at 6:19 AM
Thank you for your answer. Can you share the code you used to get it working?
Oct 16, 2013 at 9:43 AM
Just as you said, I passed what's in your script tags (with no newlines) to JintEngine.Run().
I can't think of any of the mods I've made to Jint that would affect this. What specific error do you get?
Oct 16, 2013 at 10:25 AM
Exception with something that variable "o" is undefined.
I created my own js interpreter that uses Chakra jScript Engine (Very fast js engine developed my MS for IE 9).
But thanks for your attention.