UNPKG

@liascript/editor

Version:

An extended Markdown interpreter for the creation of interactive online courses.

2 lines (1 loc) 2.13 kB
ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var o=e("../lib/oop"),r=e("./text_highlight_rules").TextHighlightRules,i=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};o.inherits(i,r),t.JsonHighlightRules=i})),ace.define("ace/ext/simple_tokenizer",["require","exports","module","ace/ext/simple_tokenizer","ace/mode/json_highlight_rules","ace/tokenizer","ace/layer/text_util"],(function(e,t,n){"use strict";var o=e("../tokenizer").Tokenizer,r=e("../layer/text_util").isTextToken,i=function(){function e(e,t){this._lines=e.split(/\r\n|\r|\n/),this._states=[],this._tokenizer=t}return e.prototype.getTokens=function(e){var t=this._lines[e],n=this._states[e-1],o=this._tokenizer.getLineTokens(t,n);return this._states[e]=o.state,o.tokens},e.prototype.getLength=function(){return this._lines.length},e}();t.tokenize=function(e,t){for(var n=new i(e,new o(t.getRules())),s=[],a=0;a<n.getLength();a++){var u=n.getTokens(a);s.push(u.map((function(e){return{className:r(e.type)?void 0:"ace_"+e.type.replace(/\./g," ace_"),value:e.value}})))}return s}})),ace.require(["ace/ext/simple_tokenizer"],(function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}));