Commits

Russell Power committed 2b33502

Add latex-mode.

  • Participants
  • Parent commits 675b590

Comments (0)

Files changed (2)

js/ace/__init__.py

 mode_html        = Resource(library, 'mode-html.js')
 mode_java        = Resource(library, 'mode-java.js')
 mode_javascript  = Resource(library, 'mode-javascript.js')
+mode_latex       = Resource(library, 'mode-latex.js')
 mode_php         = Resource(library, 'mode-php.js')
 mode_python      = Resource(library, 'mode-python.js')
 mode_ruby        = Resource(library, 'mode-ruby.js')

js/ace/resources/mode-latex.js

+define("ace/mode/latex",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/latex_highlight_rules","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/latex_highlight_rules").LatexHighlightRules,h=a("ace/range").Range,i=function(){this.$tokenizer=new f((new g).getRules())};d.inherits(i,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\%/;for(var i=c;i<=d;i++)if(!g.test(b.getLine(i))){e=!1;break}if(e){var j=new h(0,0,0,0);for(var i=c;i<=d;i++){var k=b.getLine(i),l=k.match(g);j.start.row=i,j.end.row=i,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"%")},this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)}}.call(i.prototype),b.Mode=i}),define("ace/mode/latex_highlight_rules",["require","exports","module","pilot/oop","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"keyword",regex:"\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"string",regex:"\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"},{token:"comment",regex:"%.*$"}]}};d.inherits(f,e),b.LatexHighlightRules=f})