prism-rip.js 789 B

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