@liascript/editor
Version:
An extended Markdown interpreter for the creation of interactive online courses.
2 lines (1 loc) • 4.53 kB
JavaScript
ace.define("ace/mode/basic_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,o){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,n=function(){var e=this.createKeywordMapper({"keyword.control":"FOR|TO|NEXT|GOSUB|RETURN|IF|THEN|ELSE|GOTO|ON|WHILE|WEND|TRON|TROFF","entity.name":"Auto|Call|Chain|Clear|Close|Common|Cont|Data|MERGE|ALL|Delete|DIM|EDIT|END|ERASE|ERROR|FIELD|GET|INPUT|KILL|LET|LIST|LLIST|LOAD|LSET|RSET|MERGE|NEW|NULL|OPEN|OUT|POKE|PRINT|PUT|RANDOMIZE|READ|RENUM|RESTORE|RESUME|RUN|SAVE|STOP|SWAP|WAIT|WIDTH","keyword.operator":"Mod|And|Not|Or|Xor|Eqv|Imp","support.function":"ABS|ASC|ATN|CDBL|CINT|COS|CSNG|CVI|CVS|CVD|EOF|EXP|FIX|FRE|INP|INSTR|INT|LEN|LOC|LOG|LPOS|PEEK|POS|RND|SGN|SIN|SPC|SQR|TAB|TAN|USR|VAL|VARPTR"},"identifier",!0);this.$rules={start:[{token:"string",regex:/"(?:\\.|[^"\\])*"/},{token:"support.function",regex:/(HEX|CHR|INPUT|LEFT|MID|MKI|MKS|MKD|OCT|RIGHT|SPACE|STR|STRING)\$/},{token:"entity.name",regex:/(?:DEF\s(?:SEG|USR|FN[a-zA-Z]+)|LINE\sINPUT|L?PRINT#?(?:\sUSING)?|MID\$|ON\sERROR\sGOTO|OPTION\sBASE|WRITE#?|DATE\$|INKEY\$|TIME\$)/},{token:"variable",regex:/[a-zA-Z][a-zA-Z0-9_]{0,38}[$%!#]?(?=\s*=)/},{token:"keyword.operator",regex:/\\|=|\^|\*|\/|\+|\-|<|>|-/},{token:"paren.lparen",regex:/[([]/},{token:"paren.rparen",regex:/[\)\]]/},{token:"constant.numeric",regex:/[+-]?\d+(\.\d+)?([ED][+-]?\d+)?(?:[!#])?/},{token:"constant.numeric",regex:/&[HO]?[0-9A-F]+/},{token:"comment",regex:/REM\s+.*$/},{regex:"\\w+",token:e},{token:"punctiation",regex:/[,;]/}]},this.normalizeRules()};r.inherits(n,i),t.BasicHighlightRules=n})),ace.define("ace/mode/folding/basic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"],(function(e,t,o){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,n=e("../../range").Range,a=e("../../token_iterator").TokenIterator,s=t.FoldMode=function(){};r.inherits(s,i),function(){this.indentKeywords={tron:1,while:1,for:1,troff:-1,wend:-1,next:-1},this.foldingStartMarker=/(?:\s|^)(tron|while|for)\b/i,this.foldingStopMarker=/(?:\b)(troff|next|wend)\b/i,this.getFoldWidgetRange=function(e,t,o){var r=e.getLine(o),i=this.foldingStartMarker.test(r),n=this.foldingStopMarker.test(r);if(i||n){var a=n?this.foldingStopMarker.exec(r):this.foldingStartMarker.exec(r);if(a&&a[1].toLowerCase())if("keyword.control"===e.getTokenAt(o,a.index+2).type)return this.basicBlock(e,o,a.index+2)}},this.getFoldWidget=function(e,t,o){var r=e.getLine(o),i=this.foldingStartMarker.test(r),n=this.foldingStopMarker.test(r);if(i&&!n&&((s=(a=this.foldingStartMarker.exec(r))&&a[1].toLowerCase())&&"keyword.control"==e.getTokenAt(o,a.index+2).type))return"start";if("markbeginend"!=t||!n||i&&n)return"";var a,s=(a=r.match(this.foldingStopMarker))&&a[1].toLowerCase();return this.indentKeywords[s]&&"keyword.control"===e.getTokenAt(o,a.index+2).type?"end":""},this.basicBlock=function(e,t,o,r){var i=new a(e,t,o),s=i.getCurrentToken();if(s&&"keyword.control"==s.type){var l=s.value.toLowerCase(),d=[l],c=this.indentKeywords[l];if(c){var g=-1===c?i.getCurrentTokenColumn():e.getLine(t).length,u=t;for(i.step=-1===c?i.stepBackward:i.stepForward;s=i.step();)if(l=s.value.toLowerCase(),"keyword.control"===s.type&&this.indentKeywords[l]){var h=c*this.indentKeywords[l];if(h>0?d.unshift(l):h<=0&&d.shift(),0===d.length)break}if(!s)return null;if(r)return i.getCurrentTokenRange();t=i.getCurrentTokenRow();return-1===c?new n(t,e.getLine(t).length,u,g):new n(u,g,t,i.getCurrentTokenColumn())}}}}.call(s.prototype)})),ace.define("ace/mode/basic",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/basic_highlight_rules","ace/mode/folding/basic"],(function(e,t,o){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,n=e("./basic_highlight_rules").BasicHighlightRules,a=e("./folding/basic").FoldMode,s=function(){this.HighlightRules=n,this.foldingRules=new a,this.$behaviour=this.$defaultBehaviour,this.indentKeywords=this.foldingRules.indentKeywords};r.inherits(s,i),function(){this.lineCommentStart=["REM"],this.getMatching=function(e,t,o,r){if(null==t){var i=e.selection.lead;o=i.column,t=i.row}null==r&&(r=!0);var n=e.getTokenAt(t,o);if(n&&n.value.toLowerCase()in this.indentKeywords)return this.foldingRules.basicBlock(e,t,o,r)},this.$id="ace/mode/basic"}.call(s.prototype),t.Mode=s})),ace.require(["ace/mode/basic"],(function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}));