All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.ace.mode-live_script.js Maven / Gradle / Ivy

There is a newer version: 0.0.13
Show newest version
ace.define("ace/mode/live_script_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"punctuation.definition.comment.livescript",regex:"\\/\\*",push:[{token:"punctuation.definition.comment.livescript",regex:"\\*\\/",next:"pop"},{token:"storage.type.annotation.livescriptscript",regex:"@\\w*"},{defaultToken:"comment.block.livescript"}]},{token:["punctuation.definition.comment.livescript","comment.line.number-sign.livescript"],regex:"(#)(?!\\{)(.*$)"},{token:["variable.parameter.function.livescript","meta.inline.function.livescript","storage.type.function.livescript","meta.inline.function.livescript","variable.parameter.function.livescript","meta.inline.function.livescript","storage.type.function.livescript"],regex:"(\\s*\\!?\\(\\s*[^()]*?\\))(\\s*)(!?[~-]{1,2}>)|(\\s*\\!?)(\\(?[^()]*?\\)?)(\\s*)(<[~-]{1,2}!?)",comment:"match stuff like: a -> \u2026 "},{token:["keyword.operator.new.livescript","meta.class.instance.constructor","entity.name.type.instance.livescript"],regex:"(new)(\\s+)(\\w+(?:\\.\\w*)*)"},{token:"keyword.illegal.livescript",regex:"\\bp(?:ackage|r(?:ivate|otected)|ublic)|interface|enum|static|yield\\b"},{token:"punctuation.definition.string.begin.livescript",regex:"'''",push:[{token:"punctuation.definition.string.end.livescript",regex:"'''",next:"pop"},{defaultToken:"string.quoted.heredoc.livescript"}]},{token:"punctuation.definition.string.begin.livescript",regex:'"""',push:[{token:"punctuation.definition.string.end.livescript",regex:'"""',next:"pop"},{token:"constant.character.escape.livescript",regex:"\\\\."},{include:"#interpolated_livescript"},{defaultToken:"string.quoted.double.heredoc.livescript"}]},{token:"punctuation.definition.string.begin.livescript",regex:"``",push:[{token:"punctuation.definition.string.end.livescript",regex:"``",next:"pop"},{token:"constant.character.escape.livescript",regex:"\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)"},{defaultToken:"string.quoted.script.livescript"}]},{token:"string.array-literal.livescript",regex:"<\\[",push:[{token:"string.array-literal.livescript",regex:"\\]>",next:"pop"},{defaultToken:"string.array-literal.livescript"}]},{token:"string.regexp.livescript",regex:"/{2}(?![\\s=/*+{}?]).*?[^\\\\]/[igmy]{0,4}(?![a-zA-Z0-9])/{2}"},{token:"string.regexp.livescript",regex:"/{2}$",push:[{token:"string.regexp.livescript",regex:"/{2}[imgy]{0,4}",next:"pop"},{include:"#embedded_spaced_comment"},{include:"#interpolated_livescript"},{defaultToken:"string.regexp.livescript"}]},{token:"string.regexp.livescript",regex:"/{2}",push:[{token:"string.regexp.livescript",regex:"/{2}[imgy]{0,4}",next:"pop"},{token:"constant.character.escape.livescript",regex:"\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)"},{include:"#interpolated_livescript"},{defaultToken:"string.regexp.livescript"}]},{token:"string.regexp.livescript",regex:"/(?![\\s=/*+{}?]).*?[^\\\\]/[igmy]{0,4}(?![a-zA-Z0-9])"},{token:"keyword.control.livescript",regex:"\\b(?)|\\+\\+|\\+|~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<(?!\\[)|(?|(?)|&&|\\.\\.(?:\\.)?|\\s\\.\\s|\\?|\\||\\|\\||\\:|\\*=|(?)|\\+\\+|\\+|\n				~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|\n				>>>=|<>|<(?!\\[)|(?|(?)|&&|\\.\\.(\\.)?|\\s\\.\\s|\\?|\\||\\|\\||\\:|\\*=|(?)"},{token:"keyword.operator.livescript",regex:"(?<=\\s|^)[\\[\\{](?=.*?[\\]\\}]\\s+[:=])",TODO:"FIXME: regexp doesn't have js equivalent",originalRegex:"(?<=\\s|^)([\\[\\{])(?=.*?[\\]\\}]\\s+[:=])",push:[{token:"keyword.operator.livescript",regex:"[\\]\\}]\\s*[:=]",next:"pop"},{include:"#variable_name"},{include:"#instance_variable"},{include:"#single_quoted_string"},{include:"#double_quoted_string"},{include:"#numeric"},{defaultToken:"meta.variable.assignment.destructured.livescript"}]},{token:["meta.function.livescript","entity.name.function.livescript","entity.name.function.livescript","entity.name.function.livescript","entity.name.function.livescript","variable.parameter.function.livescript","entity.name.function.livescript","storage.type.function.livescript"],regex:"(\\s*)(?=[a-zA-Z\\$_])([a-zA-Z\\$_])((?:[\\w$.:-])*)(\\s*)([:=])((?:\\s*!?\\s*\\(.*\\))?)(\\s*)(!?[~-]{1,2}>)"},{token:"storage.type.function.livescript",regex:"!?[~-]{1,2}>"},{token:"constant.language.boolean.true.livescript",regex:"\\b(?|=>)\\s*$|.*[\\[{]\\s*$",foldingStopMarker:"^\\s*$|^\\s*[}\\]]\\s*$",keyEquivalent:"^~C",name:"LiveScript",scopeName:"source.livescript"},r.inherits(s,i),t.LiveScriptHighlightRules=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),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,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/live_script",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/live_script_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./live_script_highlight_rules").LiveScriptHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o};r.inherits(u,i),function(){this.$id="ace/mode/live_script"}.call(u.prototype),t.Mode=u})




© 2015 - 2024 Weber Informatics LLC | Privacy Policy