worker-php.js 130 KB

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