Ñò né$Lc@sSddkZddkZddkZddkZddkZd„Zd„Zd„Zd„Zd„Z d„Z ei dƒZ ei d ƒZ d „Zd „Zd „Zd dd„ƒYZddd„ƒYZei dƒZei dƒZei dƒZd„ZdZdZdZdZdZd„Zd„Zedjo eƒndS(iÿÿÿÿNcCsdg}xA|D]9}t|ƒ}|djpt‚|it|ƒƒq W|idƒdi|ƒS(Ni€t0s, (tordtAssertionErrortappendtstrtjoin(tlinestresulttchrtvalue((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pytToCArray&s  cCsRtidd|ƒ}titidtiƒd|ƒ}tidd|ƒ}|S(Ns//.*\ns s /\*.*?\*/ts\s+\n+(tretsubtcompiletDOTALL(R((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyt#RemoveCommentsAndTrailingWhitespace0s$cCs1t|dƒ}z|iƒ}Wd|iƒX|S(Ntrt(topentreadtclose(tfilenametfileR((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pytReadFile7s  cCsxg}xkt|dƒD]Z}d|jo||idƒ }n|iƒ}t|ƒdjo|i|ƒqqW|S(NRt#i(RtindextstriptlenR(RRtline((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyt ReadLines@s  cCs)ddk}|iƒ}|i|ƒ|S(Niÿÿÿÿ(t ConfigParserR(tnameRtconfig((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pytLoadConfigFromKs   cCsQ|iƒ}|idƒo-|idƒo|idƒidƒiƒS|SdS(Nt[t](Rt startswithtendswithtlstriptrstriptsplit(tstring((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyt ParseValueRs  s \beval\s*\(s \bwith\s*\(cCsXt|ƒ}ti|ƒ}|od|‚nti|ƒ}|od|‚ndS(NsEval disallowed in natives: %ss)With statements disallowed in natives: %s(Rt EVAL_PATTERNtsearcht WITH_PATTERN(RRt eval_matcht with_match((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pytValidate^s cCs9x2|iƒD]$\}}|i|t|ƒƒ}q W|S(N(titemstreplaceR(Rt constantstkeyR ((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pytExpandConstantsjs c s¯x¨ˆiƒD]š\}‰|i|ddƒ}xu|djog||t|ƒdjpt‚d}|t|ƒd}|}d‰h‰‡‡‡‡fd†}xª|t|ƒjo–|djo‰||djo,|djo||||!ƒ|d}n?||d jo|d}n ||d jo|d}n|d}q¨W||||d!ƒˆiˆƒ}|| |||}|i|d|ƒ}q2Wq W|S(Nt(iiÿÿÿÿics*t|iƒˆƒ}|ˆˆiˆR((R:R;R<R=sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyR7ps6  " t TextMacrocBseZd„Zd„ZRS(cCs||_||_dS(N(R8tbody(tselfR8RJ((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyt__init__’s cCs<|i}x,|iƒD]\}}|i||ƒ}qW|S(N(RJR1R2(RKR;RR4R ((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyRD•s   (t__name__t __module__RLRD(((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyRI‘s t PythonMacrocBseZd„Zd„ZRS(cCs||_||_dS(N(R8tfun(RKR8RP((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyRLœs cCs>g}x"|iD]}|i||ƒqWt|i|ŒƒS(N(R8RRRP(RKR;R8targ((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyRDŸs  (RMRNRLRD(((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyRO›s s(^const\s+([a-zA-Z0-9_]+)\s*=\s*([^;]*);$s6^macro\s+([a-zA-Z0-9_]+)\s*\(([^)]*)\)\s*=\s*([^;]*);$s?^python\s+macro\s+([a-zA-Z0-9_]+)\s*\(([^)]*)\)\s*=\s*([^;]*);$c CsÔh}h}x»|D]³}|idƒ}|djo|| }n|iƒ}t|ƒdjoqnti|ƒ}|o2|idƒ}|idƒiƒ}||| int NativesCollection<%(type)s>::GetBuiltinsCount() { return %(builtin_count)i; } template <> int NativesCollection<%(type)s>::GetDebuggerCount() { return %(debugger_count)i; } template <> int NativesCollection<%(type)s>::GetIndex(const char* name) { %(get_index_cases)s return -1; } template <> Vector NativesCollection<%(type)s>::GetScriptSource(int index) { %(get_script_source_cases)s return Vector("", 0); } template <> Vector NativesCollection<%(type)s>::GetScriptName(int index) { %(get_script_name_cases)s return Vector("", 0); } } // internal } // v8 s- static const char %(id)s[] = { %(data)s }; s3 if (strcmp(name, "%(id)s") == 0) return %(i)i; sG if (index == %(i)i) return Vector(%(id)s, %(length)i); sK if (index == %(i)i) return Vector("%(name)s", %(length)i); cCsrg}g}g}h}h}x`|D]X}dtiit|ƒƒdjo"ttt|ƒƒƒ\}}q%|i|ƒq%Wg} tiƒ} g} x%|D]} t| ƒ} | i dƒ}t | ƒ}t ||ƒ}t ||ƒ}t || ƒ| i|ƒ}t|ƒ}tii| ƒdd }|o|d }n|o|i|t|ƒfƒn|i|t|ƒfƒ| ith|d6|d6ƒ| ith|d6|d6ƒq Wg}g}g}d}x™|D]‘\}}d |}|ith|d6|d 6ƒ|ith|d6|d 6|d 6ƒ|ith|d 6t|ƒd 6|d 6ƒ|d}qàWx™|D]‘\}}d |}|ith|d6|d 6ƒ|ith|d6|d 6|d 6ƒ|ith|d 6t|ƒd 6|d 6ƒ|d}q|Wtt|dƒd ƒ}|itht|ƒt|ƒd6t|ƒd6di| ƒd6di|ƒd6di|ƒd6di|ƒd6|dd6ƒ|iƒt|ƒdjo§tt|dƒd ƒ}|itht|ƒt|ƒd6t|ƒd6di| ƒd6di|ƒd6di|ƒd6di|ƒd6|dd6ƒ|iƒndS(Ns macros.pyis -debugger.jsiýÿÿÿi÷ÿÿÿtidtdatais native %s.jstitlengthRtwt builtin_counttdebugger_counts t source_linesR tget_index_casestget_script_source_casestget_script_name_casestTYPEttype(tostpathR(RR]RRtjsmintJavaScriptMinifierR%RR5R7R0tJSMinifyR RtSOURCE_DECLARATIONtGET_DEBUGGER_INDEX_CASEtGET_DEBUGGER_SCRIPT_SOURCE_CASEtGET_DEBUGGER_SCRIPT_NAME_CASERtwritetHEADER_TEMPLATERR(tsourcettargettenvtidst debugger_idstmodulestconstsR<tsRetminifiertsource_lines_emptytmoduleRtdebuggerRR_R^RfRgRhR`Rat native_nametoutput((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pytJS2C s¤#"     #                   cCsUtid}tid}tid}tid}t|||gh|d6ƒdS(NiiiiRi(tsystargvR„(tnativest natives_emptyRjt source_files((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pytmainps     t__main__(((RkR R…R)RmR RRRR!R*RR+R-R0R5R7RIRORRRURWR]RuRpRqRrRsR„RŠRM(((sL/Users/colin/projects/gems/tomato/ext/tomato/external/build/v8/tools/js2c.pyt"s60      !   N c