prism-rip.js 908 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Prism.languages.rip = {
  2. 'comment': {
  3. pattern: /#.*/,
  4. greedy: true
  5. },
  6. 'char': {
  7. pattern: /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,
  8. greedy: true
  9. },
  10. 'string': {
  11. pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
  12. greedy: true
  13. },
  14. 'regex': {
  15. pattern: /(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,
  16. lookbehind: true,
  17. greedy: true
  18. },
  19. 'keyword': /(?:=>|->)|\b(?:case|catch|class|else|exit|finally|if|raise|return|switch|try)\b/,
  20. 'builtin': /@|\bSystem\b/,
  21. 'boolean': /\b(?:false|true)\b/,
  22. 'date': /\b\d{4}-\d{2}-\d{2}\b/,
  23. 'time': /\b\d{2}:\d{2}:\d{2}\b/,
  24. 'datetime': /\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,
  25. 'symbol': /:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,
  26. 'number': /[+-]?\b(?:\d+\.\d+|\d+)\b/,
  27. 'punctuation': /(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,
  28. 'reference': /[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/
  29. };