generic.js 1.1 KB

12345678910111213141516171819202122232425
  1. /*
  2. * CodePress regular expressions for generic syntax highlighting
  3. */
  4. // generic languages
  5. Language.syntax = [
  6. { input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
  7. { input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
  8. { input : /\b(abstract|continue|for|new|switch|default|goto|boolean|do|if|private|this|break|double|protected|throw|byte|else|import|public|throws|case|return|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|const|float|while|function|label)\b/g, output : '<b>$1</b>' }, // reserved words
  9. { input : /([\(\){}])/g, output : '<em>$1</em>' }, // special chars;
  10. { input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // comments //
  11. { input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' } // comments /* */
  12. ]
  13. Language.snippets = []
  14. Language.complete = [
  15. { input : '\'', output : '\'$0\'' },
  16. { input : '"', output : '"$0"' },
  17. { input : '(', output : '\($0\)' },
  18. { input : '[', output : '\[$0\]' },
  19. { input : '{', output : '{\n\t$0\n}' }
  20. ]
  21. Language.shortcuts = []