bc3effd35a7b338254ae3ef8eb593ced.js 128 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780
  1. "no use strict";
  2. !(function(window) {
  3. if (typeof window.window != "undefined" && window.document)
  4. return;
  5. if (window.require && window.define)
  6. return;
  7. if (!window.console) {
  8. window.console = function() {
  9. var msgs = Array.prototype.slice.call(arguments, 0);
  10. postMessage({type: "log", data: msgs});
  11. };
  12. window.console.error =
  13. window.console.warn =
  14. window.console.log =
  15. window.console.trace = window.console;
  16. }
  17. window.window = window;
  18. window.ace = window;
  19. window.onerror = function(message, file, line, col, err) {
  20. postMessage({type: "error", data: {
  21. message: message,
  22. data: err && err.data,
  23. file: file,
  24. line: line,
  25. col: col,
  26. stack: err && err.stack
  27. }});
  28. };
  29. window.normalizeModule = function(parentId, moduleName) {
  30. // normalize plugin requires
  31. if (moduleName.indexOf("!") !== -1) {
  32. var chunks = moduleName.split("!");
  33. return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]);
  34. }
  35. // normalize relative requires
  36. if (moduleName.charAt(0) == ".") {
  37. var base = parentId.split("/").slice(0, -1).join("/");
  38. moduleName = (base ? base + "/" : "") + moduleName;
  39. while (moduleName.indexOf(".") !== -1 && previous != moduleName) {
  40. var previous = moduleName;
  41. moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
  42. }
  43. }
  44. return moduleName;
  45. };
  46. window.require = function require(parentId, id) {
  47. if (!id) {
  48. id = parentId;
  49. parentId = null;
  50. }
  51. if (!id.charAt)
  52. throw new Error("worker.js require() accepts only (parentId, id) as arguments");
  53. id = window.normalizeModule(parentId, id);
  54. var module = window.require.modules[id];
  55. if (module) {
  56. if (!module.initialized) {
  57. module.initialized = true;
  58. module.exports = module.factory().exports;
  59. }
  60. return module.exports;
  61. }
  62. if (!window.require.tlns)
  63. return console.log("unable to load " + id);
  64. var path = resolveModuleId(id, window.require.tlns);
  65. if (path.slice(-3) != ".js") path += ".js";
  66. window.require.id = id;
  67. window.require.modules[id] = {}; // prevent infinite loop on broken modules
  68. importScripts(path);
  69. return window.require(parentId, id);
  70. };
  71. function resolveModuleId(id, paths) {
  72. var testPath = id, tail = "";
  73. while (testPath) {
  74. var alias = paths[testPath];
  75. if (typeof alias == "string") {
  76. return alias + tail;
  77. } else if (alias) {
  78. return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name);
  79. } else if (alias === false) {
  80. return "";
  81. }
  82. var i = testPath.lastIndexOf("/");
  83. if (i === -1) break;
  84. tail = testPath.substr(i) + tail;
  85. testPath = testPath.slice(0, i);
  86. }
  87. return id;
  88. }
  89. window.require.modules = {};
  90. window.require.tlns = {};
  91. window.define = function(id, deps, factory) {
  92. if (arguments.length == 2) {
  93. factory = deps;
  94. if (typeof id != "string") {
  95. deps = id;
  96. id = window.require.id;
  97. }
  98. } else if (arguments.length == 1) {
  99. factory = id;
  100. deps = [];
  101. id = window.require.id;
  102. }
  103. if (typeof factory != "function") {
  104. window.require.modules[id] = {
  105. exports: factory,
  106. initialized: true
  107. };
  108. return;
  109. }
  110. if (!deps.length)
  111. // If there is no dependencies, we inject "require", "exports" and
  112. // "module" as dependencies, to provide CommonJS compatibility.
  113. deps = ["require", "exports", "module"];
  114. var req = function(childId) {
  115. return window.require(id, childId);
  116. };
  117. window.require.modules[id] = {
  118. exports: {},
  119. factory: function() {
  120. var module = this;
  121. var returnExports = factory.apply(this, deps.slice(0, factory.length).map(function(dep) {
  122. switch (dep) {
  123. // Because "require", "exports" and "module" aren't actual
  124. // dependencies, we must handle them seperately.
  125. case "require": return req;
  126. case "exports": return module.exports;
  127. case "module": return module;
  128. // But for all other dependencies, we can just go ahead and
  129. // require them.
  130. default: return req(dep);
  131. }
  132. }));
  133. if (returnExports)
  134. module.exports = returnExports;
  135. return module;
  136. }
  137. };
  138. };
  139. window.define.amd = {};
  140. window.require.tlns = {};
  141. window.initBaseUrls = function initBaseUrls(topLevelNamespaces) {
  142. for (var i in topLevelNamespaces)
  143. this.require.tlns[i] = topLevelNamespaces[i];
  144. };
  145. window.initSender = function initSender() {
  146. var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter;
  147. var oop = window.require("ace/lib/oop");
  148. var Sender = function() {};
  149. (function() {
  150. oop.implement(this, EventEmitter);
  151. this.callback = function(data, callbackId) {
  152. postMessage({
  153. type: "call",
  154. id: callbackId,
  155. data: data
  156. });
  157. };
  158. this.emit = function(name, data) {
  159. postMessage({
  160. type: "event",
  161. name: name,
  162. data: data
  163. });
  164. };
  165. }).call(Sender.prototype);
  166. return new Sender();
  167. };
  168. var main = window.main = null;
  169. var sender = window.sender = null;
  170. window.onmessage = function(e) {
  171. var msg = e.data;
  172. if (msg.event && sender) {
  173. sender._signal(msg.event, msg.data);
  174. }
  175. else if (msg.command) {
  176. if (main[msg.command])
  177. main[msg.command].apply(main, msg.args);
  178. else if (window[msg.command])
  179. window[msg.command].apply(window, msg.args);
  180. else
  181. throw new Error("Unknown command:" + msg.command);
  182. }
  183. else if (msg.init) {
  184. window.initBaseUrls(msg.tlns);
  185. sender = window.sender = window.initSender();
  186. var clazz = this.require(msg.module)[msg.classname];
  187. main = window.main = new clazz(sender);
  188. }
  189. };
  190. })(this);
  191. ace.define("ace/lib/oop",[], function(require, exports, module){"use strict";
  192. exports.inherits = function (ctor, superCtor) {
  193. ctor.super_ = superCtor;
  194. ctor.prototype = Object.create(superCtor.prototype, {
  195. constructor: {
  196. value: ctor,
  197. enumerable: false,
  198. writable: true,
  199. configurable: true
  200. }
  201. });
  202. };
  203. exports.mixin = function (obj, mixin) {
  204. for (var key in mixin) {
  205. obj[key] = mixin[key];
  206. }
  207. return obj;
  208. };
  209. exports.implement = function (proto, mixin) {
  210. exports.mixin(proto, mixin);
  211. };
  212. });
  213. ace.define("ace/apply_delta",[], function(require, exports, module){"use strict";
  214. function throwDeltaError(delta, errorText) {
  215. console.log("Invalid Delta:", delta);
  216. throw "Invalid Delta: " + errorText;
  217. }
  218. function positionInDocument(docLines, position) {
  219. return position.row >= 0 && position.row < docLines.length &&
  220. position.column >= 0 && position.column <= docLines[position.row].length;
  221. }
  222. function validateDelta(docLines, delta) {
  223. if (delta.action != "insert" && delta.action != "remove")
  224. throwDeltaError(delta, "delta.action must be 'insert' or 'remove'");
  225. if (!(delta.lines instanceof Array))
  226. throwDeltaError(delta, "delta.lines must be an Array");
  227. if (!delta.start || !delta.end)
  228. throwDeltaError(delta, "delta.start/end must be an present");
  229. var start = delta.start;
  230. if (!positionInDocument(docLines, delta.start))
  231. throwDeltaError(delta, "delta.start must be contained in document");
  232. var end = delta.end;
  233. if (delta.action == "remove" && !positionInDocument(docLines, end))
  234. throwDeltaError(delta, "delta.end must contained in document for 'remove' actions");
  235. var numRangeRows = end.row - start.row;
  236. var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));
  237. if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)
  238. throwDeltaError(delta, "delta.range must match delta lines");
  239. }
  240. exports.applyDelta = function (docLines, delta, doNotValidate) {
  241. var row = delta.start.row;
  242. var startColumn = delta.start.column;
  243. var line = docLines[row] || "";
  244. switch (delta.action) {
  245. case "insert":
  246. var lines = delta.lines;
  247. if (lines.length === 1) {
  248. docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
  249. }
  250. else {
  251. var args = [row, 1].concat(delta.lines);
  252. docLines.splice.apply(docLines, args);
  253. docLines[row] = line.substring(0, startColumn) + docLines[row];
  254. docLines[row + delta.lines.length - 1] += line.substring(startColumn);
  255. }
  256. break;
  257. case "remove":
  258. var endColumn = delta.end.column;
  259. var endRow = delta.end.row;
  260. if (row === endRow) {
  261. docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
  262. }
  263. else {
  264. docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));
  265. }
  266. break;
  267. }
  268. };
  269. });
  270. ace.define("ace/lib/event_emitter",[], function(require, exports, module){"use strict";
  271. var EventEmitter = {};
  272. var stopPropagation = function () { this.propagationStopped = true; };
  273. var preventDefault = function () { this.defaultPrevented = true; };
  274. EventEmitter._emit =
  275. EventEmitter._dispatchEvent = function (eventName, e) {
  276. this._eventRegistry || (this._eventRegistry = {});
  277. this._defaultHandlers || (this._defaultHandlers = {});
  278. var listeners = this._eventRegistry[eventName] || [];
  279. var defaultHandler = this._defaultHandlers[eventName];
  280. if (!listeners.length && !defaultHandler)
  281. return;
  282. if (typeof e != "object" || !e)
  283. e = {};
  284. if (!e.type)
  285. e.type = eventName;
  286. if (!e.stopPropagation)
  287. e.stopPropagation = stopPropagation;
  288. if (!e.preventDefault)
  289. e.preventDefault = preventDefault;
  290. listeners = listeners.slice();
  291. for (var i = 0; i < listeners.length; i++) {
  292. listeners[i](e, this);
  293. if (e.propagationStopped)
  294. break;
  295. }
  296. if (defaultHandler && !e.defaultPrevented)
  297. return defaultHandler(e, this);
  298. };
  299. EventEmitter._signal = function (eventName, e) {
  300. var listeners = (this._eventRegistry || {})[eventName];
  301. if (!listeners)
  302. return;
  303. listeners = listeners.slice();
  304. for (var i = 0; i < listeners.length; i++)
  305. listeners[i](e, this);
  306. };
  307. EventEmitter.once = function (eventName, callback) {
  308. var _self = this;
  309. this.on(eventName, function newCallback() {
  310. _self.off(eventName, newCallback);
  311. callback.apply(null, arguments);
  312. });
  313. if (!callback) {
  314. return new Promise(function (resolve) {
  315. callback = resolve;
  316. });
  317. }
  318. };
  319. EventEmitter.setDefaultHandler = function (eventName, callback) {
  320. var handlers = this._defaultHandlers;
  321. if (!handlers)
  322. handlers = this._defaultHandlers = { _disabled_: {} };
  323. if (handlers[eventName]) {
  324. var old = handlers[eventName];
  325. var disabled = handlers._disabled_[eventName];
  326. if (!disabled)
  327. handlers._disabled_[eventName] = disabled = [];
  328. disabled.push(old);
  329. var i = disabled.indexOf(callback);
  330. if (i != -1)
  331. disabled.splice(i, 1);
  332. }
  333. handlers[eventName] = callback;
  334. };
  335. EventEmitter.removeDefaultHandler = function (eventName, callback) {
  336. var handlers = this._defaultHandlers;
  337. if (!handlers)
  338. return;
  339. var disabled = handlers._disabled_[eventName];
  340. if (handlers[eventName] == callback) {
  341. if (disabled)
  342. this.setDefaultHandler(eventName, disabled.pop());
  343. }
  344. else if (disabled) {
  345. var i = disabled.indexOf(callback);
  346. if (i != -1)
  347. disabled.splice(i, 1);
  348. }
  349. };
  350. EventEmitter.on =
  351. EventEmitter.addEventListener = function (eventName, callback, capturing) {
  352. this._eventRegistry = this._eventRegistry || {};
  353. var listeners = this._eventRegistry[eventName];
  354. if (!listeners)
  355. listeners = this._eventRegistry[eventName] = [];
  356. if (listeners.indexOf(callback) == -1)
  357. listeners[capturing ? "unshift" : "push"](callback);
  358. return callback;
  359. };
  360. EventEmitter.off =
  361. EventEmitter.removeListener =
  362. EventEmitter.removeEventListener = function (eventName, callback) {
  363. this._eventRegistry = this._eventRegistry || {};
  364. var listeners = this._eventRegistry[eventName];
  365. if (!listeners)
  366. return;
  367. var index = listeners.indexOf(callback);
  368. if (index !== -1)
  369. listeners.splice(index, 1);
  370. };
  371. EventEmitter.removeAllListeners = function (eventName) {
  372. if (!eventName)
  373. this._eventRegistry = this._defaultHandlers = undefined;
  374. if (this._eventRegistry)
  375. this._eventRegistry[eventName] = undefined;
  376. if (this._defaultHandlers)
  377. this._defaultHandlers[eventName] = undefined;
  378. };
  379. exports.EventEmitter = EventEmitter;
  380. });
  381. ace.define("ace/range",[], function(require, exports, module){"use strict";
  382. var comparePoints = function (p1, p2) {
  383. return p1.row - p2.row || p1.column - p2.column;
  384. };
  385. var Range = function (startRow, startColumn, endRow, endColumn) {
  386. this.start = {
  387. row: startRow,
  388. column: startColumn
  389. };
  390. this.end = {
  391. row: endRow,
  392. column: endColumn
  393. };
  394. };
  395. (function () {
  396. this.isEqual = function (range) {
  397. return this.start.row === range.start.row &&
  398. this.end.row === range.end.row &&
  399. this.start.column === range.start.column &&
  400. this.end.column === range.end.column;
  401. };
  402. this.toString = function () {
  403. return ("Range: [" + this.start.row + "/" + this.start.column +
  404. "] -> [" + this.end.row + "/" + this.end.column + "]");
  405. };
  406. this.contains = function (row, column) {
  407. return this.compare(row, column) == 0;
  408. };
  409. this.compareRange = function (range) {
  410. var cmp, end = range.end, start = range.start;
  411. cmp = this.compare(end.row, end.column);
  412. if (cmp == 1) {
  413. cmp = this.compare(start.row, start.column);
  414. if (cmp == 1) {
  415. return 2;
  416. }
  417. else if (cmp == 0) {
  418. return 1;
  419. }
  420. else {
  421. return 0;
  422. }
  423. }
  424. else if (cmp == -1) {
  425. return -2;
  426. }
  427. else {
  428. cmp = this.compare(start.row, start.column);
  429. if (cmp == -1) {
  430. return -1;
  431. }
  432. else if (cmp == 1) {
  433. return 42;
  434. }
  435. else {
  436. return 0;
  437. }
  438. }
  439. };
  440. this.comparePoint = function (p) {
  441. return this.compare(p.row, p.column);
  442. };
  443. this.containsRange = function (range) {
  444. return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
  445. };
  446. this.intersects = function (range) {
  447. var cmp = this.compareRange(range);
  448. return (cmp == -1 || cmp == 0 || cmp == 1);
  449. };
  450. this.isEnd = function (row, column) {
  451. return this.end.row == row && this.end.column == column;
  452. };
  453. this.isStart = function (row, column) {
  454. return this.start.row == row && this.start.column == column;
  455. };
  456. this.setStart = function (row, column) {
  457. if (typeof row == "object") {
  458. this.start.column = row.column;
  459. this.start.row = row.row;
  460. }
  461. else {
  462. this.start.row = row;
  463. this.start.column = column;
  464. }
  465. };
  466. this.setEnd = function (row, column) {
  467. if (typeof row == "object") {
  468. this.end.column = row.column;
  469. this.end.row = row.row;
  470. }
  471. else {
  472. this.end.row = row;
  473. this.end.column = column;
  474. }
  475. };
  476. this.inside = function (row, column) {
  477. if (this.compare(row, column) == 0) {
  478. if (this.isEnd(row, column) || this.isStart(row, column)) {
  479. return false;
  480. }
  481. else {
  482. return true;
  483. }
  484. }
  485. return false;
  486. };
  487. this.insideStart = function (row, column) {
  488. if (this.compare(row, column) == 0) {
  489. if (this.isEnd(row, column)) {
  490. return false;
  491. }
  492. else {
  493. return true;
  494. }
  495. }
  496. return false;
  497. };
  498. this.insideEnd = function (row, column) {
  499. if (this.compare(row, column) == 0) {
  500. if (this.isStart(row, column)) {
  501. return false;
  502. }
  503. else {
  504. return true;
  505. }
  506. }
  507. return false;
  508. };
  509. this.compare = function (row, column) {
  510. if (!this.isMultiLine()) {
  511. if (row === this.start.row) {
  512. return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
  513. }
  514. }
  515. if (row < this.start.row)
  516. return -1;
  517. if (row > this.end.row)
  518. return 1;
  519. if (this.start.row === row)
  520. return column >= this.start.column ? 0 : -1;
  521. if (this.end.row === row)
  522. return column <= this.end.column ? 0 : 1;
  523. return 0;
  524. };
  525. this.compareStart = function (row, column) {
  526. if (this.start.row == row && this.start.column == column) {
  527. return -1;
  528. }
  529. else {
  530. return this.compare(row, column);
  531. }
  532. };
  533. this.compareEnd = function (row, column) {
  534. if (this.end.row == row && this.end.column == column) {
  535. return 1;
  536. }
  537. else {
  538. return this.compare(row, column);
  539. }
  540. };
  541. this.compareInside = function (row, column) {
  542. if (this.end.row == row && this.end.column == column) {
  543. return 1;
  544. }
  545. else if (this.start.row == row && this.start.column == column) {
  546. return -1;
  547. }
  548. else {
  549. return this.compare(row, column);
  550. }
  551. };
  552. this.clipRows = function (firstRow, lastRow) {
  553. if (this.end.row > lastRow)
  554. var end = { row: lastRow + 1, column: 0 };
  555. else if (this.end.row < firstRow)
  556. var end = { row: firstRow, column: 0 };
  557. if (this.start.row > lastRow)
  558. var start = { row: lastRow + 1, column: 0 };
  559. else if (this.start.row < firstRow)
  560. var start = { row: firstRow, column: 0 };
  561. return Range.fromPoints(start || this.start, end || this.end);
  562. };
  563. this.extend = function (row, column) {
  564. var cmp = this.compare(row, column);
  565. if (cmp == 0)
  566. return this;
  567. else if (cmp == -1)
  568. var start = { row: row, column: column };
  569. else
  570. var end = { row: row, column: column };
  571. return Range.fromPoints(start || this.start, end || this.end);
  572. };
  573. this.isEmpty = function () {
  574. return (this.start.row === this.end.row && this.start.column === this.end.column);
  575. };
  576. this.isMultiLine = function () {
  577. return (this.start.row !== this.end.row);
  578. };
  579. this.clone = function () {
  580. return Range.fromPoints(this.start, this.end);
  581. };
  582. this.collapseRows = function () {
  583. if (this.end.column == 0)
  584. return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0);
  585. else
  586. return new Range(this.start.row, 0, this.end.row, 0);
  587. };
  588. this.toScreenRange = function (session) {
  589. var screenPosStart = session.documentToScreenPosition(this.start);
  590. var screenPosEnd = session.documentToScreenPosition(this.end);
  591. return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column);
  592. };
  593. this.moveBy = function (row, column) {
  594. this.start.row += row;
  595. this.start.column += column;
  596. this.end.row += row;
  597. this.end.column += column;
  598. };
  599. }).call(Range.prototype);
  600. Range.fromPoints = function (start, end) {
  601. return new Range(start.row, start.column, end.row, end.column);
  602. };
  603. Range.comparePoints = comparePoints;
  604. Range.comparePoints = function (p1, p2) {
  605. return p1.row - p2.row || p1.column - p2.column;
  606. };
  607. exports.Range = Range;
  608. });
  609. ace.define("ace/anchor",[], function(require, exports, module){"use strict";
  610. var oop = require("./lib/oop");
  611. var EventEmitter = require("./lib/event_emitter").EventEmitter;
  612. var Anchor = exports.Anchor = function (doc, row, column) {
  613. this.$onChange = this.onChange.bind(this);
  614. this.attach(doc);
  615. if (typeof column == "undefined")
  616. this.setPosition(row.row, row.column);
  617. else
  618. this.setPosition(row, column);
  619. };
  620. (function () {
  621. oop.implement(this, EventEmitter);
  622. this.getPosition = function () {
  623. return this.$clipPositionToDocument(this.row, this.column);
  624. };
  625. this.getDocument = function () {
  626. return this.document;
  627. };
  628. this.$insertRight = false;
  629. this.onChange = function (delta) {
  630. if (delta.start.row == delta.end.row && delta.start.row != this.row)
  631. return;
  632. if (delta.start.row > this.row)
  633. return;
  634. var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);
  635. this.setPosition(point.row, point.column, true);
  636. };
  637. function $pointsInOrder(point1, point2, equalPointsInOrder) {
  638. var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
  639. return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
  640. }
  641. function $getTransformedPoint(delta, point, moveIfEqual) {
  642. var deltaIsInsert = delta.action == "insert";
  643. var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
  644. var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
  645. var deltaStart = delta.start;
  646. var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
  647. if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
  648. return {
  649. row: point.row,
  650. column: point.column
  651. };
  652. }
  653. if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
  654. return {
  655. row: point.row + deltaRowShift,
  656. column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
  657. };
  658. }
  659. return {
  660. row: deltaStart.row,
  661. column: deltaStart.column
  662. };
  663. }
  664. this.setPosition = function (row, column, noClip) {
  665. var pos;
  666. if (noClip) {
  667. pos = {
  668. row: row,
  669. column: column
  670. };
  671. }
  672. else {
  673. pos = this.$clipPositionToDocument(row, column);
  674. }
  675. if (this.row == pos.row && this.column == pos.column)
  676. return;
  677. var old = {
  678. row: this.row,
  679. column: this.column
  680. };
  681. this.row = pos.row;
  682. this.column = pos.column;
  683. this._signal("change", {
  684. old: old,
  685. value: pos
  686. });
  687. };
  688. this.detach = function () {
  689. this.document.off("change", this.$onChange);
  690. };
  691. this.attach = function (doc) {
  692. this.document = doc || this.document;
  693. this.document.on("change", this.$onChange);
  694. };
  695. this.$clipPositionToDocument = function (row, column) {
  696. var pos = {};
  697. if (row >= this.document.getLength()) {
  698. pos.row = Math.max(0, this.document.getLength() - 1);
  699. pos.column = this.document.getLine(pos.row).length;
  700. }
  701. else if (row < 0) {
  702. pos.row = 0;
  703. pos.column = 0;
  704. }
  705. else {
  706. pos.row = row;
  707. pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
  708. }
  709. if (column < 0)
  710. pos.column = 0;
  711. return pos;
  712. };
  713. }).call(Anchor.prototype);
  714. });
  715. ace.define("ace/document",[], function(require, exports, module){"use strict";
  716. var oop = require("./lib/oop");
  717. var applyDelta = require("./apply_delta").applyDelta;
  718. var EventEmitter = require("./lib/event_emitter").EventEmitter;
  719. var Range = require("./range").Range;
  720. var Anchor = require("./anchor").Anchor;
  721. var Document = function (textOrLines) {
  722. this.$lines = [""];
  723. if (textOrLines.length === 0) {
  724. this.$lines = [""];
  725. }
  726. else if (Array.isArray(textOrLines)) {
  727. this.insertMergedLines({ row: 0, column: 0 }, textOrLines);
  728. }
  729. else {
  730. this.insert({ row: 0, column: 0 }, textOrLines);
  731. }
  732. };
  733. (function () {
  734. oop.implement(this, EventEmitter);
  735. this.setValue = function (text) {
  736. var len = this.getLength() - 1;
  737. this.remove(new Range(0, 0, len, this.getLine(len).length));
  738. this.insert({ row: 0, column: 0 }, text);
  739. };
  740. this.getValue = function () {
  741. return this.getAllLines().join(this.getNewLineCharacter());
  742. };
  743. this.createAnchor = function (row, column) {
  744. return new Anchor(this, row, column);
  745. };
  746. if ("aaa".split(/a/).length === 0) {
  747. this.$split = function (text) {
  748. return text.replace(/\r\n|\r/g, "\n").split("\n");
  749. };
  750. }
  751. else {
  752. this.$split = function (text) {
  753. return text.split(/\r\n|\r|\n/);
  754. };
  755. }
  756. this.$detectNewLine = function (text) {
  757. var match = text.match(/^.*?(\r\n|\r|\n)/m);
  758. this.$autoNewLine = match ? match[1] : "\n";
  759. this._signal("changeNewLineMode");
  760. };
  761. this.getNewLineCharacter = function () {
  762. switch (this.$newLineMode) {
  763. case "windows":
  764. return "\r\n";
  765. case "unix":
  766. return "\n";
  767. default:
  768. return this.$autoNewLine || "\n";
  769. }
  770. };
  771. this.$autoNewLine = "";
  772. this.$newLineMode = "auto";
  773. this.setNewLineMode = function (newLineMode) {
  774. if (this.$newLineMode === newLineMode)
  775. return;
  776. this.$newLineMode = newLineMode;
  777. this._signal("changeNewLineMode");
  778. };
  779. this.getNewLineMode = function () {
  780. return this.$newLineMode;
  781. };
  782. this.isNewLine = function (text) {
  783. return (text == "\r\n" || text == "\r" || text == "\n");
  784. };
  785. this.getLine = function (row) {
  786. return this.$lines[row] || "";
  787. };
  788. this.getLines = function (firstRow, lastRow) {
  789. return this.$lines.slice(firstRow, lastRow + 1);
  790. };
  791. this.getAllLines = function () {
  792. return this.getLines(0, this.getLength());
  793. };
  794. this.getLength = function () {
  795. return this.$lines.length;
  796. };
  797. this.getTextRange = function (range) {
  798. return this.getLinesForRange(range).join(this.getNewLineCharacter());
  799. };
  800. this.getLinesForRange = function (range) {
  801. var lines;
  802. if (range.start.row === range.end.row) {
  803. lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
  804. }
  805. else {
  806. lines = this.getLines(range.start.row, range.end.row);
  807. lines[0] = (lines[0] || "").substring(range.start.column);
  808. var l = lines.length - 1;
  809. if (range.end.row - range.start.row == l)
  810. lines[l] = lines[l].substring(0, range.end.column);
  811. }
  812. return lines;
  813. };
  814. this.insertLines = function (row, lines) {
  815. console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
  816. return this.insertFullLines(row, lines);
  817. };
  818. this.removeLines = function (firstRow, lastRow) {
  819. console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
  820. return this.removeFullLines(firstRow, lastRow);
  821. };
  822. this.insertNewLine = function (position) {
  823. console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");
  824. return this.insertMergedLines(position, ["", ""]);
  825. };
  826. this.insert = function (position, text) {
  827. if (this.getLength() <= 1)
  828. this.$detectNewLine(text);
  829. return this.insertMergedLines(position, this.$split(text));
  830. };
  831. this.insertInLine = function (position, text) {
  832. var start = this.clippedPos(position.row, position.column);
  833. var end = this.pos(position.row, position.column + text.length);
  834. this.applyDelta({
  835. start: start,
  836. end: end,
  837. action: "insert",
  838. lines: [text]
  839. }, true);
  840. return this.clonePos(end);
  841. };
  842. this.clippedPos = function (row, column) {
  843. var length = this.getLength();
  844. if (row === undefined) {
  845. row = length;
  846. }
  847. else if (row < 0) {
  848. row = 0;
  849. }
  850. else if (row >= length) {
  851. row = length - 1;
  852. column = undefined;
  853. }
  854. var line = this.getLine(row);
  855. if (column == undefined)
  856. column = line.length;
  857. column = Math.min(Math.max(column, 0), line.length);
  858. return { row: row, column: column };
  859. };
  860. this.clonePos = function (pos) {
  861. return { row: pos.row, column: pos.column };
  862. };
  863. this.pos = function (row, column) {
  864. return { row: row, column: column };
  865. };
  866. this.$clipPosition = function (position) {
  867. var length = this.getLength();
  868. if (position.row >= length) {
  869. position.row = Math.max(0, length - 1);
  870. position.column = this.getLine(length - 1).length;
  871. }
  872. else {
  873. position.row = Math.max(0, position.row);
  874. position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
  875. }
  876. return position;
  877. };
  878. this.insertFullLines = function (row, lines) {
  879. row = Math.min(Math.max(row, 0), this.getLength());
  880. var column = 0;
  881. if (row < this.getLength()) {
  882. lines = lines.concat([""]);
  883. column = 0;
  884. }
  885. else {
  886. lines = [""].concat(lines);
  887. row--;
  888. column = this.$lines[row].length;
  889. }
  890. this.insertMergedLines({ row: row, column: column }, lines);
  891. };
  892. this.insertMergedLines = function (position, lines) {
  893. var start = this.clippedPos(position.row, position.column);
  894. var end = {
  895. row: start.row + lines.length - 1,
  896. column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
  897. };
  898. this.applyDelta({
  899. start: start,
  900. end: end,
  901. action: "insert",
  902. lines: lines
  903. });
  904. return this.clonePos(end);
  905. };
  906. this.remove = function (range) {
  907. var start = this.clippedPos(range.start.row, range.start.column);
  908. var end = this.clippedPos(range.end.row, range.end.column);
  909. this.applyDelta({
  910. start: start,
  911. end: end,
  912. action: "remove",
  913. lines: this.getLinesForRange({ start: start, end: end })
  914. });
  915. return this.clonePos(start);
  916. };
  917. this.removeInLine = function (row, startColumn, endColumn) {
  918. var start = this.clippedPos(row, startColumn);
  919. var end = this.clippedPos(row, endColumn);
  920. this.applyDelta({
  921. start: start,
  922. end: end,
  923. action: "remove",
  924. lines: this.getLinesForRange({ start: start, end: end })
  925. }, true);
  926. return this.clonePos(start);
  927. };
  928. this.removeFullLines = function (firstRow, lastRow) {
  929. firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
  930. lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);
  931. var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
  932. var deleteLastNewLine = lastRow < this.getLength() - 1;
  933. var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow);
  934. var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0);
  935. var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow);
  936. var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length);
  937. var range = new Range(startRow, startCol, endRow, endCol);
  938. var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
  939. this.applyDelta({
  940. start: range.start,
  941. end: range.end,
  942. action: "remove",
  943. lines: this.getLinesForRange(range)
  944. });
  945. return deletedLines;
  946. };
  947. this.removeNewLine = function (row) {
  948. if (row < this.getLength() - 1 && row >= 0) {
  949. this.applyDelta({
  950. start: this.pos(row, this.getLine(row).length),
  951. end: this.pos(row + 1, 0),
  952. action: "remove",
  953. lines: ["", ""]
  954. });
  955. }
  956. };
  957. this.replace = function (range, text) {
  958. if (!(range instanceof Range))
  959. range = Range.fromPoints(range.start, range.end);
  960. if (text.length === 0 && range.isEmpty())
  961. return range.start;
  962. if (text == this.getTextRange(range))
  963. return range.end;
  964. this.remove(range);
  965. var end;
  966. if (text) {
  967. end = this.insert(range.start, text);
  968. }
  969. else {
  970. end = range.start;
  971. }
  972. return end;
  973. };
  974. this.applyDeltas = function (deltas) {
  975. for (var i = 0; i < deltas.length; i++) {
  976. this.applyDelta(deltas[i]);
  977. }
  978. };
  979. this.revertDeltas = function (deltas) {
  980. for (var i = deltas.length - 1; i >= 0; i--) {
  981. this.revertDelta(deltas[i]);
  982. }
  983. };
  984. this.applyDelta = function (delta, doNotValidate) {
  985. var isInsert = delta.action == "insert";
  986. if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]
  987. : !Range.comparePoints(delta.start, delta.end)) {
  988. return;
  989. }
  990. if (isInsert && delta.lines.length > 20000) {
  991. this.$splitAndapplyLargeDelta(delta, 20000);
  992. }
  993. else {
  994. applyDelta(this.$lines, delta, doNotValidate);
  995. this._signal("change", delta);
  996. }
  997. };
  998. this.$safeApplyDelta = function (delta) {
  999. var docLength = this.$lines.length;
  1000. if (delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength
  1001. || delta.action == "insert" && delta.start.row <= docLength) {
  1002. this.applyDelta(delta);
  1003. }
  1004. };
  1005. this.$splitAndapplyLargeDelta = function (delta, MAX) {
  1006. var lines = delta.lines;
  1007. var l = lines.length - MAX + 1;
  1008. var row = delta.start.row;
  1009. var column = delta.start.column;
  1010. for (var from = 0, to = 0; from < l; from = to) {
  1011. to += MAX - 1;
  1012. var chunk = lines.slice(from, to);
  1013. chunk.push("");
  1014. this.applyDelta({
  1015. start: this.pos(row + from, column),
  1016. end: this.pos(row + to, column = 0),
  1017. action: delta.action,
  1018. lines: chunk
  1019. }, true);
  1020. }
  1021. delta.lines = lines.slice(from);
  1022. delta.start.row = row + from;
  1023. delta.start.column = column;
  1024. this.applyDelta(delta, true);
  1025. };
  1026. this.revertDelta = function (delta) {
  1027. this.$safeApplyDelta({
  1028. start: this.clonePos(delta.start),
  1029. end: this.clonePos(delta.end),
  1030. action: (delta.action == "insert" ? "remove" : "insert"),
  1031. lines: delta.lines.slice()
  1032. });
  1033. };
  1034. this.indexToPosition = function (index, startRow) {
  1035. var lines = this.$lines || this.getAllLines();
  1036. var newlineLength = this.getNewLineCharacter().length;
  1037. for (var i = startRow || 0, l = lines.length; i < l; i++) {
  1038. index -= lines[i].length + newlineLength;
  1039. if (index < 0)
  1040. return { row: i, column: index + lines[i].length + newlineLength };
  1041. }
  1042. return { row: l - 1, column: index + lines[l - 1].length + newlineLength };
  1043. };
  1044. this.positionToIndex = function (pos, startRow) {
  1045. var lines = this.$lines || this.getAllLines();
  1046. var newlineLength = this.getNewLineCharacter().length;
  1047. var index = 0;
  1048. var row = Math.min(pos.row, lines.length);
  1049. for (var i = startRow || 0; i < row; ++i)
  1050. index += lines[i].length + newlineLength;
  1051. return index + pos.column;
  1052. };
  1053. }).call(Document.prototype);
  1054. exports.Document = Document;
  1055. });
  1056. ace.define("ace/lib/lang",[], function(require, exports, module){"use strict";
  1057. exports.last = function (a) {
  1058. return a[a.length - 1];
  1059. };
  1060. exports.stringReverse = function (string) {
  1061. return string.split("").reverse().join("");
  1062. };
  1063. exports.stringRepeat = function (string, count) {
  1064. var result = '';
  1065. while (count > 0) {
  1066. if (count & 1)
  1067. result += string;
  1068. if (count >>= 1)
  1069. string += string;
  1070. }
  1071. return result;
  1072. };
  1073. var trimBeginRegexp = /^\s\s*/;
  1074. var trimEndRegexp = /\s\s*$/;
  1075. exports.stringTrimLeft = function (string) {
  1076. return string.replace(trimBeginRegexp, '');
  1077. };
  1078. exports.stringTrimRight = function (string) {
  1079. return string.replace(trimEndRegexp, '');
  1080. };
  1081. exports.copyObject = function (obj) {
  1082. var copy = {};
  1083. for (var key in obj) {
  1084. copy[key] = obj[key];
  1085. }
  1086. return copy;
  1087. };
  1088. exports.copyArray = function (array) {
  1089. var copy = [];
  1090. for (var i = 0, l = array.length; i < l; i++) {
  1091. if (array[i] && typeof array[i] == "object")
  1092. copy[i] = this.copyObject(array[i]);
  1093. else
  1094. copy[i] = array[i];
  1095. }
  1096. return copy;
  1097. };
  1098. exports.deepCopy = function deepCopy(obj) {
  1099. if (typeof obj !== "object" || !obj)
  1100. return obj;
  1101. var copy;
  1102. if (Array.isArray(obj)) {
  1103. copy = [];
  1104. for (var key = 0; key < obj.length; key++) {
  1105. copy[key] = deepCopy(obj[key]);
  1106. }
  1107. return copy;
  1108. }
  1109. if (Object.prototype.toString.call(obj) !== "[object Object]")
  1110. return obj;
  1111. copy = {};
  1112. for (var key in obj)
  1113. copy[key] = deepCopy(obj[key]);
  1114. return copy;
  1115. };
  1116. exports.arrayToMap = function (arr) {
  1117. var map = {};
  1118. for (var i = 0; i < arr.length; i++) {
  1119. map[arr[i]] = 1;
  1120. }
  1121. return map;
  1122. };
  1123. exports.createMap = function (props) {
  1124. var map = Object.create(null);
  1125. for (var i in props) {
  1126. map[i] = props[i];
  1127. }
  1128. return map;
  1129. };
  1130. exports.arrayRemove = function (array, value) {
  1131. for (var i = 0; i <= array.length; i++) {
  1132. if (value === array[i]) {
  1133. array.splice(i, 1);
  1134. }
  1135. }
  1136. };
  1137. exports.escapeRegExp = function (str) {
  1138. return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
  1139. };
  1140. exports.escapeHTML = function (str) {
  1141. return ("" + str).replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
  1142. };
  1143. exports.getMatchOffsets = function (string, regExp) {
  1144. var matches = [];
  1145. string.replace(regExp, function (str) {
  1146. matches.push({
  1147. offset: arguments[arguments.length - 2],
  1148. length: str.length
  1149. });
  1150. });
  1151. return matches;
  1152. };
  1153. exports.deferredCall = function (fcn) {
  1154. var timer = null;
  1155. var callback = function () {
  1156. timer = null;
  1157. fcn();
  1158. };
  1159. var deferred = function (timeout) {
  1160. deferred.cancel();
  1161. timer = setTimeout(callback, timeout || 0);
  1162. return deferred;
  1163. };
  1164. deferred.schedule = deferred;
  1165. deferred.call = function () {
  1166. this.cancel();
  1167. fcn();
  1168. return deferred;
  1169. };
  1170. deferred.cancel = function () {
  1171. clearTimeout(timer);
  1172. timer = null;
  1173. return deferred;
  1174. };
  1175. deferred.isPending = function () {
  1176. return timer;
  1177. };
  1178. return deferred;
  1179. };
  1180. exports.delayedCall = function (fcn, defaultTimeout) {
  1181. var timer = null;
  1182. var callback = function () {
  1183. timer = null;
  1184. fcn();
  1185. };
  1186. var _self = function (timeout) {
  1187. if (timer == null)
  1188. timer = setTimeout(callback, timeout || defaultTimeout);
  1189. };
  1190. _self.delay = function (timeout) {
  1191. timer && clearTimeout(timer);
  1192. timer = setTimeout(callback, timeout || defaultTimeout);
  1193. };
  1194. _self.schedule = _self;
  1195. _self.call = function () {
  1196. this.cancel();
  1197. fcn();
  1198. };
  1199. _self.cancel = function () {
  1200. timer && clearTimeout(timer);
  1201. timer = null;
  1202. };
  1203. _self.isPending = function () {
  1204. return timer;
  1205. };
  1206. return _self;
  1207. };
  1208. });
  1209. ace.define("ace/worker/mirror",[], function(require, exports, module) {
  1210. "use strict";
  1211. var Document = require("../document").Document;
  1212. var lang = require("../lib/lang");
  1213. var Mirror = exports.Mirror = function(sender) {
  1214. this.sender = sender;
  1215. var doc = this.doc = new Document("");
  1216. var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this));
  1217. var _self = this;
  1218. sender.on("change", function(e) {
  1219. var data = e.data;
  1220. if (data[0].start) {
  1221. doc.applyDeltas(data);
  1222. } else {
  1223. for (var i = 0; i < data.length; i += 2) {
  1224. var d, err;
  1225. if (Array.isArray(data[i+1])) {
  1226. d = {action: "insert", start: data[i], lines: data[i+1]};
  1227. } else {
  1228. d = {action: "remove", start: data[i], end: data[i+1]};
  1229. }
  1230. if ((d.action == "insert" ? d.start : d.end).row >= doc.$lines.length) {
  1231. err = new Error("Invalid delta");
  1232. err.data = {
  1233. path: _self.$path,
  1234. linesLength: doc.$lines.length,
  1235. start: d.start,
  1236. end: d.end
  1237. };
  1238. throw err;
  1239. }
  1240. doc.applyDelta(d, true);
  1241. }
  1242. }
  1243. if (_self.$timeout)
  1244. return deferredUpdate.schedule(_self.$timeout);
  1245. _self.onUpdate();
  1246. });
  1247. };
  1248. (function() {
  1249. this.$timeout = 500;
  1250. this.setTimeout = function(timeout) {
  1251. this.$timeout = timeout;
  1252. };
  1253. this.setValue = function(value) {
  1254. this.doc.setValue(value);
  1255. this.deferredUpdate.schedule(this.$timeout);
  1256. };
  1257. this.getValue = function(callbackId) {
  1258. this.sender.callback(this.doc.getValue(), callbackId);
  1259. };
  1260. this.onUpdate = function() {
  1261. };
  1262. this.isPending = function() {
  1263. return this.deferredUpdate.isPending();
  1264. };
  1265. }).call(Mirror.prototype);
  1266. });
  1267. ace.define("ace/mode/php/php",[], function (require, exports, module) {
  1268. var PHP = {Constants: {}};
  1269. PHP.Constants.T_THROW = 317
  1270. PHP.Constants.T_INCLUDE = 272
  1271. PHP.Constants.T_INCLUDE_ONCE = 273
  1272. PHP.Constants.T_EVAL = 274
  1273. PHP.Constants.T_REQUIRE = 275
  1274. PHP.Constants.T_REQUIRE_ONCE = 276
  1275. PHP.Constants.T_LOGICAL_OR = 277
  1276. PHP.Constants.T_LOGICAL_XOR = 278
  1277. PHP.Constants.T_LOGICAL_AND = 279
  1278. PHP.Constants.T_PRINT = 280
  1279. PHP.Constants.T_YIELD = 281
  1280. PHP.Constants.T_DOUBLE_ARROW = 386
  1281. PHP.Constants.T_YIELD_FROM = 282
  1282. PHP.Constants.T_PLUS_EQUAL = 352
  1283. PHP.Constants.T_MINUS_EQUAL = 353
  1284. PHP.Constants.T_MUL_EQUAL = 354
  1285. PHP.Constants.T_DIV_EQUAL = 355
  1286. PHP.Constants.T_CONCAT_EQUAL = 356
  1287. PHP.Constants.T_MOD_EQUAL = 357
  1288. PHP.Constants.T_AND_EQUAL = 358
  1289. PHP.Constants.T_OR_EQUAL = 359
  1290. PHP.Constants.T_XOR_EQUAL = 360
  1291. PHP.Constants.T_SL_EQUAL = 361
  1292. PHP.Constants.T_SR_EQUAL = 362
  1293. PHP.Constants.T_POW_EQUAL = 402
  1294. PHP.Constants.T_COALESCE_EQUAL = 363
  1295. PHP.Constants.T_COALESCE = 400
  1296. PHP.Constants.T_BOOLEAN_OR = 364
  1297. PHP.Constants.T_BOOLEAN_AND = 365
  1298. PHP.Constants.T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 404
  1299. PHP.Constants.T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 403
  1300. PHP.Constants.T_IS_EQUAL = 366
  1301. PHP.Constants.T_IS_NOT_EQUAL = 367
  1302. PHP.Constants.T_IS_IDENTICAL = 368
  1303. PHP.Constants.T_IS_NOT_IDENTICAL = 369
  1304. PHP.Constants.T_SPACESHIP = 372
  1305. PHP.Constants.T_IS_SMALLER_OR_EQUAL = 370
  1306. PHP.Constants.T_IS_GREATER_OR_EQUAL = 371
  1307. PHP.Constants.T_SL = 373
  1308. PHP.Constants.T_SR = 374
  1309. PHP.Constants.T_INSTANCEOF = 283
  1310. PHP.Constants.T_INC = 375
  1311. PHP.Constants.T_DEC = 376
  1312. PHP.Constants.T_INT_CAST = 377
  1313. PHP.Constants.T_DOUBLE_CAST = 378
  1314. PHP.Constants.T_STRING_CAST = 379
  1315. PHP.Constants.T_ARRAY_CAST = 380
  1316. PHP.Constants.T_OBJECT_CAST = 381
  1317. PHP.Constants.T_BOOL_CAST = 382
  1318. PHP.Constants.T_UNSET_CAST = 383
  1319. PHP.Constants.T_POW = 401
  1320. PHP.Constants.T_NEW = 284
  1321. PHP.Constants.T_CLONE = 285
  1322. PHP.Constants.T_EXIT = 286
  1323. PHP.Constants.T_IF = 287
  1324. PHP.Constants.T_ELSEIF = 288
  1325. PHP.Constants.T_ELSE = 289
  1326. PHP.Constants.T_ENDIF = 290
  1327. PHP.Constants.T_LNUMBER = 260
  1328. PHP.Constants.T_DNUMBER = 261
  1329. PHP.Constants.T_STRING = 262
  1330. PHP.Constants.T_STRING_VARNAME = 270
  1331. PHP.Constants.T_VARIABLE = 266
  1332. PHP.Constants.T_NUM_STRING = 271
  1333. PHP.Constants.T_INLINE_HTML = 267
  1334. PHP.Constants.T_ENCAPSED_AND_WHITESPACE = 268
  1335. PHP.Constants.T_CONSTANT_ENCAPSED_STRING = 269
  1336. PHP.Constants.T_ECHO = 291
  1337. PHP.Constants.T_DO = 292
  1338. PHP.Constants.T_WHILE = 293
  1339. PHP.Constants.T_ENDWHILE = 294
  1340. PHP.Constants.T_FOR = 295
  1341. PHP.Constants.T_ENDFOR = 296
  1342. PHP.Constants.T_FOREACH = 297
  1343. PHP.Constants.T_ENDFOREACH = 298
  1344. PHP.Constants.T_DECLARE = 299
  1345. PHP.Constants.T_ENDDECLARE = 300
  1346. PHP.Constants.T_AS = 301
  1347. PHP.Constants.T_SWITCH = 302
  1348. PHP.Constants.T_MATCH = 306
  1349. PHP.Constants.T_ENDSWITCH = 303
  1350. PHP.Constants.T_CASE = 304
  1351. PHP.Constants.T_DEFAULT = 305
  1352. PHP.Constants.T_BREAK = 307
  1353. PHP.Constants.T_CONTINUE = 308
  1354. PHP.Constants.T_GOTO = 309
  1355. PHP.Constants.T_FUNCTION = 310
  1356. PHP.Constants.T_FN = 311
  1357. PHP.Constants.T_CONST = 312
  1358. PHP.Constants.T_RETURN = 313
  1359. PHP.Constants.T_TRY = 314
  1360. PHP.Constants.T_CATCH = 315
  1361. PHP.Constants.T_FINALLY = 316
  1362. PHP.Constants.T_THROW = 317
  1363. PHP.Constants.T_USE = 318
  1364. PHP.Constants.T_INSTEADOF = 319
  1365. PHP.Constants.T_GLOBAL = 320
  1366. PHP.Constants.T_STATIC = 321
  1367. PHP.Constants.T_ABSTRACT = 322
  1368. PHP.Constants.T_FINAL = 323
  1369. PHP.Constants.T_PRIVATE = 324
  1370. PHP.Constants.T_PROTECTED = 325
  1371. PHP.Constants.T_PUBLIC = 326
  1372. PHP.Constants.T_READONLY = 327
  1373. PHP.Constants.T_VAR = 328
  1374. PHP.Constants.T_UNSET = 329
  1375. PHP.Constants.T_ISSET = 330
  1376. PHP.Constants.T_EMPTY = 331
  1377. PHP.Constants.T_HALT_COMPILER = 332
  1378. PHP.Constants.T_CLASS = 333
  1379. PHP.Constants.T_TRAIT = 334
  1380. PHP.Constants.T_INTERFACE = 335
  1381. PHP.Constants.T_ENUM = 336
  1382. PHP.Constants.T_EXTENDS = 337
  1383. PHP.Constants.T_IMPLEMENTS = 338
  1384. PHP.Constants.T_OBJECT_OPERATOR = 384
  1385. PHP.Constants.T_NULLSAFE_OBJECT_OPERATOR = 385
  1386. PHP.Constants.T_DOUBLE_ARROW = 386
  1387. PHP.Constants.T_LIST = 340
  1388. PHP.Constants.T_ARRAY = 341
  1389. PHP.Constants.T_CALLABLE = 342
  1390. PHP.Constants.T_CLASS_C = 346
  1391. PHP.Constants.T_TRAIT_C = 347
  1392. PHP.Constants.T_METHOD_C = 348
  1393. PHP.Constants.T_FUNC_C = 349
  1394. PHP.Constants.T_LINE = 343
  1395. PHP.Constants.T_FILE = 344
  1396. PHP.Constants.T_START_HEREDOC = 393
  1397. PHP.Constants.T_END_HEREDOC = 394
  1398. PHP.Constants.T_DOLLAR_OPEN_CURLY_BRACES = 395
  1399. PHP.Constants.T_CURLY_OPEN = 396
  1400. PHP.Constants.T_PAAMAYIM_NEKUDOTAYIM = 397
  1401. PHP.Constants.T_NAMESPACE = 339
  1402. PHP.Constants.T_NS_C = 350
  1403. PHP.Constants.T_DIR = 345
  1404. PHP.Constants.T_NS_SEPARATOR = 398
  1405. PHP.Constants.T_ELLIPSIS = 399
  1406. PHP.Constants.T_NAME_FULLY_QUALIFIED = 263
  1407. PHP.Constants.T_NAME_QUALIFIED = 265
  1408. PHP.Constants.T_NAME_RELATIVE = 264
  1409. PHP.Constants.T_ATTRIBUTE = 351
  1410. PHP.Constants.T_ENUM = 336
  1411. PHP.Constants.T_BAD_CHARACTER = 405
  1412. PHP.Constants.T_COMMENT = 387
  1413. PHP.Constants.T_DOC_COMMENT = 388
  1414. PHP.Constants.T_OPEN_TAG = 389
  1415. PHP.Constants.T_OPEN_TAG_WITH_ECHO = 390
  1416. PHP.Constants.T_CLOSE_TAG = 391
  1417. PHP.Constants.T_WHITESPACE = 392
  1418. PHP.Lexer = function (src, ini) {
  1419. var heredoc, heredocEndAllowed,
  1420. stateStack = ['INITIAL'], stackPos = 0,
  1421. swapState = function (state) {
  1422. stateStack[stackPos] = state;
  1423. },
  1424. pushState = function (state) {
  1425. stateStack[++stackPos] = state;
  1426. },
  1427. popState = function () {
  1428. --stackPos;
  1429. },
  1430. shortOpenTag = ini === undefined || /^(on|true|1)$/i.test(ini.short_open_tag),
  1431. openTag = shortOpenTag
  1432. ? /^(\<\?php(?:\r\n|[ \t\r\n])|<\?|\<script language\=('|")?php('|")?\>)/i
  1433. : /^(\<\?php(?:\r\n|[ \t\r\n])|\<script language\=('|")?php('|")?\>)/i,
  1434. inlineHtml = shortOpenTag
  1435. ? /[^<]*(?:<(?!\?|script language\=('|")?php('|")?\>)[^<]*)*/i
  1436. : /[^<]*(?:<(?!\?=|\?php[ \t\r\n]|script language\=('|")?php('|")?\>)[^<]*)*/i,
  1437. labelRegexPart = '[a-zA-Z_\\x7f-\\uffff][a-zA-Z0-9_\\x7f-\\uffff]*',
  1438. stringRegexPart = function (quote) {
  1439. return '[^' + quote + '\\\\${]*(?:(?:\\\\[\\s\\S]|\\$(?!\\{|[a-zA-Z_\\x7f-\\uffff])|\\{(?!\\$))[^' + quote + '\\\\${]*)*';
  1440. },
  1441. sharedStringTokens = [
  1442. {
  1443. value: PHP.Constants.T_VARIABLE,
  1444. re: new RegExp('^\\$' + labelRegexPart + '(?=\\[)'),
  1445. func: function () {
  1446. pushState('VAR_OFFSET');
  1447. }
  1448. },
  1449. {
  1450. value: PHP.Constants.T_VARIABLE,
  1451. re: new RegExp('^\\$' + labelRegexPart + '(?=->' + labelRegexPart + ')'),
  1452. func: function () {
  1453. pushState('LOOKING_FOR_PROPERTY');
  1454. }
  1455. },
  1456. {
  1457. value: PHP.Constants.T_DOLLAR_OPEN_CURLY_BRACES,
  1458. re: new RegExp('^\\$\\{(?=' + labelRegexPart + '[\\[}])'),
  1459. func: function () {
  1460. pushState('LOOKING_FOR_VARNAME');
  1461. }
  1462. },
  1463. {
  1464. value: PHP.Constants.T_VARIABLE,
  1465. re: new RegExp('^\\$' + labelRegexPart)
  1466. },
  1467. {
  1468. value: PHP.Constants.T_DOLLAR_OPEN_CURLY_BRACES,
  1469. re: /^\$\{/,
  1470. func: function () {
  1471. pushState('IN_SCRIPTING');
  1472. }
  1473. },
  1474. {
  1475. value: PHP.Constants.T_CURLY_OPEN,
  1476. re: /^\{(?=\$)/,
  1477. func: function () {
  1478. pushState('IN_SCRIPTING');
  1479. }
  1480. }
  1481. ],
  1482. data = {
  1483. 'INITIAL': [
  1484. {
  1485. value: PHP.Constants.T_OPEN_TAG_WITH_ECHO,
  1486. re: /^<\?=/i,
  1487. func: function () {
  1488. swapState('IN_SCRIPTING');
  1489. }
  1490. },
  1491. {
  1492. value: PHP.Constants.T_OPEN_TAG,
  1493. re: openTag,
  1494. func: function () {
  1495. swapState('IN_SCRIPTING');
  1496. }
  1497. },
  1498. {
  1499. value: PHP.Constants.T_INLINE_HTML,
  1500. re: inlineHtml
  1501. },
  1502. ],
  1503. 'IN_SCRIPTING': [
  1504. {
  1505. value: PHP.Constants.T_WHITESPACE,
  1506. re: /^[ \n\r\t]+/
  1507. },
  1508. {
  1509. value: PHP.Constants.T_ABSTRACT,
  1510. re: /^abstract\b/i
  1511. },
  1512. {
  1513. value: PHP.Constants.T_LOGICAL_AND,
  1514. re: /^and\b/i
  1515. },
  1516. {
  1517. value: PHP.Constants.T_ARRAY,
  1518. re: /^array\b/i
  1519. },
  1520. {
  1521. value: PHP.Constants.T_AS,
  1522. re: /^as\b/i
  1523. },
  1524. {
  1525. value: PHP.Constants.T_BREAK,
  1526. re: /^break\b/i
  1527. },
  1528. {
  1529. value: PHP.Constants.T_CALLABLE,
  1530. re: /^callable\b/i
  1531. },
  1532. {
  1533. value: PHP.Constants.T_CASE,
  1534. re: /^case\b/i
  1535. },
  1536. {
  1537. value: PHP.Constants.T_CATCH,
  1538. re: /^catch\b/i
  1539. },
  1540. {
  1541. value: PHP.Constants.T_CLASS,
  1542. re: /^class\b/i,
  1543. },
  1544. {
  1545. value: PHP.Constants.T_CLONE,
  1546. re: /^clone\b/i
  1547. },
  1548. {
  1549. value: PHP.Constants.T_CONST,
  1550. re: /^const\b/i
  1551. },
  1552. {
  1553. value: PHP.Constants.T_CONTINUE,
  1554. re: /^continue\b/i
  1555. },
  1556. {
  1557. value: PHP.Constants.T_DECLARE,
  1558. re: /^declare\b/i
  1559. },
  1560. {
  1561. value: PHP.Constants.T_DEFAULT,
  1562. re: /^default\b/i
  1563. },
  1564. {
  1565. value: PHP.Constants.T_DO,
  1566. re: /^do\b/i
  1567. },
  1568. {
  1569. value: PHP.Constants.T_ECHO,
  1570. re: /^echo\b/i
  1571. },
  1572. {
  1573. value: PHP.Constants.T_ELSE,
  1574. re: /^else\b/i
  1575. },
  1576. {
  1577. value: PHP.Constants.T_ELSEIF,
  1578. re: /^elseif\b/i
  1579. },
  1580. {
  1581. value: PHP.Constants.T_ENUM,
  1582. re: /^enum\b/i
  1583. },
  1584. {
  1585. value: PHP.Constants.T_ENDDECLARE,
  1586. re: /^enddeclare\b/i
  1587. },
  1588. {
  1589. value: PHP.Constants.T_ENDFOR,
  1590. re: /^endfor\b/i
  1591. },
  1592. {
  1593. value: PHP.Constants.T_ENDFOREACH,
  1594. re: /^endforeach\b/i
  1595. },
  1596. {
  1597. value: PHP.Constants.T_ENDIF,
  1598. re: /^endif\b/i
  1599. },
  1600. {
  1601. value: PHP.Constants.T_ENDSWITCH,
  1602. re: /^endswitch\b/i
  1603. },
  1604. {
  1605. value: PHP.Constants.T_ENDWHILE,
  1606. re: /^endwhile\b/i
  1607. },
  1608. {
  1609. value: PHP.Constants.T_ENUM,
  1610. re: /^enum\b/i
  1611. },
  1612. {
  1613. value: PHP.Constants.T_EMPTY,
  1614. re: /^empty\b/i
  1615. },
  1616. {
  1617. value: PHP.Constants.T_EVAL,
  1618. re: /^eval\b/i
  1619. },
  1620. {
  1621. value: PHP.Constants.T_EXIT,
  1622. re: /^(?:exit|die)\b/i
  1623. },
  1624. {
  1625. value: PHP.Constants.T_EXTENDS,
  1626. re: /^extends\b/i
  1627. },
  1628. {
  1629. value: PHP.Constants.T_FINAL,
  1630. re: /^final\b/i
  1631. },
  1632. {
  1633. value: PHP.Constants.T_FINALLY,
  1634. re: /^finally\b/i
  1635. },
  1636. {
  1637. value: PHP.Constants.T_FN,
  1638. re: /^fn\b/i
  1639. },
  1640. {
  1641. value: PHP.Constants.T_FOR,
  1642. re: /^for\b/i
  1643. },
  1644. {
  1645. value: PHP.Constants.T_FOREACH,
  1646. re: /^foreach\b/i
  1647. },
  1648. {
  1649. value: PHP.Constants.T_FUNCTION,
  1650. re: /^function\b/i
  1651. },
  1652. {
  1653. value: PHP.Constants.T_GLOBAL,
  1654. re: /^global\b/i
  1655. },
  1656. {
  1657. value: PHP.Constants.T_GOTO,
  1658. re: /^goto\b/i
  1659. },
  1660. {
  1661. value: PHP.Constants.T_IF,
  1662. re: /^if\b/i
  1663. },
  1664. {
  1665. value: PHP.Constants.T_IMPLEMENTS,
  1666. re: /^implements\b/i
  1667. },
  1668. {
  1669. value: PHP.Constants.T_INCLUDE,
  1670. re: /^include\b/i
  1671. },
  1672. {
  1673. value: PHP.Constants.T_INCLUDE_ONCE,
  1674. re: /^include_once\b/i
  1675. },
  1676. {
  1677. value: PHP.Constants.T_INSTANCEOF,
  1678. re: /^instanceof\b/i
  1679. },
  1680. {
  1681. value: PHP.Constants.T_INSTEADOF,
  1682. re: /^insteadof\b/i
  1683. },
  1684. {
  1685. value: PHP.Constants.T_INTERFACE,
  1686. re: /^interface\b/i
  1687. },
  1688. {
  1689. value: PHP.Constants.T_ISSET,
  1690. re: /^isset\b/i
  1691. },
  1692. {
  1693. value: PHP.Constants.T_LIST,
  1694. re: /^list\b/i
  1695. },
  1696. {
  1697. value: PHP.Constants.T_MATCH,
  1698. re: /^match\b/i
  1699. },
  1700. {
  1701. value: PHP.Constants.T_NAMESPACE,
  1702. re: /^namespace\b/i
  1703. },
  1704. {
  1705. value: PHP.Constants.T_NEW,
  1706. re: /^new\b/i
  1707. },
  1708. {
  1709. value: PHP.Constants.T_LOGICAL_OR,
  1710. re: /^or\b/i
  1711. },
  1712. {
  1713. value: PHP.Constants.T_PRINT,
  1714. re: /^print\b/i
  1715. },
  1716. {
  1717. value: PHP.Constants.T_PRIVATE,
  1718. re: /^private\b/i
  1719. },
  1720. {
  1721. value: PHP.Constants.T_PROTECTED,
  1722. re: /^protected\b/i
  1723. },
  1724. {
  1725. value: PHP.Constants.T_PUBLIC,
  1726. re: /^public\b/i
  1727. },
  1728. {
  1729. value: PHP.Constants.T_READONLY,
  1730. re: /^readonly\b/i
  1731. },
  1732. {
  1733. value: PHP.Constants.T_REQUIRE,
  1734. re: /^require\b/i
  1735. },
  1736. {
  1737. value: PHP.Constants.T_REQUIRE_ONCE,
  1738. re: /^require_once\b/i
  1739. },
  1740. {
  1741. value: PHP.Constants.T_STATIC,
  1742. re: /^static\b/i
  1743. },
  1744. {
  1745. value: PHP.Constants.T_SWITCH,
  1746. re: /^switch\b/i
  1747. },
  1748. {
  1749. value: PHP.Constants.T_THROW,
  1750. re: /^throw\b/i
  1751. },
  1752. {
  1753. value: PHP.Constants.T_TRAIT,
  1754. re: /^trait\b/i,
  1755. },
  1756. {
  1757. value: PHP.Constants.T_TRY,
  1758. re: /^try\b/i
  1759. },
  1760. {
  1761. value: PHP.Constants.T_UNSET,
  1762. re: /^unset\b/i
  1763. },
  1764. {
  1765. value: PHP.Constants.T_USE,
  1766. re: /^use\b/i
  1767. },
  1768. {
  1769. value: PHP.Constants.T_VAR,
  1770. re: /^var\b/i
  1771. },
  1772. {
  1773. value: PHP.Constants.T_WHILE,
  1774. re: /^while\b/i
  1775. },
  1776. {
  1777. value: PHP.Constants.T_LOGICAL_XOR,
  1778. re: /^xor\b/i
  1779. },
  1780. {
  1781. value: PHP.Constants.T_YIELD_FROM,
  1782. re: /^yield\s+from\b/i
  1783. },
  1784. {
  1785. value: PHP.Constants.T_YIELD,
  1786. re: /^yield\b/i
  1787. },
  1788. {
  1789. value: PHP.Constants.T_RETURN,
  1790. re: /^return\b/i
  1791. },
  1792. {
  1793. value: PHP.Constants.T_METHOD_C,
  1794. re: /^__METHOD__\b/i
  1795. },
  1796. {
  1797. value: PHP.Constants.T_LINE,
  1798. re: /^__LINE__\b/i
  1799. },
  1800. {
  1801. value: PHP.Constants.T_FILE,
  1802. re: /^__FILE__\b/i
  1803. },
  1804. {
  1805. value: PHP.Constants.T_FUNC_C,
  1806. re: /^__FUNCTION__\b/i
  1807. },
  1808. {
  1809. value: PHP.Constants.T_NS_C,
  1810. re: /^__NAMESPACE__\b/i
  1811. },
  1812. {
  1813. value: PHP.Constants.T_TRAIT_C,
  1814. re: /^__TRAIT__\b/i
  1815. },
  1816. {
  1817. value: PHP.Constants.T_DIR,
  1818. re: /^__DIR__\b/i
  1819. },
  1820. {
  1821. value: PHP.Constants.T_CLASS_C,
  1822. re: /^__CLASS__\b/i
  1823. },
  1824. {
  1825. value: PHP.Constants.T_AND_EQUAL,
  1826. re: /^&=/
  1827. },
  1828. {
  1829. value: PHP.Constants.T_ARRAY_CAST,
  1830. re: /^\([ \t]*array[ \t]*\)/i
  1831. },
  1832. {
  1833. value: PHP.Constants.T_BOOL_CAST,
  1834. re: /^\([ \t]*(?:bool|boolean)[ \t]*\)/i
  1835. },
  1836. {
  1837. value: PHP.Constants.T_DOUBLE_CAST,
  1838. re: /^\([ \t]*(?:real|float|double)[ \t]*\)/i
  1839. },
  1840. {
  1841. value: PHP.Constants.T_INT_CAST,
  1842. re: /^\([ \t]*(?:int|integer)[ \t]*\)/i
  1843. },
  1844. {
  1845. value: PHP.Constants.T_OBJECT_CAST,
  1846. re: /^\([ \t]*object[ \t]*\)/i
  1847. },
  1848. {
  1849. value: PHP.Constants.T_STRING_CAST,
  1850. re: /^\([ \t]*(?:binary|string)[ \t]*\)/i
  1851. },
  1852. {
  1853. value: PHP.Constants.T_UNSET_CAST,
  1854. re: /^\([ \t]*unset[ \t]*\)/i
  1855. },
  1856. {
  1857. value: PHP.Constants.T_BOOLEAN_AND,
  1858. re: /^&&/
  1859. },
  1860. {
  1861. value: PHP.Constants.T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG,
  1862. re: /^&(?=[$])/
  1863. },
  1864. {
  1865. value: PHP.Constants.T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG,
  1866. re: /^(&)(?=[^\$|^&])/
  1867. },
  1868. {
  1869. value: PHP.Constants.T_BOOLEAN_OR,
  1870. re: /^\|\|/
  1871. },
  1872. {
  1873. value: PHP.Constants.T_CLOSE_TAG,
  1874. re: /^(?:\?>|<\/script>)(\r\n|\r|\n)?/i,
  1875. func: function () {
  1876. swapState('INITIAL');
  1877. }
  1878. },
  1879. {
  1880. value: PHP.Constants.T_DOUBLE_ARROW,
  1881. re: /^=>/
  1882. },
  1883. {
  1884. value: PHP.Constants.T_PAAMAYIM_NEKUDOTAYIM,
  1885. re: /^::/
  1886. },
  1887. {
  1888. value: PHP.Constants.T_INC,
  1889. re: /^\+\+/
  1890. },
  1891. {
  1892. value: PHP.Constants.T_DEC,
  1893. re: /^--/
  1894. },
  1895. {
  1896. value: PHP.Constants.T_CONCAT_EQUAL,
  1897. re: /^\.=/
  1898. },
  1899. {
  1900. value: PHP.Constants.T_DIV_EQUAL,
  1901. re: /^\/=/
  1902. },
  1903. {
  1904. value: PHP.Constants.T_XOR_EQUAL,
  1905. re: /^\^=/
  1906. },
  1907. {
  1908. value: PHP.Constants.T_MUL_EQUAL,
  1909. re: /^\*=/
  1910. },
  1911. {
  1912. value: PHP.Constants.T_MOD_EQUAL,
  1913. re: /^%=/
  1914. },
  1915. {
  1916. value: PHP.Constants.T_SL_EQUAL,
  1917. re: /^<<=/
  1918. },
  1919. {
  1920. value: PHP.Constants.T_START_HEREDOC,
  1921. re: new RegExp('^[bB]?<<<[ \\t]*\'(' + labelRegexPart + ')\'(?:\\r\\n|\\r|\\n)'),
  1922. func: function (result) {
  1923. heredoc = result[1];
  1924. swapState('NOWDOC');
  1925. }
  1926. },
  1927. {
  1928. value: PHP.Constants.T_START_HEREDOC,
  1929. re: new RegExp('^[bB]?<<<[ \\t]*("?)(' + labelRegexPart + ')\\1(?:\\r\\n|\\r|\\n)'),
  1930. func: function (result) {
  1931. heredoc = result[2];
  1932. heredocEndAllowed = true;
  1933. swapState('HEREDOC');
  1934. }
  1935. },
  1936. {
  1937. value: PHP.Constants.T_SL,
  1938. re: /^<</
  1939. },
  1940. {
  1941. value: PHP.Constants.T_SPACESHIP,
  1942. re: /^<=>/
  1943. },
  1944. {
  1945. value: PHP.Constants.T_IS_SMALLER_OR_EQUAL,
  1946. re: /^<=/
  1947. },
  1948. {
  1949. value: PHP.Constants.T_SR_EQUAL,
  1950. re: /^>>=/
  1951. },
  1952. {
  1953. value: PHP.Constants.T_SR,
  1954. re: /^>>/
  1955. },
  1956. {
  1957. value: PHP.Constants.T_IS_GREATER_OR_EQUAL,
  1958. re: /^>=/
  1959. },
  1960. {
  1961. value: PHP.Constants.T_OR_EQUAL,
  1962. re: /^\|=/
  1963. },
  1964. {
  1965. value: PHP.Constants.T_PLUS_EQUAL,
  1966. re: /^\+=/
  1967. },
  1968. {
  1969. value: PHP.Constants.T_MINUS_EQUAL,
  1970. re: /^-=/
  1971. },
  1972. {
  1973. value: PHP.Constants.T_OBJECT_OPERATOR,
  1974. re: new RegExp('^->(?=[ \n\r\t]*' + labelRegexPart + ')'),
  1975. func: function () {
  1976. pushState('LOOKING_FOR_PROPERTY');
  1977. }
  1978. },
  1979. {
  1980. value: PHP.Constants.T_OBJECT_OPERATOR,
  1981. re: /^->/i
  1982. },
  1983. {
  1984. value: PHP.Constants.T_ELLIPSIS,
  1985. re: /^\.\.\./
  1986. },
  1987. {
  1988. value: PHP.Constants.T_POW_EQUAL,
  1989. re: /^\*\*=/
  1990. },
  1991. {
  1992. value: PHP.Constants.T_POW,
  1993. re: /^\*\*/
  1994. },
  1995. {
  1996. value: PHP.Constants.T_COALESCE_EQUAL,
  1997. re: /^\?\?=/
  1998. },
  1999. {
  2000. value: PHP.Constants.T_COALESCE,
  2001. re: /^\?\?/
  2002. },
  2003. {
  2004. value: PHP.Constants.T_NULLSAFE_OBJECT_OPERATOR,
  2005. re: /^\?->/
  2006. },
  2007. {
  2008. value: PHP.Constants.T_NAME_FULLY_QUALIFIED,
  2009. re: /^\\App\\Namespace/
  2010. },
  2011. {
  2012. value: PHP.Constants.T_NAME_QUALIFIED,
  2013. re: /^App\\Namespace/
  2014. },
  2015. {
  2016. value: PHP.Constants.T_NAME_RELATIVE,
  2017. re: /^namespace\\Namespace/
  2018. },
  2019. {
  2020. value: PHP.Constants.T_ATTRIBUTE,
  2021. re: /^#\[([\S\s]*?)]/
  2022. },
  2023. {
  2024. value: PHP.Constants.T_COMMENT,
  2025. re: /^\/\*([\S\s]*?)(?:\*\/|$)/
  2026. },
  2027. {
  2028. value: PHP.Constants.T_COMMENT,
  2029. re: /^(?:\/\/|#)[^\r\n?]*(?:\?(?!>)[^\r\n?]*)*(?:\r\n|\r|\n)?/
  2030. },
  2031. {
  2032. value: PHP.Constants.T_IS_IDENTICAL,
  2033. re: /^===/
  2034. },
  2035. {
  2036. value: PHP.Constants.T_IS_EQUAL,
  2037. re: /^==/
  2038. },
  2039. {
  2040. value: PHP.Constants.T_IS_NOT_IDENTICAL,
  2041. re: /^!==/
  2042. },
  2043. {
  2044. value: PHP.Constants.T_IS_NOT_EQUAL,
  2045. re: /^(!=|<>)/
  2046. },
  2047. {
  2048. value: PHP.Constants.T_DNUMBER,
  2049. re: /^(?:[0-9]+\.[0-9]*|\.[0-9]+)(?:[eE][+-]?[0-9]+)?/
  2050. },
  2051. {
  2052. value: PHP.Constants.T_DNUMBER,
  2053. re: /^[0-9]+[eE][+-]?[0-9]+/
  2054. },
  2055. {
  2056. value: PHP.Constants.T_LNUMBER,
  2057. re: /^(?:0x[0-9A-F]+|0b[01]+|[0-9]+)/i
  2058. },
  2059. {
  2060. value: PHP.Constants.T_VARIABLE,
  2061. re: new RegExp('^\\$' + labelRegexPart)
  2062. },
  2063. {
  2064. value: PHP.Constants.T_CONSTANT_ENCAPSED_STRING,
  2065. re: /^[bB]?'[^'\\]*(?:\\[\s\S][^'\\]*)*'/,
  2066. },
  2067. {
  2068. value: PHP.Constants.T_CONSTANT_ENCAPSED_STRING,
  2069. re: new RegExp('^[bB]?"' + stringRegexPart('"') + '"')
  2070. },
  2071. {
  2072. value: -1,
  2073. re: /^[bB]?"/,
  2074. func: function () {
  2075. swapState('DOUBLE_QUOTES');
  2076. }
  2077. },
  2078. {
  2079. value: -1,
  2080. re: /^`/,
  2081. func: function () {
  2082. swapState('BACKTICKS');
  2083. }
  2084. },
  2085. {
  2086. value: PHP.Constants.T_NS_SEPARATOR,
  2087. re: /^\\/
  2088. },
  2089. {
  2090. value: PHP.Constants.T_STRING,
  2091. re: /^[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/
  2092. },
  2093. {
  2094. value: -1,
  2095. re: /^\{/,
  2096. func: function () {
  2097. pushState('IN_SCRIPTING');
  2098. }
  2099. },
  2100. {
  2101. value: -1,
  2102. re: /^\}/,
  2103. func: function () {
  2104. if (stackPos > 0) {
  2105. popState();
  2106. }
  2107. }
  2108. },
  2109. {
  2110. value: -1,
  2111. re: /^[\[\];:?()!.,><=+-/*|&@^%"'$~]/
  2112. }
  2113. ],
  2114. 'DOUBLE_QUOTES': sharedStringTokens.concat([
  2115. {
  2116. value: -1,
  2117. re: /^"/,
  2118. func: function () {
  2119. swapState('IN_SCRIPTING');
  2120. }
  2121. },
  2122. {
  2123. value: PHP.Constants.T_ENCAPSED_AND_WHITESPACE,
  2124. re: new RegExp('^' + stringRegexPart('"'))
  2125. }
  2126. ]),
  2127. 'BACKTICKS': sharedStringTokens.concat([
  2128. {
  2129. value: -1,
  2130. re: /^`/,
  2131. func: function () {
  2132. swapState('IN_SCRIPTING');
  2133. }
  2134. },
  2135. {
  2136. value: PHP.Constants.T_ENCAPSED_AND_WHITESPACE,
  2137. re: new RegExp('^' + stringRegexPart('`'))
  2138. }
  2139. ]),
  2140. 'VAR_OFFSET': [
  2141. {
  2142. value: -1,
  2143. re: /^\]/,
  2144. func: function () {
  2145. popState();
  2146. }
  2147. },
  2148. {
  2149. value: PHP.Constants.T_NUM_STRING,
  2150. re: /^(?:0x[0-9A-F]+|0b[01]+|[0-9]+)/i
  2151. },
  2152. {
  2153. value: PHP.Constants.T_VARIABLE,
  2154. re: new RegExp('^\\$' + labelRegexPart)
  2155. },
  2156. {
  2157. value: PHP.Constants.T_STRING,
  2158. re: new RegExp('^' + labelRegexPart)
  2159. },
  2160. {
  2161. value: -1,
  2162. re: /^[;:,.\[()|^&+-/*=%!~$<>?@{}"`]/
  2163. }
  2164. ],
  2165. 'LOOKING_FOR_PROPERTY': [
  2166. {
  2167. value: PHP.Constants.T_OBJECT_OPERATOR,
  2168. re: /^->/
  2169. },
  2170. {
  2171. value: PHP.Constants.T_STRING,
  2172. re: new RegExp('^' + labelRegexPart),
  2173. func: function () {
  2174. popState();
  2175. }
  2176. },
  2177. {
  2178. value: PHP.Constants.T_WHITESPACE,
  2179. re: /^[ \n\r\t]+/
  2180. }
  2181. ],
  2182. 'LOOKING_FOR_VARNAME': [
  2183. {
  2184. value: PHP.Constants.T_STRING_VARNAME,
  2185. re: new RegExp('^' + labelRegexPart + '(?=[\\[}])'),
  2186. func: function () {
  2187. swapState('IN_SCRIPTING');
  2188. }
  2189. }
  2190. ],
  2191. 'NOWDOC': [
  2192. {
  2193. value: PHP.Constants.T_END_HEREDOC,
  2194. matchFunc: function (src) {
  2195. var re = new RegExp('^' + heredoc + '(?=;?[\\r\\n])');
  2196. if (src.match(re)) {
  2197. return [src.substr(0, heredoc.length)];
  2198. } else {
  2199. return null;
  2200. }
  2201. },
  2202. func: function () {
  2203. swapState('IN_SCRIPTING');
  2204. }
  2205. },
  2206. {
  2207. value: PHP.Constants.T_ENCAPSED_AND_WHITESPACE,
  2208. matchFunc: function (src) {
  2209. var re = new RegExp('[\\r\\n]' + heredoc + '(?=;?[\\r\\n])');
  2210. var result = re.exec(src);
  2211. var end = result ? result.index + 1 : src.length;
  2212. return [src.substring(0, end)];
  2213. }
  2214. }
  2215. ],
  2216. 'HEREDOC': sharedStringTokens.concat([
  2217. {
  2218. value: PHP.Constants.T_END_HEREDOC,
  2219. matchFunc: function (src) {
  2220. if (!heredocEndAllowed) {
  2221. return null;
  2222. }
  2223. var re = new RegExp('^' + heredoc + '(?=;?[\\r\\n])');
  2224. if (src.match(re)) {
  2225. return [src.substr(0, heredoc.length)];
  2226. } else {
  2227. return null;
  2228. }
  2229. },
  2230. func: function () {
  2231. swapState('IN_SCRIPTING');
  2232. }
  2233. },
  2234. {
  2235. value: PHP.Constants.T_ENCAPSED_AND_WHITESPACE,
  2236. matchFunc: function (src) {
  2237. var end = src.length;
  2238. var re = new RegExp('^' + stringRegexPart(''));
  2239. var result = re.exec(src);
  2240. if (result) {
  2241. end = result[0].length;
  2242. }
  2243. re = new RegExp('([\\r\\n])' + heredoc + '(?=;?[\\r\\n])');
  2244. result = re.exec(src.substring(0, end));
  2245. if (result) {
  2246. end = result.index + 1;
  2247. heredocEndAllowed = true;
  2248. } else {
  2249. heredocEndAllowed = false;
  2250. }
  2251. if (end == 0) {
  2252. return null;
  2253. }
  2254. return [src.substring(0, end)];
  2255. }
  2256. }
  2257. ])
  2258. };
  2259. var results = [],
  2260. line = 1,
  2261. cancel = true;
  2262. if (src === null) {
  2263. return results;
  2264. }
  2265. if (typeof src !== "string") {
  2266. src = src.toString();
  2267. }
  2268. while (src.length > 0 && cancel === true) {
  2269. var state = stateStack[stackPos];
  2270. var tokens = data[state];
  2271. cancel = tokens.some(function (token) {
  2272. var result = token.matchFunc !== undefined
  2273. ? token.matchFunc(src)
  2274. : src.match(token.re);
  2275. if (result !== null) {
  2276. if (result[0].length == 0) {
  2277. throw new Error("empty match");
  2278. }
  2279. if (token.func !== undefined) {
  2280. token.func(result);
  2281. }
  2282. if (token.value === -1) {
  2283. results.push(result[0]);
  2284. } else {
  2285. var resultString = result[0];
  2286. results.push([
  2287. parseInt(token.value, 10),
  2288. resultString,
  2289. line
  2290. ]);
  2291. line += resultString.split('\n').length - 1;
  2292. }
  2293. src = src.substring(result[0].length);
  2294. return true;
  2295. }
  2296. return false;
  2297. });
  2298. }
  2299. return results;
  2300. };
  2301. PHP.Parser = function (preprocessedTokens, evaluate) {
  2302. var yybase = this.yybase,
  2303. yydefault = this.yydefault,
  2304. yycheck = this.yycheck,
  2305. yyaction = this.yyaction,
  2306. yylen = this.yylen,
  2307. yygbase = this.yygbase,
  2308. yygcheck = this.yygcheck,
  2309. yyp = this.yyp,
  2310. yygoto = this.yygoto,
  2311. yylhs = this.yylhs,
  2312. terminals = this.terminals,
  2313. translate = this.translate,
  2314. yygdefault = this.yygdefault;
  2315. this.pos = -1;
  2316. this.line = 1;
  2317. this.tokenMap = this.createTokenMap();
  2318. this.dropTokens = {};
  2319. this.dropTokens[PHP.Constants.T_WHITESPACE] = 1;
  2320. this.dropTokens[PHP.Constants.T_OPEN_TAG] = 1;
  2321. var tokens = [];
  2322. preprocessedTokens.forEach(function (token, index) {
  2323. if (typeof token === "object" && token[0] === PHP.Constants.T_OPEN_TAG_WITH_ECHO) {
  2324. tokens.push([
  2325. PHP.Constants.T_OPEN_TAG,
  2326. token[1],
  2327. token[2]
  2328. ]);
  2329. tokens.push([
  2330. PHP.Constants.T_ECHO,
  2331. token[1],
  2332. token[2]
  2333. ]);
  2334. } else {
  2335. tokens.push(token);
  2336. }
  2337. });
  2338. this.tokens = tokens;
  2339. var tokenId = this.TOKEN_NONE;
  2340. this.startAttributes = {
  2341. 'startLine': 1
  2342. };
  2343. this.endAttributes = {};
  2344. var attributeStack = [this.startAttributes];
  2345. var state = 0;
  2346. var stateStack = [state];
  2347. this.yyastk = [];
  2348. this.stackPos = 0;
  2349. var yyn;
  2350. var origTokenId;
  2351. for (; ;) {
  2352. if (yybase[state] === 0) {
  2353. yyn = yydefault[state];
  2354. } else {
  2355. if (tokenId === this.TOKEN_NONE) {
  2356. origTokenId = this.getNextToken();
  2357. tokenId = (origTokenId >= 0 && origTokenId < this.TOKEN_MAP_SIZE) ? translate[origTokenId] : this.TOKEN_INVALID;
  2358. attributeStack[this.stackPos] = this.startAttributes;
  2359. }
  2360. if (((yyn = yybase[state] + tokenId) >= 0
  2361. && yyn < this.YYLAST && yycheck[yyn] === tokenId
  2362. || (state < this.YY2TBLSTATE
  2363. && (yyn = yybase[state + this.YYNLSTATES] + tokenId) >= 0
  2364. && yyn < this.YYLAST
  2365. && yycheck[yyn] === tokenId))
  2366. && (yyn = yyaction[yyn]) !== this.YYDEFAULT) {
  2367. if (yyn > 0) {
  2368. ++this.stackPos;
  2369. stateStack[this.stackPos] = state = yyn;
  2370. this.yyastk[this.stackPos] = this.tokenValue;
  2371. attributeStack[this.stackPos] = this.startAttributes;
  2372. tokenId = this.TOKEN_NONE;
  2373. if (yyn < this.YYNLSTATES)
  2374. continue;
  2375. yyn -= this.YYNLSTATES;
  2376. } else {
  2377. yyn = -yyn;
  2378. }
  2379. } else {
  2380. yyn = yydefault[state];
  2381. }
  2382. }
  2383. for (; ;) {
  2384. if (yyn === 0) {
  2385. return this.yyval;
  2386. } else if (yyn !== this.YYUNEXPECTED) {
  2387. for (var attr in this.endAttributes) {
  2388. attributeStack[this.stackPos - yylen[yyn]][attr] = this.endAttributes[attr];
  2389. }
  2390. this.stackPos -= yylen[yyn];
  2391. yyn = yylhs[yyn];
  2392. if ((yyp = yygbase[yyn] + stateStack[this.stackPos]) >= 0
  2393. && yyp < this.YYGLAST
  2394. && yygcheck[yyp] === yyn) {
  2395. state = yygoto[yyp];
  2396. } else {
  2397. state = yygdefault[yyn];
  2398. }
  2399. ++this.stackPos;
  2400. stateStack[this.stackPos] = state;
  2401. this.yyastk[this.stackPos] = this.yyval;
  2402. attributeStack[this.stackPos] = this.startAttributes;
  2403. } else {
  2404. if (evaluate !== true) {
  2405. var expected = [];
  2406. for (var i = 0; i < this.TOKEN_MAP_SIZE; ++i) {
  2407. if ((yyn = yybase[state] + i) >= 0 && yyn < this.YYLAST && yycheck[yyn] == i
  2408. || state < this.YY2TBLSTATE
  2409. && (yyn = yybase[state + this.YYNLSTATES] + i)
  2410. && yyn < this.YYLAST && yycheck[yyn] == i
  2411. ) {
  2412. if (yyaction[yyn] != this.YYUNEXPECTED) {
  2413. if (expected.length == 4) {
  2414. expected = [];
  2415. break;
  2416. }
  2417. expected.push(this.terminals[i]);
  2418. }
  2419. }
  2420. }
  2421. var expectedString = '';
  2422. if (expected.length) {
  2423. expectedString = ', expecting ' + expected.join(' or ');
  2424. }
  2425. throw new PHP.ParseError('syntax error, unexpected ' + terminals[tokenId] + expectedString, this.startAttributes['startLine']);
  2426. } else {
  2427. return this.startAttributes['startLine'];
  2428. }
  2429. }
  2430. if (state < this.YYNLSTATES)
  2431. break;
  2432. yyn = state - this.YYNLSTATES;
  2433. }
  2434. }
  2435. };
  2436. PHP.ParseError = function (msg, line) {
  2437. this.message = msg;
  2438. this.line = line;
  2439. };
  2440. PHP.Parser.prototype.getNextToken = function () {
  2441. this.startAttributes = {};
  2442. this.endAttributes = {};
  2443. var token,
  2444. tmp;
  2445. while (this.tokens[++this.pos] !== undefined) {
  2446. token = this.tokens[this.pos];
  2447. if (typeof token === "string") {
  2448. this.startAttributes['startLine'] = this.line;
  2449. this.endAttributes['endLine'] = this.line;
  2450. if ('b"' === token) {
  2451. this.tokenValue = 'b"';
  2452. return '"'.charCodeAt(0);
  2453. } else {
  2454. this.tokenValue = token;
  2455. return token.charCodeAt(0);
  2456. }
  2457. } else {
  2458. this.line += ((tmp = token[1].match(/\n/g)) === null) ? 0 : tmp.length;
  2459. if (PHP.Constants.T_COMMENT === token[0]) {
  2460. if (!Array.isArray(this.startAttributes['comments'])) {
  2461. this.startAttributes['comments'] = [];
  2462. }
  2463. this.startAttributes['comments'].push({
  2464. type: "comment",
  2465. comment: token[1],
  2466. line: token[2]
  2467. });
  2468. }
  2469. else if (PHP.Constants.T_ATTRIBUTE === token[0]) {
  2470. this.tokenValue = token[1];
  2471. this.startAttributes['startLine'] = token[2];
  2472. this.endAttributes['endLine'] = this.line;
  2473. } else if (PHP.Constants.T_DOC_COMMENT === token[0]) {
  2474. this.startAttributes['comments'].push(new PHPParser_Comment_Doc(token[1], token[2]));
  2475. } else if (this.dropTokens[token[0]] === undefined) {
  2476. this.tokenValue = token[1];
  2477. this.startAttributes['startLine'] = token[2];
  2478. this.endAttributes['endLine'] = this.line;
  2479. return this.tokenMap[token[0]];
  2480. }
  2481. }
  2482. }
  2483. this.startAttributes['startLine'] = this.line;
  2484. return 0;
  2485. };
  2486. PHP.Parser.prototype.tokenName = function (token) {
  2487. var constants = ["T_THROW","T_INCLUDE","T_INCLUDE_ONCE","T_EVAL","T_REQUIRE","T_REQUIRE_ONCE","T_LOGICAL_OR","T_LOGICAL_XOR","T_LOGICAL_AND","T_PRINT","T_YIELD","T_DOUBLE_ARROW","T_YIELD_FROM","T_PLUS_EQUAL","T_MINUS_EQUAL","T_MUL_EQUAL","T_DIV_EQUAL","T_CONCAT_EQUAL","T_MOD_EQUAL","T_AND_EQUAL","T_OR_EQUAL","T_XOR_EQUAL","T_SL_EQUAL","T_SR_EQUAL","T_POW_EQUAL","T_COALESCE_EQUAL","T_COALESCE","T_BOOLEAN_OR","T_BOOLEAN_AND","T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG","T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG","T_IS_EQUAL","T_IS_NOT_EQUAL","T_IS_IDENTICAL","T_IS_NOT_IDENTICAL","T_SPACESHIP","T_IS_SMALLER_OR_EQUAL","T_IS_GREATER_OR_EQUAL","T_SL","T_SR","T_INSTANCEOF","T_INC","T_DEC","T_INT_CAST","T_DOUBLE_CAST","T_STRING_CAST","T_ARRAY_CAST","T_OBJECT_CAST","T_BOOL_CAST","T_UNSET_CAST","T_POW","T_NEW","T_CLONE","T_EXIT","T_IF","T_ELSEIF","T_ELSE","T_ENDIF","T_LNUMBER","T_DNUMBER","T_STRING","T_STRING_VARNAME","T_VARIABLE","T_NUM_STRING","T_INLINE_HTML","T_ENCAPSED_AND_WHITESPACE","T_CONSTANT_ENCAPSED_STRING","T_ECHO","T_DO","T_WHILE","T_ENDWHILE","T_FOR","T_ENDFOR","T_FOREACH","T_ENDFOREACH","T_DECLARE","T_ENDDECLARE","T_AS","T_SWITCH","T_MATCH","T_ENDSWITCH","T_CASE","T_DEFAULT","T_BREAK","T_CONTINUE","T_GOTO","T_FUNCTION","T_FN","T_CONST","T_RETURN","T_TRY","T_CATCH","T_FINALLY","T_THROW","T_USE","T_INSTEADOF","T_GLOBAL","T_STATIC","T_ABSTRACT","T_FINAL","T_PRIVATE","T_PROTECTED","T_PUBLIC","T_READONLY","T_VAR","T_UNSET","T_ISSET","T_EMPTY","T_HALT_COMPILER","T_CLASS","T_TRAIT","T_INTERFACE","T_ENUM","T_EXTENDS","T_IMPLEMENTS","T_OBJECT_OPERATOR","T_NULLSAFE_OBJECT_OPERATOR","T_DOUBLE_ARROW","T_LIST","T_ARRAY","T_CALLABLE","T_CLASS_C","T_TRAIT_C","T_METHOD_C","T_FUNC_C","T_LINE","T_FILE","T_START_HEREDOC","T_END_HEREDOC","T_DOLLAR_OPEN_CURLY_BRACES","T_CURLY_OPEN","T_PAAMAYIM_NEKUDOTAYIM","T_NAMESPACE","T_NS_C","T_DIR","T_NS_SEPARATOR","T_ELLIPSIS","T_NAME_FULLY_QUALIFIED","T_NAME_QUALIFIED","T_NAME_RELATIVE","T_ATTRIBUTE","T_ENUM","T_BAD_CHARACTER","T_COMMENT","T_DOC_COMMENT","T_OPEN_TAG","T_OPEN_TAG_WITH_ECHO","T_CLOSE_TAG","T_WHITESPACE"];
  2488. var current = "UNKNOWN";
  2489. constants.some(function (constant) {
  2490. if (PHP.Constants[constant] === token) {
  2491. current = constant;
  2492. return true;
  2493. } else {
  2494. return false;
  2495. }
  2496. });
  2497. return current;
  2498. };
  2499. PHP.Parser.prototype.createTokenMap = function () {
  2500. var tokenMap = {},
  2501. name,
  2502. i;
  2503. for (i = 256; i < 1000; ++i) {
  2504. if (PHP.Constants.T_OPEN_TAG_WITH_ECHO === i) {
  2505. tokenMap[i] = PHP.Constants.T_ECHO;
  2506. } else if (PHP.Constants.T_CLOSE_TAG === i) {
  2507. tokenMap[i] = 59;
  2508. } else if ('UNKNOWN' !== (name = this.tokenName(i))) {
  2509. tokenMap[i] = this[name];
  2510. }
  2511. }
  2512. return tokenMap;
  2513. };
  2514. PHP.Parser.prototype.TOKEN_NONE = -1;
  2515. PHP.Parser.prototype.TOKEN_INVALID = 175;
  2516. PHP.Parser.prototype.TOKEN_MAP_SIZE = 403;
  2517. PHP.Parser.prototype.YYLAST = 1196;
  2518. PHP.Parser.prototype.YY2TBLSTATE = 420;
  2519. PHP.Parser.prototype.YYGLAST = 545;
  2520. PHP.Parser.prototype.YYNLSTATES = 710;
  2521. PHP.Parser.prototype.YYUNEXPECTED = 32767;
  2522. PHP.Parser.prototype.YYDEFAULT = -32766;
  2523. PHP.Parser.prototype.YYERRTOK = 256;
  2524. PHP.Parser.prototype.T_THROW = 257;
  2525. PHP.Parser.prototype.T_INCLUDE = 258;
  2526. PHP.Parser.prototype.T_INCLUDE_ONCE = 259;
  2527. PHP.Parser.prototype.T_EVAL = 260;
  2528. PHP.Parser.prototype.T_REQUIRE = 261;
  2529. PHP.Parser.prototype.T_REQUIRE_ONCE = 262;
  2530. PHP.Parser.prototype.T_LOGICAL_OR = 263;
  2531. PHP.Parser.prototype.T_LOGICAL_XOR = 264;
  2532. PHP.Parser.prototype.T_LOGICAL_AND = 265;
  2533. PHP.Parser.prototype.T_PRINT = 266;
  2534. PHP.Parser.prototype.T_YIELD = 267;
  2535. PHP.Parser.prototype.T_DOUBLE_ARROW = 268;
  2536. PHP.Parser.prototype.T_YIELD_FROM = 269;
  2537. PHP.Parser.prototype.T_PLUS_EQUAL = 270;
  2538. PHP.Parser.prototype.T_MINUS_EQUAL = 271;
  2539. PHP.Parser.prototype.T_MUL_EQUAL = 272;
  2540. PHP.Parser.prototype.T_DIV_EQUAL = 273;
  2541. PHP.Parser.prototype.T_CONCAT_EQUAL = 274;
  2542. PHP.Parser.prototype.T_MOD_EQUAL = 275;
  2543. PHP.Parser.prototype.T_AND_EQUAL = 276;
  2544. PHP.Parser.prototype.T_OR_EQUAL = 277;
  2545. PHP.Parser.prototype.T_XOR_EQUAL = 278;
  2546. PHP.Parser.prototype.T_SL_EQUAL = 279;
  2547. PHP.Parser.prototype.T_SR_EQUAL = 280;
  2548. PHP.Parser.prototype.T_POW_EQUAL = 281;
  2549. PHP.Parser.prototype.T_COALESCE_EQUAL = 282;
  2550. PHP.Parser.prototype.T_COALESCE = 283;
  2551. PHP.Parser.prototype.T_BOOLEAN_OR = 284;
  2552. PHP.Parser.prototype.T_BOOLEAN_AND = 285;
  2553. PHP.Parser.prototype.T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 286;
  2554. PHP.Parser.prototype.T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 287;
  2555. PHP.Parser.prototype.T_IS_EQUAL = 288;
  2556. PHP.Parser.prototype.T_IS_NOT_EQUAL = 289;
  2557. PHP.Parser.prototype.T_IS_IDENTICAL = 290;
  2558. PHP.Parser.prototype.T_IS_NOT_IDENTICAL = 291;
  2559. PHP.Parser.prototype.T_SPACESHIP = 292;
  2560. PHP.Parser.prototype.T_IS_SMALLER_OR_EQUAL = 293;
  2561. PHP.Parser.prototype.T_IS_GREATER_OR_EQUAL = 294;
  2562. PHP.Parser.prototype.T_SL = 295;
  2563. PHP.Parser.prototype.T_SR = 296;
  2564. PHP.Parser.prototype.T_INSTANCEOF = 297;
  2565. PHP.Parser.prototype.T_INC = 298;
  2566. PHP.Parser.prototype.T_DEC = 299;
  2567. PHP.Parser.prototype.T_INT_CAST = 300;
  2568. PHP.Parser.prototype.T_DOUBLE_CAST = 301;
  2569. PHP.Parser.prototype.T_STRING_CAST = 302;
  2570. PHP.Parser.prototype.T_ARRAY_CAST = 303;
  2571. PHP.Parser.prototype.T_OBJECT_CAST = 304;
  2572. PHP.Parser.prototype.T_BOOL_CAST = 305;
  2573. PHP.Parser.prototype.T_UNSET_CAST = 306;
  2574. PHP.Parser.prototype.T_POW = 307;
  2575. PHP.Parser.prototype.T_NEW = 308;
  2576. PHP.Parser.prototype.T_CLONE = 309;
  2577. PHP.Parser.prototype.T_EXIT = 310;
  2578. PHP.Parser.prototype.T_IF = 311;
  2579. PHP.Parser.prototype.T_ELSEIF = 312;
  2580. PHP.Parser.prototype.T_ELSE = 313;
  2581. PHP.Parser.prototype.T_ENDIF = 314;
  2582. PHP.Parser.prototype.T_LNUMBER = 315;
  2583. PHP.Parser.prototype.T_DNUMBER = 316;
  2584. PHP.Parser.prototype.T_STRING = 317;
  2585. PHP.Parser.prototype.T_STRING_VARNAME = 318;
  2586. PHP.Parser.prototype.T_VARIABLE = 319;
  2587. PHP.Parser.prototype.T_NUM_STRING = 320;
  2588. PHP.Parser.prototype.T_INLINE_HTML = 321;
  2589. PHP.Parser.prototype.T_ENCAPSED_AND_WHITESPACE = 322;
  2590. PHP.Parser.prototype.T_CONSTANT_ENCAPSED_STRING = 323;
  2591. PHP.Parser.prototype.T_ECHO = 324;
  2592. PHP.Parser.prototype.T_DO = 325;
  2593. PHP.Parser.prototype.T_WHILE = 326;
  2594. PHP.Parser.prototype.T_ENDWHILE = 327;
  2595. PHP.Parser.prototype.T_FOR = 328;
  2596. PHP.Parser.prototype.T_ENDFOR = 329;
  2597. PHP.Parser.prototype.T_FOREACH = 330;
  2598. PHP.Parser.prototype.T_ENDFOREACH = 331;
  2599. PHP.Parser.prototype.T_DECLARE = 332;
  2600. PHP.Parser.prototype.T_ENDDECLARE = 333;
  2601. PHP.Parser.prototype.T_AS = 334;
  2602. PHP.Parser.prototype.T_SWITCH = 335;
  2603. PHP.Parser.prototype.T_MATCH = 336;
  2604. PHP.Parser.prototype.T_ENDSWITCH = 337;
  2605. PHP.Parser.prototype.T_CASE = 338;
  2606. PHP.Parser.prototype.T_DEFAULT = 339;
  2607. PHP.Parser.prototype.T_BREAK = 340;
  2608. PHP.Parser.prototype.T_CONTINUE = 341;
  2609. PHP.Parser.prototype.T_GOTO = 342;
  2610. PHP.Parser.prototype.T_FUNCTION = 343;
  2611. PHP.Parser.prototype.T_FN = 344;
  2612. PHP.Parser.prototype.T_CONST = 345;
  2613. PHP.Parser.prototype.T_RETURN = 346;
  2614. PHP.Parser.prototype.T_TRY = 347;
  2615. PHP.Parser.prototype.T_CATCH = 348;
  2616. PHP.Parser.prototype.T_FINALLY = 349;
  2617. PHP.Parser.prototype.T_USE = 350;
  2618. PHP.Parser.prototype.T_INSTEADOF = 351;
  2619. PHP.Parser.prototype.T_GLOBAL = 352;
  2620. PHP.Parser.prototype.T_STATIC = 353;
  2621. PHP.Parser.prototype.T_ABSTRACT = 354;
  2622. PHP.Parser.prototype.T_FINAL = 355;
  2623. PHP.Parser.prototype.T_PRIVATE = 356;
  2624. PHP.Parser.prototype.T_PROTECTED = 357;
  2625. PHP.Parser.prototype.T_PUBLIC = 358;
  2626. PHP.Parser.prototype.T_READONLY = 359;
  2627. PHP.Parser.prototype.T_VAR = 360;
  2628. PHP.Parser.prototype.T_UNSET = 361;
  2629. PHP.Parser.prototype.T_ISSET = 362;
  2630. PHP.Parser.prototype.T_EMPTY = 363;
  2631. PHP.Parser.prototype.T_HALT_COMPILER = 364;
  2632. PHP.Parser.prototype.T_CLASS = 365;
  2633. PHP.Parser.prototype.T_TRAIT = 366;
  2634. PHP.Parser.prototype.T_INTERFACE = 367;
  2635. PHP.Parser.prototype.T_ENUM = 368;
  2636. PHP.Parser.prototype.T_EXTENDS = 369;
  2637. PHP.Parser.prototype.T_IMPLEMENTS = 370;
  2638. PHP.Parser.prototype.T_OBJECT_OPERATOR = 371;
  2639. PHP.Parser.prototype.T_NULLSAFE_OBJECT_OPERATOR = 372;
  2640. PHP.Parser.prototype.T_LIST = 373;
  2641. PHP.Parser.prototype.T_ARRAY = 374;
  2642. PHP.Parser.prototype.T_CALLABLE = 375;
  2643. PHP.Parser.prototype.T_CLASS_C = 376;
  2644. PHP.Parser.prototype.T_TRAIT_C = 377;
  2645. PHP.Parser.prototype.T_METHOD_C = 378;
  2646. PHP.Parser.prototype.T_FUNC_C = 379;
  2647. PHP.Parser.prototype.T_LINE = 380;
  2648. PHP.Parser.prototype.T_FILE = 381;
  2649. PHP.Parser.prototype.T_START_HEREDOC = 382;
  2650. PHP.Parser.prototype.T_END_HEREDOC = 383;
  2651. PHP.Parser.prototype.T_DOLLAR_OPEN_CURLY_BRACES = 384;
  2652. PHP.Parser.prototype.T_CURLY_OPEN = 385;
  2653. PHP.Parser.prototype.T_PAAMAYIM_NEKUDOTAYIM = 386;
  2654. PHP.Parser.prototype.T_NAMESPACE = 387;
  2655. PHP.Parser.prototype.T_NS_C = 388;
  2656. PHP.Parser.prototype.T_DIR = 389;
  2657. PHP.Parser.prototype.T_NS_SEPARATOR = 390;
  2658. PHP.Parser.prototype.T_ELLIPSIS = 391;
  2659. PHP.Parser.prototype.T_NAME_FULLY_QUALIFIED = 392;
  2660. PHP.Parser.prototype.T_NAME_QUALIFIED = 393;
  2661. PHP.Parser.prototype.T_NAME_RELATIVE = 394;
  2662. PHP.Parser.prototype.T_ATTRIBUTE = 395;
  2663. PHP.Parser.prototype.T_BAD_CHARACTER = 396;
  2664. PHP.Parser.prototype.T_COMMENT = 397;
  2665. PHP.Parser.prototype.T_DOC_COMMENT = 398;
  2666. PHP.Parser.prototype.T_OPEN_TAG = 399;
  2667. PHP.Parser.prototype.T_OPEN_TAG_WITH_ECHO = 400;
  2668. PHP.Parser.prototype.T_CLOSE_TAG = 401;
  2669. PHP.Parser.prototype.T_WHITESPACE = 402;
  2670. PHP.Parser.prototype.terminals = [
  2671. "EOF",
  2672. "error",
  2673. "T_THROW",
  2674. "T_INCLUDE",
  2675. "T_INCLUDE_ONCE",
  2676. "T_EVAL",
  2677. "T_REQUIRE",
  2678. "T_REQUIRE_ONCE",
  2679. "','",
  2680. "T_LOGICAL_OR",
  2681. "T_LOGICAL_XOR",
  2682. "T_LOGICAL_AND",
  2683. "T_PRINT",
  2684. "T_YIELD",
  2685. "T_DOUBLE_ARROW",
  2686. "T_YIELD_FROM",
  2687. "'='",
  2688. "T_PLUS_EQUAL",
  2689. "T_MINUS_EQUAL",
  2690. "T_MUL_EQUAL",
  2691. "T_DIV_EQUAL",
  2692. "T_CONCAT_EQUAL",
  2693. "T_MOD_EQUAL",
  2694. "T_AND_EQUAL",
  2695. "T_OR_EQUAL",
  2696. "T_XOR_EQUAL",
  2697. "T_SL_EQUAL",
  2698. "T_SR_EQUAL",
  2699. "T_POW_EQUAL",
  2700. "T_COALESCE_EQUAL",
  2701. "'?'",
  2702. "':'",
  2703. "T_COALESCE",
  2704. "T_BOOLEAN_OR",
  2705. "T_BOOLEAN_AND",
  2706. "'|'",
  2707. "'^'",
  2708. "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG",
  2709. "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG",
  2710. "T_IS_EQUAL",
  2711. "T_IS_NOT_EQUAL",
  2712. "T_IS_IDENTICAL",
  2713. "T_IS_NOT_IDENTICAL",
  2714. "T_SPACESHIP",
  2715. "'<'",
  2716. "T_IS_SMALLER_OR_EQUAL",
  2717. "'>'",
  2718. "T_IS_GREATER_OR_EQUAL",
  2719. "T_SL",
  2720. "T_SR",
  2721. "'+'",
  2722. "'-'",
  2723. "'.'",
  2724. "'*'",
  2725. "'/'",
  2726. "'%'",
  2727. "'!'",
  2728. "T_INSTANCEOF",
  2729. "'~'",
  2730. "T_INC",
  2731. "T_DEC",
  2732. "T_INT_CAST",
  2733. "T_DOUBLE_CAST",
  2734. "T_STRING_CAST",
  2735. "T_ARRAY_CAST",
  2736. "T_OBJECT_CAST",
  2737. "T_BOOL_CAST",
  2738. "T_UNSET_CAST",
  2739. "'@'",
  2740. "T_POW",
  2741. "'['",
  2742. "T_NEW",
  2743. "T_CLONE",
  2744. "T_EXIT",
  2745. "T_IF",
  2746. "T_ELSEIF",
  2747. "T_ELSE",
  2748. "T_ENDIF",
  2749. "T_LNUMBER",
  2750. "T_DNUMBER",
  2751. "T_STRING",
  2752. "T_STRING_VARNAME",
  2753. "T_VARIABLE",
  2754. "T_NUM_STRING",
  2755. "T_INLINE_HTML",
  2756. "T_ENCAPSED_AND_WHITESPACE",
  2757. "T_CONSTANT_ENCAPSED_STRING",
  2758. "T_ECHO",
  2759. "T_DO",
  2760. "T_WHILE",
  2761. "T_ENDWHILE",
  2762. "T_FOR",
  2763. "T_ENDFOR",
  2764. "T_FOREACH",
  2765. "T_ENDFOREACH",
  2766. "T_DECLARE",
  2767. "T_ENDDECLARE",
  2768. "T_AS",
  2769. "T_SWITCH",
  2770. "T_MATCH",
  2771. "T_ENDSWITCH",
  2772. "T_CASE",
  2773. "T_DEFAULT",
  2774. "T_BREAK",
  2775. "T_CONTINUE",
  2776. "T_GOTO",
  2777. "T_FUNCTION",
  2778. "T_FN",
  2779. "T_CONST",
  2780. "T_RETURN",
  2781. "T_TRY",
  2782. "T_CATCH",
  2783. "T_FINALLY",
  2784. "T_USE",
  2785. "T_INSTEADOF",
  2786. "T_GLOBAL",
  2787. "T_STATIC",
  2788. "T_ABSTRACT",
  2789. "T_FINAL",
  2790. "T_PRIVATE",
  2791. "T_PROTECTED",
  2792. "T_PUBLIC",
  2793. "T_READONLY",
  2794. "T_VAR",
  2795. "T_UNSET",
  2796. "T_ISSET",
  2797. "T_EMPTY",
  2798. "T_HALT_COMPILER",
  2799. "T_CLASS",
  2800. "T_TRAIT",
  2801. "T_INTERFACE",
  2802. "T_ENUM",
  2803. "T_EXTENDS",
  2804. "T_IMPLEMENTS",
  2805. "T_OBJECT_OPERATOR",
  2806. "T_NULLSAFE_OBJECT_OPERATOR",
  2807. "T_LIST",
  2808. "T_ARRAY",
  2809. "T_CALLABLE",
  2810. "T_CLASS_C",
  2811. "T_TRAIT_C",
  2812. "T_METHOD_C",
  2813. "T_FUNC_C",
  2814. "T_LINE",
  2815. "T_FILE",
  2816. "T_START_HEREDOC",
  2817. "T_END_HEREDOC",
  2818. "T_DOLLAR_OPEN_CURLY_BRACES",
  2819. "T_CURLY_OPEN",
  2820. "T_PAAMAYIM_NEKUDOTAYIM",
  2821. "T_NAMESPACE",
  2822. "T_NS_C",
  2823. "T_DIR",
  2824. "T_NS_SEPARATOR",
  2825. "T_ELLIPSIS",
  2826. "T_NAME_FULLY_QUALIFIED",
  2827. "T_NAME_QUALIFIED",
  2828. "T_NAME_RELATIVE",
  2829. "T_ATTRIBUTE",
  2830. "';'",
  2831. "']'",
  2832. "'{'",
  2833. "'}'",
  2834. "'('",
  2835. "')'",
  2836. "'`'",
  2837. "'\"'",
  2838. "'$'",
  2839. "T_BAD_CHARACTER",
  2840. "T_COMMENT",
  2841. "T_DOC_COMMENT",
  2842. "T_OPEN_TAG",
  2843. "T_OPEN_TAG_WITH_ECHO",
  2844. "T_CLOSE_TAG",
  2845. "T_WHITESPACE"
  2846. , "???"
  2847. ];
  2848. PHP.Parser.prototype.translate = [
  2849. 0, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2850. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2851. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2852. 175, 175, 175, 56, 166, 175, 167, 55, 175, 175,
  2853. 163, 164, 53, 50, 8, 51, 52, 54, 175, 175,
  2854. 175, 175, 175, 175, 175, 175, 175, 175, 31, 159,
  2855. 44, 16, 46, 30, 68, 175, 175, 175, 175, 175,
  2856. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2857. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2858. 175, 70, 175, 160, 36, 175, 165, 175, 175, 175,
  2859. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2860. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2861. 175, 175, 175, 161, 35, 162, 58, 175, 175, 175,
  2862. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2863. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2864. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2865. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2866. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2867. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2868. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2869. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2870. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2871. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2872. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2873. 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
  2874. 175, 175, 175, 175, 175, 175, 1, 2, 3, 4,
  2875. 5, 6, 7, 9, 10, 11, 12, 13, 14, 15,
  2876. 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
  2877. 27, 28, 29, 32, 33, 34, 37, 38, 39, 40,
  2878. 41, 42, 43, 45, 47, 48, 49, 57, 59, 60,
  2879. 61, 62, 63, 64, 65, 66, 67, 69, 71, 72,
  2880. 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
  2881. 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
  2882. 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
  2883. 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
  2884. 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
  2885. 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
  2886. 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
  2887. 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
  2888. 153, 154, 155, 156, 157, 158, 168, 169, 170, 171,
  2889. 172, 173, 174
  2890. ];
  2891. PHP.Parser.prototype.yyaction = [
  2892. 132, 133, 134, 569, 135, 136, 0, 722, 723, 724,
  2893. 137, 37, 834, 911, 835, 469,-32766,-32766,-32766,-32767,
  2894. -32767,-32767,-32767, 101, 102, 103, 104, 105, 1068, 1069,
  2895. 1070, 1067, 1066, 1065, 1071, 716, 715,-32766,-32766,-32766,
  2896. -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767,
  2897. -32767, 545, 546,-32766,-32766, 725,-32766,-32766,-32766, 998,
  2898. 999, 806, 922, 447, 448, 449, 370, 371, 2, 267,
  2899. 138, 396, 729, 730, 731, 732, 414,-32766, 420,-32766,
  2900. -32766,-32766,-32766,-32766, 990, 733, 734, 735, 736, 737,
  2901. 738, 739, 740, 741, 742, 743, 763, 570, 764, 765,
  2902. 766, 767, 755, 756, 336, 337, 758, 759, 744, 745,
  2903. 746, 748, 749, 750, 346, 790, 791, 792, 793, 794,
  2904. 795, 751, 752, 571, 572, 784, 775, 773, 774, 787,
  2905. 770, 771, 283, 420, 573, 574, 769, 575, 576, 577,
  2906. 578, 579, 580, 598, -575, 470, 14, 798, 772, 581,
  2907. 582, -575, 139,-32766,-32766,-32766, 132, 133, 134, 569,
  2908. 135, 136, 1017, 722, 723, 724, 137, 37, 1060,-32766,
  2909. -32766,-32766, 1303, 696,-32766, 1304,-32766,-32766,-32766,-32766,
  2910. -32766,-32766,-32766, 1068, 1069, 1070, 1067, 1066, 1065, 1071,
  2911. -32766, 716, 715, 372, 371, 1258,-32766,-32766,-32766, -572,
  2912. 106, 107, 108, 414, 270, 891, -572, 240, 1193, 1192,
  2913. 1194, 725,-32766,-32766,-32766, 1046, 109,-32766,-32766,-32766,
  2914. -32766, 986, 985, 984, 987, 267, 138, 396, 729, 730,
  2915. 731, 732, 12,-32766, 420,-32766,-32766,-32766,-32766, 998,
  2916. 999, 733, 734, 735, 736, 737, 738, 739, 740, 741,
  2917. 742, 743, 763, 570, 764, 765, 766, 767, 755, 756,
  2918. 336, 337, 758, 759, 744, 745, 746, 748, 749, 750,
  2919. 346, 790, 791, 792, 793, 794, 795, 751, 752, 571,
  2920. 572, 784, 775, 773, 774, 787, 770, 771, 881, 321,
  2921. 573, 574, 769, 575, 576, 577, 578, 579, 580,-32766,
  2922. 82, 83, 84, -575, 772, 581, 582, -575, 148, 747,
  2923. 717, 718, 719, 720, 721, 1278, 722, 723, 724, 760,
  2924. 761, 36, 1277, 85, 86, 87, 88, 89, 90, 91,
  2925. 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
  2926. 102, 103, 104, 105, 106, 107, 108, 996, 270, 150,
  2927. -32766,-32766,-32766, 455, 456, 81, 34, -264, -572, 1016,
  2928. 109, 320, -572, 893, 725, 682, 803, 128, 998, 999,
  2929. 592,-32766, 1044,-32766,-32766,-32766, 809, 151, 726, 727,
  2930. 728, 729, 730, 731, 732, -88, 1198, 796, 278, -526,
  2931. 283,-32766,-32766,-32766, 733, 734, 735, 736, 737, 738,
  2932. 739, 740, 741, 742, 743, 763, 786, 764, 765, 766,
  2933. 767, 755, 756, 757, 785, 758, 759, 744, 745, 746,
  2934. 748, 749, 750, 789, 790, 791, 792, 793, 794, 795,
  2935. 751, 752, 753, 754, 784, 775, 773, 774, 787, 770,
  2936. 771, 144, 804, 762, 768, 769, 776, 777, 779, 778,
  2937. 780, 781, -314, -526, -526, -193, -192, 772, 783, 782,
  2938. 49, 50, 51, 500, 52, 53, 239, 807, -526, -86,
  2939. 54, 55, -111, 56, 996, 253,-32766, -111, 800, -111,
  2940. -526, 541, -532, -352, 300, -352, 304, -111, -111, -111,
  2941. -111, -111, -111, -111, -111, 998, 999, 998, 999, 153,
  2942. -32766,-32766,-32766, 1191, 807, 126, 306, 1293, 57, 58,
  2943. 103, 104, 105, -111, 59, 1218, 60, 246, 247, 61,
  2944. 62, 63, 64, 65, 66, 67, 68, -525, 27, 268,
  2945. 69, 436, 501, -328, 808, -86, 1224, 1225, 502, 1189,
  2946. 807, 1198, 1230, 293, 1222, 41, 24, 503, 74, 504,
  2947. 953, 505, 320, 506, 802, 154, 507, 508, 279, 684,
  2948. 280, 43, 44, 437, 367, 366, 891, 45, 509, 35,
  2949. 249, -16, -566, 358, 332, 318, -566, 1198, 1193, 1192,
  2950. 1194, -527, 510, 511, 512, 333, -524, 1274, 48, 716,
  2951. 715, -525, -525, 334, 513, 514, 807, 1212, 1213, 1214,
  2952. 1215, 1209, 1210, 292, 360, 284, -525, 285, -314, 1216,
  2953. 1211, -193, -192, 1193, 1192, 1194, 293, 891, -525, 364,
  2954. -531, 70, 807, 316, 317, 320, 31, 110, 111, 112,
  2955. 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
  2956. -153, -153, -153, 638, 25, -527, -527, 687, 379, 881,
  2957. -524, -524, 296, 297, 891, -153, 432, -153, 807, -153,
  2958. -527, -153, 716, 715, 433, -524, 798, 363, -111, 1105,
  2959. 1107, 365, -527, 434, 891, 140, 435, -524, 954, 127,
  2960. -524, 320, -111, -111, 688, 813, 381, -529, 11, 834,
  2961. 155, 835, 867, -111, -111, -111, -111, 47, 293,-32766,
  2962. 881, 654, 655, 74, 689, 1191, 1045, 320, 708, 149,
  2963. 399, 157,-32766,-32766,-32766, 32,-32766, -79,-32766, 123,
  2964. -32766, 716, 715,-32766, 893, 891, 682, -153,-32766,-32766,
  2965. -32766, 716, 715, 891,-32766,-32766, 124, 881, 129, 74,
  2966. -32766, 411, 130, 320, -524, -524, 143, 141, -75,-32766,
  2967. 158, -529, -529, 320, 27, 691, 159, 881, 160, -524,
  2968. 161, 294, 295, 698, 368, 369, 807, -73,-32766, -72,
  2969. 1222, -524, 373, 374, 1191, 893, -71, 682, -529, 73,
  2970. -70,-32766,-32766,-32766, -69,-32766, -68,-32766, 125,-32766,
  2971. 630, 631,-32766, -67, -66, -47, -51,-32766,-32766,-32766,
  2972. -18, 147, 271,-32766,-32766, 277, 697, 700, 881,-32766,
  2973. 411, 890, 893, 146, 682, 282, 881, 907,-32766, 281,
  2974. 513, 514, 286, 1212, 1213, 1214, 1215, 1209, 1210, 326,
  2975. 131, 145, 939, 287, 682, 1216, 1211, 109, 270,-32766,
  2976. 798, 807,-32766, 662, 639, 1191, 657, 72, 675, 1075,
  2977. 317, 320,-32766,-32766,-32766, 1305,-32766, 301,-32766, 628,
  2978. -32766, 431, 543,-32766,-32766, 923, 555, 924,-32766,-32766,
  2979. -32766, 1229, 549,-32766,-32766,-32766, -4, 891, -490, 1191,
  2980. -32766, 411, 644, 893, 299, 682,-32766,-32766,-32766,-32766,
  2981. -32766, 893,-32766, 682,-32766, 13, 1231,-32766, 452, 480,
  2982. 645, 909,-32766,-32766,-32766,-32766, 658, -480,-32766,-32766,
  2983. 0, 1191, 0, 0,-32766, 411, 0, 298,-32766,-32766,
  2984. -32766, 305,-32766,-32766,-32766, 0,-32766, 0, 806,-32766,
  2985. 0, 0, 0, 475,-32766,-32766,-32766,-32766, 0, 7,
  2986. -32766,-32766, 16, 1191, 561, 596,-32766, 411, 1219, 891,
  2987. -32766,-32766,-32766, 362,-32766,-32766,-32766, 818,-32766, -267,
  2988. 881,-32766, 39, 293, 0, 0,-32766,-32766,-32766, 40,
  2989. 705, 706,-32766,-32766, 872, 963, 940, 947,-32766, 411,
  2990. 937, 948, 365, 870, 427, 891, 935,-32766, 1049, 291,
  2991. 1244, 1052, 1053, -111, -111, 1050, 1051, 1057, -560, 1262,
  2992. 1296, 633, 0, 826, -111, -111, -111, -111, 33, 315,
  2993. -32766, 361, 683, 686, 690, 692, 1191, 693, 694, 695,
  2994. 699, 685, 320,-32766,-32766,-32766, 9,-32766, 702,-32766,
  2995. 868,-32766, 881, 1300,-32766, 893, 1302, 682, -4,-32766,
  2996. -32766,-32766, 829, 828, 837,-32766,-32766, 916, -242, -242,
  2997. -242,-32766, 411, 955, 365, 27, 836, 1301, 915, 917,
  2998. -32766, 914, 1177, 900, 910, -111, -111, 807, 881, 898,
  2999. 945, 1222, 946, 1299, 1256, 867, -111, -111, -111, -111,
  3000. 1245, 1263, 1269, 1272, -241, -241, -241, -558, -532, -531,
  3001. 365, -530, 1, 28, 29, 38, 42, 46, 71, 0,
  3002. 75, -111, -111, 76, 77, 78, 79, 893, 80, 682,
  3003. -242, 867, -111, -111, -111, -111, 142, 152, 156, 245,
  3004. 322, 347, 514, 348, 1212, 1213, 1214, 1215, 1209, 1210,
  3005. 349, 350, 351, 352, 353, 354, 1216, 1211, 355, 356,
  3006. 357, 359, 428, 893, -265, 682, -241, -264, 72, 0,
  3007. 18, 317, 320, 19, 20, 21, 23, 398, 471, 472,
  3008. 479, 482, 483, 484, 485, 489, 490, 491, 498, 669,
  3009. 1202, 1145, 1220, 1019, 1018, 1181, -269, -103, 17, 22,
  3010. 26, 290, 397, 589, 593, 620, 674, 1149, 1197, 1146,
  3011. 1275, 0, -494, 1162, 0, 1223
  3012. ];
  3013. PHP.Parser.prototype.yycheck = [
  3014. 2, 3, 4, 5, 6, 7, 0, 9, 10, 11,
  3015. 12, 13, 106, 1, 108, 31, 9, 10, 11, 44,
  3016. 45, 46, 47, 48, 49, 50, 51, 52, 116, 117,
  3017. 118, 119, 120, 121, 122, 37, 38, 30, 116, 32,
  3018. 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
  3019. 43, 117, 118, 9, 10, 57, 9, 10, 11, 137,
  3020. 138, 155, 128, 129, 130, 131, 106, 107, 8, 71,
  3021. 72, 73, 74, 75, 76, 77, 116, 30, 80, 32,
  3022. 33, 34, 35, 36, 1, 87, 88, 89, 90, 91,
  3023. 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
  3024. 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  3025. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
  3026. 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
  3027. 132, 133, 30, 80, 136, 137, 138, 139, 140, 141,
  3028. 142, 143, 144, 51, 1, 161, 101, 80, 150, 151,
  3029. 152, 8, 154, 9, 10, 11, 2, 3, 4, 5,
  3030. 6, 7, 164, 9, 10, 11, 12, 13, 123, 9,
  3031. 10, 11, 80, 161, 30, 83, 32, 33, 34, 35,
  3032. 36, 37, 38, 116, 117, 118, 119, 120, 121, 122,
  3033. 30, 37, 38, 106, 107, 1, 9, 10, 11, 1,
  3034. 53, 54, 55, 116, 57, 1, 8, 14, 155, 156,
  3035. 157, 57, 9, 10, 11, 162, 69, 30, 116, 32,
  3036. 33, 119, 120, 121, 122, 71, 72, 73, 74, 75,
  3037. 76, 77, 8, 30, 80, 32, 33, 34, 35, 137,
  3038. 138, 87, 88, 89, 90, 91, 92, 93, 94, 95,
  3039. 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
  3040. 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
  3041. 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
  3042. 126, 127, 128, 129, 130, 131, 132, 133, 84, 70,
  3043. 136, 137, 138, 139, 140, 141, 142, 143, 144, 9,
  3044. 9, 10, 11, 160, 150, 151, 152, 164, 154, 2,
  3045. 3, 4, 5, 6, 7, 1, 9, 10, 11, 12,
  3046. 13, 30, 8, 32, 33, 34, 35, 36, 37, 38,
  3047. 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
  3048. 49, 50, 51, 52, 53, 54, 55, 116, 57, 14,
  3049. 9, 10, 11, 134, 135, 161, 8, 164, 160, 1,
  3050. 69, 167, 164, 159, 57, 161, 80, 8, 137, 138,
  3051. 1, 30, 1, 32, 33, 34, 1, 14, 71, 72,
  3052. 73, 74, 75, 76, 77, 31, 1, 80, 30, 70,
  3053. 30, 9, 10, 11, 87, 88, 89, 90, 91, 92,
  3054. 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
  3055. 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
  3056. 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
  3057. 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
  3058. 133, 8, 156, 136, 137, 138, 139, 140, 141, 142,
  3059. 143, 144, 8, 134, 135, 8, 8, 150, 151, 152,
  3060. 2, 3, 4, 5, 6, 7, 97, 82, 149, 31,
  3061. 12, 13, 101, 15, 116, 8, 116, 106, 80, 108,
  3062. 161, 85, 163, 106, 113, 108, 8, 116, 117, 118,
  3063. 119, 120, 121, 122, 123, 137, 138, 137, 138, 14,
  3064. 9, 10, 11, 80, 82, 14, 8, 85, 50, 51,
  3065. 50, 51, 52, 128, 56, 1, 58, 59, 60, 61,
  3066. 62, 63, 64, 65, 66, 67, 68, 70, 70, 71,
  3067. 72, 73, 74, 162, 159, 97, 78, 79, 80, 116,
  3068. 82, 1, 146, 158, 86, 87, 88, 89, 163, 91,
  3069. 31, 93, 167, 95, 156, 14, 98, 99, 35, 161,
  3070. 37, 103, 104, 105, 106, 107, 1, 109, 110, 147,
  3071. 148, 31, 160, 115, 116, 8, 164, 1, 155, 156,
  3072. 157, 70, 124, 125, 126, 8, 70, 1, 70, 37,
  3073. 38, 134, 135, 8, 136, 137, 82, 139, 140, 141,
  3074. 142, 143, 144, 145, 8, 35, 149, 37, 164, 151,
  3075. 152, 164, 164, 155, 156, 157, 158, 1, 161, 8,
  3076. 163, 163, 82, 165, 166, 167, 16, 17, 18, 19,
  3077. 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
  3078. 75, 76, 77, 75, 76, 134, 135, 31, 8, 84,
  3079. 134, 135, 134, 135, 1, 90, 8, 92, 82, 94,
  3080. 149, 96, 37, 38, 8, 149, 80, 149, 128, 59,
  3081. 60, 106, 161, 8, 1, 161, 8, 161, 159, 161,
  3082. 70, 167, 117, 118, 31, 8, 106, 70, 108, 106,
  3083. 14, 108, 127, 128, 129, 130, 131, 70, 158, 74,
  3084. 84, 75, 76, 163, 31, 80, 159, 167, 161, 101,
  3085. 102, 14, 87, 88, 89, 14, 91, 31, 93, 16,
  3086. 95, 37, 38, 98, 159, 1, 161, 162, 103, 104,
  3087. 105, 37, 38, 1, 109, 110, 16, 84, 16, 163,
  3088. 115, 116, 16, 167, 134, 135, 16, 161, 31, 124,
  3089. 16, 134, 135, 167, 70, 31, 16, 84, 16, 149,
  3090. 16, 134, 135, 31, 106, 107, 82, 31, 74, 31,
  3091. 86, 161, 106, 107, 80, 159, 31, 161, 161, 154,
  3092. 31, 87, 88, 89, 31, 91, 31, 93, 161, 95,
  3093. 111, 112, 98, 31, 31, 31, 31, 103, 104, 105,
  3094. 31, 31, 31, 109, 110, 31, 31, 31, 84, 115,
  3095. 116, 31, 159, 31, 161, 37, 84, 38, 124, 35,
  3096. 136, 137, 35, 139, 140, 141, 142, 143, 144, 35,
  3097. 31, 70, 159, 37, 161, 151, 152, 69, 57, 74,
  3098. 80, 82, 85, 77, 90, 80, 94, 163, 92, 82,
  3099. 166, 167, 87, 88, 89, 83, 91, 114, 93, 113,
  3100. 95, 128, 85, 98, 116, 128, 153, 128, 103, 104,
  3101. 105, 146, 89, 74, 109, 110, 0, 1, 149, 80,
  3102. 115, 116, 96, 159, 133, 161, 87, 88, 89, 124,
  3103. 91, 159, 93, 161, 95, 97, 146, 98, 97, 97,
  3104. 100, 154, 103, 104, 105, 74, 100, 149, 109, 110,
  3105. -1, 80, -1, -1, 115, 116, -1, 132, 87, 88,
  3106. 89, 132, 91, 124, 93, -1, 95, -1, 155, 98,
  3107. -1, -1, -1, 102, 103, 104, 105, 74, -1, 149,
  3108. 109, 110, 149, 80, 81, 153, 115, 116, 160, 1,
  3109. 87, 88, 89, 149, 91, 124, 93, 160, 95, 164,
  3110. 84, 98, 159, 158, -1, -1, 103, 104, 105, 159,
  3111. 159, 159, 109, 110, 159, 159, 159, 159, 115, 116,
  3112. 159, 159, 106, 159, 108, 1, 159, 124, 159, 113,
  3113. 160, 159, 159, 117, 118, 159, 159, 159, 163, 160,
  3114. 160, 160, -1, 127, 128, 129, 130, 131, 161, 161,
  3115. 74, 161, 161, 161, 161, 161, 80, 161, 161, 161,
  3116. 161, 161, 167, 87, 88, 89, 150, 91, 162, 93,
  3117. 162, 95, 84, 162, 98, 159, 162, 161, 162, 103,
  3118. 104, 105, 162, 162, 162, 109, 110, 162, 100, 101,
  3119. 102, 115, 116, 162, 106, 70, 162, 162, 162, 162,
  3120. 124, 162, 162, 162, 162, 117, 118, 82, 84, 162,
  3121. 162, 86, 162, 162, 162, 127, 128, 129, 130, 131,
  3122. 162, 162, 162, 162, 100, 101, 102, 163, 163, 163,
  3123. 106, 163, 163, 163, 163, 163, 163, 163, 163, -1,
  3124. 163, 117, 118, 163, 163, 163, 163, 159, 163, 161,
  3125. 162, 127, 128, 129, 130, 131, 163, 163, 163, 163,
  3126. 163, 163, 137, 163, 139, 140, 141, 142, 143, 144,
  3127. 163, 163, 163, 163, 163, 163, 151, 152, 163, 163,
  3128. 163, 163, 163, 159, 164, 161, 162, 164, 163, -1,
  3129. 164, 166, 167, 164, 164, 164, 164, 164, 164, 164,
  3130. 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
  3131. 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
  3132. 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
  3133. 164, -1, 165, 165, -1, 166
  3134. ];
  3135. PHP.Parser.prototype.yybase = [
  3136. 0, -2, 154, 565, 876, 948, 984, 514, 53, 398,
  3137. 837, 307, 307, 67, 307, 307, 307, 653, 724, 724,
  3138. 732, 724, 616, 673, 204, 204, 204, 625, 625, 625,
  3139. 625, 694, 694, 831, 831, 863, 799, 765, 936, 936,
  3140. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3141. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3142. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3143. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3144. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3145. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3146. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3147. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3148. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3149. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3150. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3151. 936, 936, 936, 936, 936, 936, 936, 936, 936, 936,
  3152. 936, 936, 375, 519, 369, 701, 1017, 1023, 1019, 1024,
  3153. 1015, 1014, 1018, 1020, 1025, 911, 912, 782, 918, 919,
  3154. 920, 921, 1021, 841, 1016, 1022, 291, 291, 291, 291,
  3155. 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
  3156. 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
  3157. 291, 291, 290, 491, 44, 382, 382, 382, 382, 382,
  3158. 382, 382, 382, 382, 382, 382, 382, 382, 382, 382,
  3159. 382, 382, 382, 382, 382, 160, 160, 160, 187, 684,
  3160. 684, 341, 203, 610, 47, 985, 985, 985, 985, 985,
  3161. 985, 985, 985, 985, 985, 144, 144, 7, 7, 7,
  3162. 7, 7, 371, -25, -25, -25, -25, 540, 385, 102,
  3163. 576, 358, 45, 377, 460, 460, 360, 231, 231, 231,
  3164. 231, 231, 231, -78, -78, -78, -78, -78, -66, 319,
  3165. 457, -94, 396, 423, 586, 586, 586, 586, 423, 423,
  3166. 423, 423, 750, 1029, 423, 423, 423, 511, 516, 516,
  3167. 518, 147, 147, 147, 516, 583, 777, 422, 583, 422,
  3168. 194, 92, 748, -40, 87, 412, 748, 617, 627, 198,
  3169. 143, 773, 658, 773, 1013, 757, 764, 717, 838, 860,
  3170. 1026, 800, 908, 806, 910, 219, 686, 1012, 1012, 1012,
  3171. 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 855, 552,
  3172. 1013, 286, 855, 855, 855, 552, 552, 552, 552, 552,
  3173. 552, 552, 552, 552, 552, 679, 286, 568, 626, 286,
  3174. 794, 552, 375, 758, 375, 375, 375, 375, 958, 375,
  3175. 375, 375, 375, 375, 375, 970, 769, -16, 375, 519,
  3176. 12, 12, 547, 83, 12, 12, 12, 12, 375, 375,
  3177. 375, 658, 781, 713, 666, 792, 448, 781, 781, 781,
  3178. 438, 444, 193, 447, 570, 523, 580, 760, 760, 767,
  3179. 929, 929, 760, 759, 760, 767, 934, 760, 929, 805,
  3180. 359, 648, 577, 611, 656, 929, 478, 760, 760, 760,
  3181. 760, 665, 760, 467, 433, 760, 760, 785, 774, 789,
  3182. 60, 929, 929, 929, 789, 596, 751, 751, 751, 811,
  3183. 812, 746, 771, 567, 498, 677, 348, 779, 771, 771,
  3184. 760, 640, 746, 771, 746, 771, 747, 771, 771, 771,
  3185. 746, 771, 759, 585, 771, 734, 668, 224, 771, 6,
  3186. 935, 937, 354, 940, 932, 941, 979, 942, 943, 851,
  3187. 956, 933, 945, 931, 930, 780, 703, 720, 790, 729,
  3188. 928, 768, 768, 768, 925, 768, 768, 768, 768, 768,
  3189. 768, 768, 768, 703, 788, 804, 733, 783, 960, 722,
  3190. 726, 725, 868, 1027, 1028, 737, 739, 958, 1006, 953,
  3191. 803, 730, 992, 967, 866, 848, 968, 969, 993, 1007,
  3192. 1008, 871, 761, 874, 880, 797, 971, 852, 768, 935,
  3193. 943, 933, 945, 931, 930, 763, 762, 753, 755, 749,
  3194. 745, 736, 738, 770, 1009, 924, 835, 830, 970, 926,
  3195. 703, 839, 986, 847, 994, 995, 850, 801, 772, 840,
  3196. 881, 972, 975, 976, 853, 1010, 810, 989, 795, 996,
  3197. 802, 882, 997, 998, 999, 1000, 885, 854, 856, 857,
  3198. 815, 754, 980, 786, 891, 335, 787, 796, 978, 363,
  3199. 957, 858, 894, 895, 1001, 1002, 1003, 896, 954, 816,
  3200. 990, 752, 991, 983, 817, 818, 485, 784, 778, 541,
  3201. 676, 897, 899, 900, 955, 775, 766, 821, 822, 1011,
  3202. 901, 697, 824, 740, 902, 1005, 742, 744, 756, 859,
  3203. 793, 743, 798, 977, 776, 827, 907, 829, 832, 833,
  3204. 1004, 836, 0, 0, 0, 0, 0, 0, 0, 0,
  3205. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  3206. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  3207. 0, 458, 458, 458, 458, 458, 458, 307, 307, 307,
  3208. 307, 0, 0, 307, 0, 0, 0, 458, 458, 458,
  3209. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3210. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3211. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3212. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3213. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3214. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3215. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3216. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3217. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3218. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3219. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3220. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3221. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3222. 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,
  3223. 458, 458, 291, 291, 291, 291, 291, 291, 291, 291,
  3224. 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
  3225. 291, 291, 291, 291, 291, 291, 0, 0, 0, 0,
  3226. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  3227. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  3228. 0, 0, 291, 291, 291, 291, 291, 291, 291, 291,
  3229. 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
  3230. 291, 291, 291, 291, 291, 291, 291, 291, 291, 423,
  3231. 423, 291, 291, 0, 291, 423, 423, 423, 423, 423,
  3232. 423, 423, 423, 423, 423, 291, 291, 291, 291, 291,
  3233. 291, 291, 805, 147, 147, 147, 147, 423, 423, 423,
  3234. 423, 423, -88, -88, 147, 147, 423, 423, 423, 423,
  3235. 423, 423, 423, 423, 423, 423, 423, 423, 0, 0,
  3236. 0, 286, 422, 0, 759, 759, 759, 759, 0, 0,
  3237. 0, 0, 422, 422, 0, 0, 0, 0, 0, 0,
  3238. 0, 0, 0, 0, 0, 286, 422, 0, 286, 0,
  3239. 759, 759, 423, 805, 805, 314, 423, 0, 0, 0,
  3240. 0, 286, 759, 286, 552, 422, 552, 552, 12, 375,
  3241. 314, 608, 608, 608, 608, 0, 658, 805, 805, 805,
  3242. 805, 805, 805, 805, 805, 805, 805, 805, 759, 0,
  3243. 805, 0, 759, 759, 759, 0, 0, 0, 0, 0,
  3244. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  3245. 759, 0, 0, 929, 0, 0, 0, 0, 760, 0,
  3246. 0, 0, 0, 0, 0, 760, 934, 0, 0, 0,
  3247. 0, 0, 0, 759, 0, 0, 0, 0, 0, 0,
  3248. 0, 0, 768, 801, 0, 801, 0, 768, 768, 768
  3249. ];
  3250. PHP.Parser.prototype.yydefault = [
  3251. 3,32767, 103,32767,32767,32767,32767,32767,32767,32767,
  3252. 32767,32767, 101,32767,32767,32767,32767,32767,32767,32767,
  3253. 32767,32767,32767,32767,32767,32767,32767, 578, 578, 578,
  3254. 578,32767,32767, 246, 103,32767,32767, 454, 372, 372,
  3255. 372,32767,32767, 522, 522, 522, 522, 522, 522,32767,
  3256. 32767,32767,32767,32767,32767, 454,32767,32767,32767,32767,
  3257. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3258. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3259. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3260. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3261. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3262. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3263. 32767,32767,32767,32767,32767,32767,32767,32767, 101,32767,
  3264. 32767,32767, 37, 7, 8, 10, 11, 50, 17, 310,
  3265. 32767,32767,32767,32767, 103,32767,32767,32767,32767,32767,
  3266. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3267. 32767,32767,32767,32767,32767, 571,32767,32767,32767,32767,
  3268. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3269. 32767,32767,32767,32767,32767,32767, 458, 437, 438, 440,
  3270. 441, 371, 523, 577, 313, 574, 370, 146, 325, 315,
  3271. 234, 316, 250, 459, 251, 460, 463, 464, 211, 279,
  3272. 367, 150, 401, 455, 403, 453, 457, 402, 377, 382,
  3273. 383, 384, 385, 386, 387, 388, 389, 390, 391, 392,
  3274. 393, 394, 375, 376, 456, 434, 433, 432, 399,32767,
  3275. 32767, 400, 404, 374, 407,32767,32767,32767,32767,32767,
  3276. 32767,32767,32767, 103,32767, 405, 406, 423, 424, 421,
  3277. 422, 425,32767, 426, 427, 428, 429,32767,32767, 302,
  3278. 32767,32767, 351, 349, 414, 415, 302,32767,32767,32767,
  3279. 32767,32767,32767,32767,32767,32767,32767,32767,32767, 516,
  3280. 431,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3281. 32767,32767,32767,32767, 103,32767, 101, 518, 396, 398,
  3282. 486, 409, 410, 408, 378,32767, 493,32767, 103, 495,
  3283. 32767,32767,32767, 112,32767,32767,32767, 517,32767, 524,
  3284. 524,32767, 479, 101, 194,32767, 194, 194,32767,32767,
  3285. 32767,32767,32767,32767,32767, 585, 479, 111, 111, 111,
  3286. 111, 111, 111, 111, 111, 111, 111, 111,32767, 194,
  3287. 111,32767,32767,32767, 101, 194, 194, 194, 194, 194,
  3288. 194, 194, 194, 194, 194, 189,32767, 260, 262, 103,
  3289. 539, 194,32767, 498,32767,32767,32767,32767,32767,32767,
  3290. 32767,32767,32767,32767,32767,32767, 491,32767,32767,32767,
  3291. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3292. 32767, 479, 419, 139,32767, 139, 524, 411, 412, 413,
  3293. 481, 524, 524, 524, 298, 281,32767,32767,32767,32767,
  3294. 496, 496, 101, 101, 101, 101, 491,32767,32767, 112,
  3295. 100, 100, 100, 100, 100, 104, 102,32767,32767,32767,
  3296. 32767, 100,32767, 102, 102,32767,32767, 217, 208, 215,
  3297. 102,32767, 543, 544, 215, 102, 219, 219, 219, 239,
  3298. 239, 470, 304, 102, 100, 102, 102, 196, 304, 304,
  3299. 32767, 102, 470, 304, 470, 304, 198, 304, 304, 304,
  3300. 470, 304,32767, 102, 304, 210, 100, 100, 304,32767,
  3301. 32767,32767, 481,32767,32767,32767,32767,32767,32767,32767,
  3302. 32767,32767,32767,32767,32767,32767,32767, 511,32767, 528,
  3303. 541, 417, 418, 420, 526, 442, 443, 444, 445, 446,
  3304. 447, 448, 450, 573,32767, 485,32767,32767,32767,32767,
  3305. 324, 583,32767, 583,32767,32767,32767,32767,32767,32767,
  3306. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3307. 32767, 584,32767, 524,32767,32767,32767,32767, 416, 9,
  3308. 76, 43, 44, 52, 58, 502, 503, 504, 505, 499,
  3309. 500, 506, 501,32767,32767, 507, 549,32767,32767, 525,
  3310. 576,32767,32767,32767,32767,32767,32767, 139,32767,32767,
  3311. 32767,32767,32767,32767,32767,32767,32767,32767, 511,32767,
  3312. 137,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3313. 32767,32767, 524,32767,32767,32767, 300, 301,32767,32767,
  3314. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3315. 32767,32767,32767, 524,32767,32767,32767, 283, 284,32767,
  3316. 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
  3317. 32767,32767,32767, 278,32767,32767, 366,32767,32767,32767,
  3318. 32767, 345,32767,32767,32767,32767,32767,32767,32767,32767,
  3319. 32767,32767, 152, 152, 3, 3, 327, 152, 152, 152,
  3320. 327, 152, 327, 327, 327, 152, 152, 152, 152, 152,
  3321. 152, 272, 184, 254, 257, 239, 239, 152, 337, 152
  3322. ];
  3323. PHP.Parser.prototype.yygoto = [
  3324. 194, 194, 670, 422, 643, 463, 1264, 1265, 1022, 416,
  3325. 308, 309, 329, 563, 314, 421, 330, 423, 622, 801,
  3326. 678, 637, 586, 651, 652, 653, 165, 165, 165, 165,
  3327. 218, 195, 191, 191, 175, 177, 213, 191, 191, 191,
  3328. 191, 191, 192, 192, 192, 192, 192, 192, 186, 187,
  3329. 188, 189, 190, 215, 213, 216, 521, 522, 412, 523,
  3330. 525, 526, 527, 528, 529, 530, 531, 532, 1091, 166,
  3331. 167, 168, 193, 169, 170, 171, 164, 172, 173, 174,
  3332. 176, 212, 214, 217, 235, 238, 241, 242, 244, 255,
  3333. 256, 257, 258, 259, 260, 261, 263, 264, 265, 266,
  3334. 274, 275, 311, 312, 313, 417, 418, 419, 568, 219,
  3335. 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
  3336. 230, 231, 232, 233, 178, 234, 179, 196, 197, 198,
  3337. 236, 186, 187, 188, 189, 190, 215, 1091, 199, 180,
  3338. 181, 182, 200, 196, 183, 237, 201, 199, 163, 202,
  3339. 203, 184, 204, 205, 206, 185, 207, 208, 209, 210,
  3340. 211, 323, 323, 323, 323, 827, 608, 608, 824, 547,
  3341. 538, 342, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221,
  3342. 1221, 1221, 1239, 1239, 288, 288, 288, 288, 1239, 1239,
  3343. 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 388, 538,
  3344. 547, 556, 557, 395, 566, 588, 602, 603, 832, 825,
  3345. 880, 875, 876, 889, 15, 833, 877, 830, 878, 879,
  3346. 831, 799, 251, 251, 883, 919, 992, 1000, 1004, 1001,
  3347. 1005, 1237, 1237, 938, 1043, 1039, 1040, 1237, 1237, 1237,
  3348. 1237, 1237, 1237, 1237, 1237, 1237, 1237, 858, 248, 248,
  3349. 248, 248, 250, 252, 533, 533, 533, 533, 487, 590,
  3350. 488, 1190, 1190, 997, 1190, 997, 494, 1290, 1290, 560,
  3351. 997, 997, 997, 997, 997, 997, 997, 997, 997, 997,
  3352. 997, 997, 1261, 1261, 1290, 1261, 340, 1190, 930, 402,
  3353. 677, 1279, 1190, 1190, 1190, 1190, 959, 345, 1190, 1190,
  3354. 1190, 1271, 1271, 1271, 1271, 606, 640, 345, 345, 1273,
  3355. 1273, 1273, 1273, 820, 820, 805, 896, 884, 840, 885,
  3356. 897, 345, 345, 5, 345, 6, 1306, 384, 535, 535,
  3357. 559, 535, 415, 852, 597, 1257, 839, 540, 524, 524,
  3358. 345, 1289, 1289, 642, 524, 524, 524, 524, 524, 524,
  3359. 524, 524, 524, 524, 445, 805, 1140, 805, 1289, 932,
  3360. 932, 932, 932, 1063, 1064, 445, 926, 933, 386, 390,
  3361. 548, 587, 591, 1030, 1292, 331, 554, 1259, 1259, 1030,
  3362. 704, 621, 623, 823, 641, 1250, 319, 303, 660, 664,
  3363. 973, 668, 676, 969, 429, 553, 962, 936, 936, 934,
  3364. 936, 703, 601, 537, 971, 966, 343, 344, 663, 817,
  3365. 595, 609, 612, 613, 614, 615, 634, 635, 636, 680,
  3366. 439, 1186, 845, 454, 454, 439, 439, 1266, 1267, 820,
  3367. 901, 1079, 454, 394, 539, 551, 1183, 605, 540, 539,
  3368. 842, 551, 978, 272, 387, 618, 619, 981, 536, 536,
  3369. 844, 707, 646, 957, 567, 457, 458, 459, 838, 850,
  3370. 254, 254, 1297, 1298, 400, 401, 976, 976, 464, 649,
  3371. 1182, 650, 1028, 404, 405, 406, 1187, 661, 424, 1032,
  3372. 407, 564, 600, 815, 338, 424, 854, 848, 853, 841,
  3373. 1027, 1031, 1009, 1002, 1006, 1003, 1007, 1185, 941, 1188,
  3374. 1247, 1248, 943, 0, 1074, 439, 439, 439, 439, 439,
  3375. 439, 439, 439, 439, 439, 439, 0, 468, 439, 585,
  3376. 1056, 931, 681, 667, 667, 0, 495, 673, 1054, 1171,
  3377. 912, 0, 0, 1172, 1175, 913, 1176, 0, 0, 0,
  3378. 0, 0, 0, 1072, 857
  3379. ];
  3380. PHP.Parser.prototype.yygcheck = [
  3381. 42, 42, 72, 65, 65, 166, 166, 166, 119, 65,
  3382. 65, 65, 65, 65, 65, 65, 65, 65, 65, 7,
  3383. 9, 84, 122, 84, 84, 84, 42, 42, 42, 42,
  3384. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3385. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3386. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3387. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3388. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3389. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3390. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3391. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3392. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3393. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3394. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3395. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3396. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3397. 42, 23, 23, 23, 23, 15, 104, 104, 26, 75,
  3398. 75, 93, 104, 104, 104, 104, 104, 104, 104, 104,
  3399. 104, 104, 160, 160, 24, 24, 24, 24, 160, 160,
  3400. 160, 160, 160, 160, 160, 160, 160, 160, 75, 75,
  3401. 75, 75, 75, 75, 75, 75, 75, 75, 15, 27,
  3402. 15, 15, 15, 15, 75, 15, 15, 15, 15, 15,
  3403. 15, 6, 5, 5, 15, 87, 87, 87, 87, 87,
  3404. 87, 161, 161, 49, 15, 15, 15, 161, 161, 161,
  3405. 161, 161, 161, 161, 161, 161, 161, 45, 5, 5,
  3406. 5, 5, 5, 5, 103, 103, 103, 103, 147, 103,
  3407. 147, 72, 72, 72, 72, 72, 147, 173, 173, 162,
  3408. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  3409. 72, 72, 122, 122, 173, 122, 169, 72, 89, 89,
  3410. 89, 171, 72, 72, 72, 72, 99, 14, 72, 72,
  3411. 72, 9, 9, 9, 9, 55, 55, 14, 14, 122,
  3412. 122, 122, 122, 22, 22, 12, 72, 64, 35, 64,
  3413. 72, 14, 14, 46, 14, 46, 14, 61, 19, 19,
  3414. 100, 19, 13, 35, 13, 122, 35, 14, 163, 163,
  3415. 14, 172, 172, 63, 163, 163, 163, 163, 163, 163,
  3416. 163, 163, 163, 163, 19, 12, 143, 12, 172, 19,
  3417. 19, 19, 19, 136, 136, 19, 19, 19, 58, 58,
  3418. 58, 58, 58, 122, 172, 29, 48, 122, 122, 122,
  3419. 48, 48, 48, 25, 48, 14, 159, 159, 48, 48,
  3420. 48, 48, 48, 48, 109, 9, 25, 25, 25, 25,
  3421. 25, 25, 9, 25, 25, 25, 93, 93, 14, 18,
  3422. 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
  3423. 23, 20, 39, 141, 141, 23, 23, 168, 168, 22,
  3424. 17, 17, 141, 28, 9, 9, 152, 17, 14, 9,
  3425. 37, 9, 17, 24, 9, 83, 83, 106, 24, 24,
  3426. 17, 95, 17, 17, 9, 9, 9, 9, 17, 9,
  3427. 5, 5, 9, 9, 80, 80, 103, 103, 149, 80,
  3428. 17, 80, 121, 80, 80, 80, 20, 80, 113, 124,
  3429. 80, 2, 2, 20, 80, 113, 41, 9, 16, 16,
  3430. 16, 16, 113, 113, 113, 113, 113, 14, 16, 20,
  3431. 20, 20, 92, -1, 139, 23, 23, 23, 23, 23,
  3432. 23, 23, 23, 23, 23, 23, -1, 82, 23, 8,
  3433. 8, 16, 8, 8, 8, -1, 8, 8, 8, 78,
  3434. 78, -1, -1, 78, 78, 78, 78, -1, -1, -1,
  3435. -1, -1, -1, 16, 16
  3436. ];
  3437. PHP.Parser.prototype.yygbase = [
  3438. 0, 0, -203, 0, 0, 221, 208, 10, 512, 7,
  3439. 0, 0, 24, 1, 5, -174, 47, -23, 105, 61,
  3440. 38, 0, -10, 158, 181, 379, 164, 205, 102, 84,
  3441. 0, 0, 0, 0, 0, -43, 0, 107, 0, 104,
  3442. 0, 54, -1, 0, 0, 235, -384, 0, -307, 210,
  3443. 0, 0, 0, 0, 0, 266, 0, 0, 324, 0,
  3444. 0, 286, 0, 103, 298, -236, 0, 0, 0, 0,
  3445. 0, 0, -6, 0, 0, -167, 0, 0, 129, 62,
  3446. -14, 0, 53, -22, -669, 0, 0, -52, 0, -11,
  3447. 0, 0, 68, -299, 0, 52, 0, 0, 0, 262,
  3448. 288, 0, 0, 227, -73, 0, 87, 0, 0, 118,
  3449. 0, 0, 0, 209, 0, 0, 0, 0, 0, 6,
  3450. 0, 108, 15, 0, 46, 0, 0, 0, 0, 0,
  3451. 0, 0, 0, 0, 0, 0, 91, 0, 0, 69,
  3452. 0, 390, 0, 86, 0, 0, 0, -224, 0, 37,
  3453. 0, 0, 77, 0, 0, 0, 0, 0, 0, 70,
  3454. -57, -8, 241, 99, 0, 0, -290, 0, 65, 257,
  3455. 0, 261, 39, -35, 0, 0
  3456. ];
  3457. PHP.Parser.prototype.yygdefault = [
  3458. -32768, 499, 711, 4, 712, 905, 788, 797, 583, 515,
  3459. 679, 339, 610, 413, 1255, 882, 1078, 565, 816, 1199,
  3460. 1207, 446, 819, 324, 701, 864, 865, 866, 391, 376,
  3461. 382, 389, 632, 611, 481, 851, 442, 843, 473, 846,
  3462. 441, 855, 162, 410, 497, 859, 3, 861, 542, 892,
  3463. 377, 869, 378, 656, 871, 550, 873, 874, 385, 392,
  3464. 393, 1083, 558, 607, 886, 243, 552, 887, 375, 888,
  3465. 895, 380, 383, 665, 453, 492, 486, 403, 1058, 594,
  3466. 629, 450, 467, 617, 616, 604, 466, 425, 408, 928,
  3467. 474, 451, 942, 341, 950, 709, 1090, 624, 476, 958,
  3468. 625, 965, 968, 516, 517, 465, 980, 269, 983, 477,
  3469. 1015, 647, 648, 995, 626, 627, 1013, 460, 584, 1021,
  3470. 443, 1029, 1243, 444, 1033, 262, 1036, 276, 409, 426,
  3471. 1041, 1042, 8, 1048, 671, 672, 10, 273, 496, 1073,
  3472. 666, 440, 1089, 430, 1159, 1161, 544, 478, 1179, 1178,
  3473. 659, 493, 1184, 1246, 438, 518, 461, 310, 519, 302,
  3474. 327, 307, 534, 289, 328, 520, 462, 1252, 1260, 325,
  3475. 30, 1280, 1291, 335, 562, 599
  3476. ];
  3477. PHP.Parser.prototype.yylhs = [
  3478. 0, 1, 3, 3, 2, 5, 5, 6, 6, 6,
  3479. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  3480. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  3481. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  3482. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  3483. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  3484. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  3485. 6, 6, 6, 6, 6, 6, 6, 6, 7, 7,
  3486. 7, 7, 7, 7, 7, 7, 8, 8, 9, 10,
  3487. 11, 11, 11, 12, 12, 13, 13, 14, 15, 15,
  3488. 16, 16, 17, 17, 18, 18, 21, 21, 22, 23,
  3489. 23, 24, 24, 4, 4, 4, 4, 4, 4, 4,
  3490. 4, 4, 4, 4, 29, 29, 30, 30, 32, 34,
  3491. 34, 28, 36, 36, 33, 38, 38, 35, 35, 37,
  3492. 37, 39, 39, 31, 40, 40, 41, 43, 44, 44,
  3493. 45, 46, 46, 48, 47, 47, 47, 47, 49, 49,
  3494. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  3495. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  3496. 49, 49, 25, 25, 68, 68, 71, 71, 70, 69,
  3497. 69, 62, 74, 74, 75, 75, 76, 76, 77, 77,
  3498. 78, 78, 26, 26, 27, 27, 27, 27, 86, 86,
  3499. 88, 88, 81, 81, 81, 82, 82, 85, 85, 83,
  3500. 83, 89, 90, 90, 56, 56, 64, 64, 67, 67,
  3501. 67, 66, 91, 91, 92, 57, 57, 57, 57, 93,
  3502. 93, 94, 94, 95, 95, 96, 97, 97, 98, 98,
  3503. 99, 99, 54, 54, 50, 50, 101, 52, 52, 102,
  3504. 51, 51, 53, 53, 63, 63, 63, 63, 79, 79,
  3505. 105, 105, 107, 107, 108, 108, 108, 108, 106, 106,
  3506. 106, 110, 110, 110, 110, 87, 87, 113, 113, 113,
  3507. 111, 111, 114, 114, 112, 112, 115, 115, 116, 116,
  3508. 116, 116, 109, 109, 80, 80, 80, 20, 20, 20,
  3509. 118, 117, 117, 119, 119, 119, 119, 59, 120, 120,
  3510. 121, 60, 123, 123, 124, 124, 125, 125, 84, 126,
  3511. 126, 126, 126, 126, 126, 131, 131, 132, 132, 133,
  3512. 133, 133, 133, 133, 134, 135, 135, 130, 130, 127,
  3513. 127, 129, 129, 137, 137, 136, 136, 136, 136, 136,
  3514. 136, 136, 128, 138, 138, 140, 139, 139, 61, 100,
  3515. 141, 141, 55, 55, 42, 42, 42, 42, 42, 42,
  3516. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3517. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3518. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3519. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3520. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3521. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3522. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3523. 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
  3524. 42, 42, 42, 42, 42, 42, 42, 148, 142, 142,
  3525. 147, 147, 150, 151, 151, 152, 153, 153, 153, 19,
  3526. 19, 72, 72, 72, 72, 143, 143, 143, 143, 155,
  3527. 155, 144, 144, 146, 146, 146, 149, 149, 160, 160,
  3528. 160, 160, 160, 160, 160, 160, 160, 161, 161, 104,
  3529. 163, 163, 163, 163, 145, 145, 145, 145, 145, 145,
  3530. 145, 145, 58, 58, 158, 158, 158, 158, 164, 164,
  3531. 154, 154, 154, 165, 165, 165, 165, 165, 165, 73,
  3532. 73, 65, 65, 65, 65, 122, 122, 122, 122, 168,
  3533. 167, 157, 157, 157, 157, 157, 157, 157, 156, 156,
  3534. 156, 166, 166, 166, 166, 103, 162, 170, 170, 169,
  3535. 169, 171, 171, 171, 171, 171, 171, 171, 171, 159,
  3536. 159, 159, 159, 173, 174, 172, 172, 172, 172, 172,
  3537. 172, 172, 172, 175, 175, 175, 175
  3538. ];
  3539. PHP.Parser.prototype.yylen = [
  3540. 1, 1, 2, 0, 1, 1, 1, 1, 1, 1,
  3541. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3542. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3543. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3544. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3545. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3546. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3547. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3548. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3549. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  3550. 0, 1, 0, 1, 1, 2, 1, 3, 4, 1,
  3551. 2, 0, 1, 1, 1, 1, 1, 3, 5, 4,
  3552. 3, 4, 2, 3, 1, 1, 7, 6, 2, 3,
  3553. 1, 2, 3, 1, 2, 3, 1, 1, 3, 1,
  3554. 3, 1, 2, 2, 3, 1, 3, 2, 3, 1,
  3555. 3, 2, 0, 1, 1, 1, 1, 1, 3, 7,
  3556. 10, 5, 7, 9, 5, 3, 3, 3, 3, 3,
  3557. 3, 1, 2, 5, 7, 9, 6, 5, 6, 3,
  3558. 2, 1, 1, 1, 0, 2, 1, 3, 8, 0,
  3559. 4, 2, 1, 3, 0, 1, 0, 1, 0, 1,
  3560. 3, 1, 8, 9, 8, 7, 6, 8, 0, 2,
  3561. 0, 2, 1, 2, 2, 0, 2, 0, 2, 0,
  3562. 2, 2, 1, 3, 1, 4, 1, 4, 1, 1,
  3563. 4, 2, 1, 3, 3, 3, 4, 4, 5, 0,
  3564. 2, 4, 3, 1, 1, 7, 0, 2, 1, 3,
  3565. 3, 4, 1, 4, 0, 2, 5, 0, 2, 6,
  3566. 0, 2, 0, 3, 1, 2, 1, 1, 2, 0,
  3567. 1, 3, 0, 2, 1, 1, 1, 1, 6, 8,
  3568. 6, 1, 2, 1, 1, 1, 1, 1, 1, 1,
  3569. 3, 3, 3, 3, 3, 3, 3, 3, 1, 2,
  3570. 1, 1, 0, 1, 0, 2, 2, 2, 4, 3,
  3571. 1, 1, 3, 1, 2, 2, 3, 2, 3, 1,
  3572. 1, 2, 3, 1, 1, 3, 2, 0, 1, 5,
  3573. 5, 10, 3, 5, 1, 1, 3, 0, 2, 4,
  3574. 5, 4, 4, 4, 3, 1, 1, 1, 1, 1,
  3575. 1, 0, 1, 1, 2, 1, 1, 1, 1, 1,
  3576. 1, 1, 2, 1, 3, 1, 1, 3, 2, 2,
  3577. 3, 1, 0, 1, 1, 3, 3, 3, 4, 1,
  3578. 1, 2, 3, 3, 3, 3, 3, 3, 3, 3,
  3579. 3, 3, 3, 3, 3, 2, 2, 2, 2, 3,
  3580. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3581. 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
  3582. 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3583. 3, 3, 5, 4, 3, 4, 4, 2, 2, 4,
  3584. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  3585. 2, 1, 3, 2, 1, 2, 4, 2, 2, 8,
  3586. 9, 8, 9, 9, 10, 9, 10, 8, 3, 2,
  3587. 0, 4, 2, 1, 3, 2, 2, 2, 4, 1,
  3588. 1, 1, 1, 1, 1, 1, 1, 3, 1, 1,
  3589. 1, 0, 3, 0, 1, 1, 0, 1, 1, 1,
  3590. 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
  3591. 4, 1, 1, 3, 1, 1, 1, 1, 1, 3,
  3592. 2, 3, 0, 1, 1, 3, 1, 1, 1, 1,
  3593. 1, 3, 1, 1, 4, 4, 1, 4, 4, 0,
  3594. 1, 1, 1, 3, 3, 1, 4, 2, 2, 1,
  3595. 3, 1, 4, 4, 3, 3, 3, 3, 1, 3,
  3596. 1, 1, 3, 1, 1, 4, 1, 1, 1, 3,
  3597. 1, 1, 2, 1, 3, 4, 3, 2, 0, 2,
  3598. 2, 1, 2, 1, 1, 1, 4, 3, 3, 3,
  3599. 3, 6, 3, 1, 1, 2, 1
  3600. ];
  3601. exports.PHP = PHP;
  3602. });
  3603. ace.define("ace/mode/php_worker",[], function(require, exports, module) {
  3604. "use strict";
  3605. var oop = require("../lib/oop");
  3606. var Mirror = require("../worker/mirror").Mirror;
  3607. var PHP = require("./php/php").PHP;
  3608. var PhpWorker = exports.PhpWorker = function(sender) {
  3609. Mirror.call(this, sender);
  3610. this.setTimeout(500);
  3611. };
  3612. oop.inherits(PhpWorker, Mirror);
  3613. (function() {
  3614. this.setOptions = function(opts) {
  3615. this.inlinePhp = opts && opts.inline;
  3616. };
  3617. this.onUpdate = function() {
  3618. var value = this.doc.getValue();
  3619. var errors = [];
  3620. if (this.inlinePhp)
  3621. value = "<?" + value + "?>";
  3622. var tokens = PHP.Lexer(value, {short_open_tag: 1});
  3623. try {
  3624. new PHP.Parser(tokens);
  3625. } catch(e) {
  3626. errors.push({
  3627. row: e.line - 1,
  3628. column: null,
  3629. text: e.message.charAt(0).toUpperCase() + e.message.substring(1),
  3630. type: "error"
  3631. });
  3632. }
  3633. this.sender.emit("annotate", errors);
  3634. };
  3635. }).call(PhpWorker.prototype);
  3636. });