49852db8b337fb8e781a58d82c81ead5.js 129 KB

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