/wp-content/plugins/simple-forum/resources/jscript/syntax/jquery.syntax.brush.java.js

https://github.com/voidit/nycga2 · JavaScript · 41 lines · 20 code · 12 blank · 9 comment · 0 complexity · 5208ecb65382d961ebe049fdfaa09d4f MD5 · raw file

  1. // brush: "java" aliases: []
  2. /*
  3. This file is part of the "jQuery.Syntax" project, and is licensed under the GNU AGPLv3.
  4. See <jquery.syntax.js> for licensing details.
  5. Copyright 2010 Samuel Williams. All rights reserved.
  6. */
  7. Syntax.register('java', function(brush) {
  8. var keywords = ["abstract", "continue", "for", "switch", "assert", "default", "goto", "synchronized", "do", "if", "break", "implements", "throw", "else", "import", "throws", "case", "enum", "return", "transient", "catch", "extends", "try", "final", "interface", "static", "class", "finally", "strictfp", "volatile", "const", "native", "super", "while"];
  9. var access = ["private", "protected", "public", "package"];
  10. var types = ["void", "byte", "short", "int", "long", "float", "double", "boolean", "char"];
  11. var operators = ["++", "--", "++", "--", "+", "-", "~", "!", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "<", ">", "<=", ">=", "==", "!=", "&", "^", "|", "&&", "||", "?", ":", "=", "+=", "-=", "*=", "/=", "%=", "&=", "^=", "|=", "<<=", ">>=", ">>>=", "instanceof", "new", "delete"];
  12. var constants = ["this", "true", "false", /[0-9]+(\.[0-9]+)?/g];
  13. brush.push(constants, {klass: 'constant'});
  14. brush.push(types, {klass: 'type'});
  15. brush.push(keywords, {klass: 'keyword'});
  16. brush.push(operators, {klass: 'operator'});
  17. brush.push(access, {klass: 'access'});
  18. brush.push({pattern: /\b_*[A-Z][\w:]+/g, klass: 'type'});
  19. brush.push(Syntax.lib.cStyleComment);
  20. brush.push(Syntax.lib.cppStyleComment);
  21. brush.push(Syntax.lib.webLink);
  22. // Strings
  23. brush.push(Syntax.lib.singleQuotedString);
  24. brush.push(Syntax.lib.doubleQuotedString);
  25. brush.push(Syntax.lib.stringEscape);
  26. brush.push(Syntax.lib.cStyleFunction);
  27. });