mode-terraform-9ed88640.js 7.2 KB

12
  1. import{g as R}from"./index-63ed8a66.js";function _(p,v){for(var n=0;n<v.length;n++){const s=v[n];if(typeof s!="string"&&!Array.isArray(s)){for(const f in s)if(f!=="default"&&!(f in p)){const g=Object.getOwnPropertyDescriptor(s,f);g&&Object.defineProperty(p,f,g.get?g:{enumerable:!0,get:()=>s[f]})}}}return Object.freeze(Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}))}var b={exports:{}};(function(p,v){ace.define("ace/mode/terraform_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(n,s,f){var g=n("../lib/oop"),d=n("./text_highlight_rules").TextHighlightRules,a=function(){this.$rules={start:[{token:["storage.function.terraform"],regex:"\\b(output|resource|data|variable|module|export)\\b"},{token:"variable.terraform",regex:"\\$\\s",push:[{token:"keyword.terraform",regex:"(-var-file|-var)"},{token:"variable.terraform",regex:"\\n|$",next:"pop"},{include:"strings"},{include:"variables"},{include:"operators"},{defaultToken:"text"}]},{token:"language.support.class",regex:"\\b(timeouts|provider|connection|provisioner|lifecycleprovider|atlas)\\b"},{token:"singleline.comment.terraform",regex:"#.*$"},{token:"singleline.comment.terraform",regex:"//.*$"},{token:"multiline.comment.begin.terraform",regex:/\/\*/,push:"blockComment"},{token:"storage.function.terraform",regex:"^\\s*(locals|terraform)\\s*{"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{include:"constants"},{include:"strings"},{include:"operators"},{include:"variables"}],blockComment:[{regex:/\*\//,token:"multiline.comment.end.terraform",next:"pop"},{defaultToken:"comment"}],constants:[{token:"constant.language.terraform",regex:"\\b(true|false|yes|no|on|off|EOF)\\b"},{token:"constant.numeric.terraform",regex:"(\\b([0-9]+)([kKmMgG]b?)?\\b)|(\\b(0x[0-9A-Fa-f]+)([kKmMgG]b?)?\\b)"}],variables:[{token:["variable.assignment.terraform","keyword.operator"],regex:"\\b([a-zA-Z_]+)(\\s*=)"}],interpolated_variables:[{token:"variable.terraform",regex:"\\b(var|self|count|path|local)\\b(?:\\.*[a-zA-Z_-]*)?"}],strings:[{token:"punctuation.quote.terraform",regex:"'",push:[{token:"punctuation.quote.terraform",regex:"'",next:"pop"},{include:"escaped_chars"},{defaultToken:"string"}]},{token:"punctuation.quote.terraform",regex:'"',push:[{token:"punctuation.quote.terraform",regex:'"',next:"pop"},{include:"interpolation"},{include:"escaped_chars"},{defaultToken:"string"}]}],escaped_chars:[{token:"constant.escaped_char.terraform",regex:"\\\\."}],operators:[{token:"keyword.operator",regex:"\\?|:|==|!=|>|<|>=|<=|&&|\\|\\||!|%|&|\\*|\\+|\\-|/|="}],interpolation:[{token:"punctuation.interpolated.begin.terraform",regex:"\\$?\\$\\{",push:[{token:"punctuation.interpolated.end.terraform",regex:"\\}",next:"pop"},{include:"interpolated_variables"},{include:"operators"},{include:"constants"},{include:"strings"},{include:"functions"},{include:"parenthesis"},{defaultToken:"punctuation"}]}],functions:[{token:"keyword.function.terraform",regex:"\\b(abs|basename|base64decode|base64encode|base64gzip|base64sha256|base64sha512|bcrypt|ceil|chomp|chunklist|cidrhost|cidrnetmask|cidrsubnet|coalesce|coalescelist|compact|concat|contains|dirname|distinct|element|file|floor|flatten|format|formatlist|indent|index|join|jsonencode|keys|length|list|log|lookup|lower|map|matchkeys|max|merge|min|md5|pathexpand|pow|replace|rsadecrypt|sha1|sha256|sha512|signum|slice|sort|split|substr|timestamp|timeadd|title|transpose|trimspace|upper|urlencode|uuid|values|zipmap)\\b"}],parenthesis:[{token:"paren.lparen",regex:"\\["},{token:"paren.rparen",regex:"\\]"}]},this.normalizeRules()};g.inherits(a,d),s.TerraformHighlightRules=a}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(n,s,f){var g=n("../../lib/oop"),d=n("../../range").Range,a=n("./fold_mode").FoldMode,c=s.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};g.inherits(c,a),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,r){var i=e.getLine(r);if(this.singleLineBlockCommentRe.test(i)&&!this.startRegionRe.test(i)&&!this.tripleStarBlockCommentRe.test(i))return"";var l=this._getFoldWidgetBase(e,t,r);return!l&&this.startRegionRe.test(i)?"start":l},this.getFoldWidgetRange=function(e,t,r,i){var l=e.getLine(r);if(this.startRegionRe.test(l))return this.getCommentRegionBlock(e,l,r);var o=l.match(this.foldingStartMarker);if(o){var m=o.index;if(o[1])return this.openingBracketBlock(e,o[1],r,m);var u=e.getCommentFoldRange(r,m+o[0].length,1);return u&&!u.isMultiLine()&&(i?u=this.getSectionRange(e,r):t!="all"&&(u=null)),u}if(t!=="markbegin"){var o=l.match(this.foldingStopMarker);if(o){var m=o.index+o[0].length;return o[1]?this.closingBracketBlock(e,o[1],r,m):e.getCommentFoldRange(r,m,-1)}}},this.getSectionRange=function(e,t){var r=e.getLine(t),i=r.search(/\S/),l=t,m=r.length;t=t+1;for(var u=t,o=e.getLength();++t<o;){r=e.getLine(t);var k=r.search(/\S/);if(k!==-1){if(i>k)break;var h=this.getFoldWidgetRange(e,"all",t);if(h){if(h.start.row<=l)break;if(h.isMultiLine())t=h.end.row;else if(i==k)break}u=t}}return new d(l,m,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,r){for(var i=t.search(/\s*$/),l=e.getLength(),m=r,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,o=1;++r<l;){t=e.getLine(r);var k=u.exec(t);if(k&&(k[1]?o--:o++,!o))break}var h=r;if(h>m)return new d(m,i,h,t.length)}}.call(c.prototype)}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(n,s,f){var g=n("../range").Range,d=function(){};(function(){this.checkOutdent=function(a,c){return/^\s+$/.test(a)?/^\s*\}/.test(c):!1},this.autoOutdent=function(a,c){var e=a.getLine(c),t=e.match(/^(\s*\})/);if(!t)return 0;var r=t[1].length,i=a.findMatchingBracket({row:c,column:r});if(!i||i.row==c)return 0;var l=this.$getIndent(a.getLine(i.row));a.replace(new g(c,0,c,r-1),l)},this.$getIndent=function(a){return a.match(/^\s*/)[0]}}).call(d.prototype),s.MatchingBraceOutdent=d}),ace.define("ace/mode/terraform",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/terraform_highlight_rules","ace/mode/folding/cstyle","ace/mode/matching_brace_outdent"],function(n,s,f){var g=n("../lib/oop"),d=n("./text").Mode,a=n("./terraform_highlight_rules").TerraformHighlightRules,c=n("./folding/cstyle").FoldMode,e=n("./matching_brace_outdent").MatchingBraceOutdent,t=function(){d.call(this),this.HighlightRules=a,this.$outdent=new e,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new c};g.inherits(t,d),function(){this.lineCommentStart=["#","//"],this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/terraform"}.call(t.prototype),s.Mode=t}),function(){ace.require(["ace/mode/terraform"],function(n){p&&(p.exports=n)})}()})(b);var x=b.exports;const M=R(x),$=_({__proto__:null,default:M},[x]);export{$ as m};
  2. //# sourceMappingURL=mode-terraform-9ed88640.js.map