worker-php.js 148 KB

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