/*---------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
"use strict";define("vs/languages/typescript/common/js/globalVariableRewriter",["require","exports","vs/base/common/strings"],function(e,t,n){var r=function(){function e(){this._pattern=/(\/\* ?globals? )([\s\S]+?)\*\//gm}return Object.defineProperty(e.prototype,"name",{get:function(){return"rewriter.globalVariables"},enumerable:!0,configurable:!0}),e.prototype.computeEdits=function(e){this._pattern.lastIndex=0;for(var t,r=e.sourceFile.getFullText(),i=[];t=this._pattern.exec(r);)t[2].split(",").forEach(function(e){e=e.trim();var t=e.indexOf(":");e=e.substring(0,~t?t:void 0),i.push(n.format("declare var {0}:any;\n",e))}),e.newAppend(i.join(n.empty))},e}();t.GlobalVariableCollector=r});