shBrushMatlabKey.js 855 B

1234567891011121314151617181920
  1. /**
  2. * Author: Will Schleter
  3. * based on: http://www.jamesrohal.com
  4. */
  5. SyntaxHighlighter.brushes.MatlabKey = function()
  6. {
  7. var keywords = 'break case catch classdef continue else elseif end for function global if otherwise parfor persistent return spmd switch try while';
  8. var functions = ' ';
  9. this.regexList = [
  10. { regex: /%.*$/gm, css: 'comments' }, // one line comments
  11. { regex: /\%\{[\s\S]*?\%\}/gm, css: 'comments'}, // multiline comments
  12. { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
  13. { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string'},
  14. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
  15. ];
  16. }
  17. SyntaxHighlighter.brushes.MatlabKey.prototype = new SyntaxHighlighter.Highlighter();
  18. SyntaxHighlighter.brushes.MatlabKey.aliases = ['matlabkey', 'matlab'];