prism-jolie.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Prism.languages.jolie = Prism.languages.extend('clike', {
  2. 'string': {
  3. pattern: /(^|[^\\])"(?:\\[\s\S]|[^"\\])*"/,
  4. lookbehind: true,
  5. greedy: true
  6. },
  7. 'class-name': {
  8. pattern: /((?:\b(?:as|courier|embed|in|inputPort|outputPort|service)\b|@)[ \t]*)\w+/,
  9. lookbehind: true
  10. },
  11. 'keyword': /\b(?:as|cH|comp|concurrent|constants|courier|cset|csets|default|define|else|embed|embedded|execution|exit|extender|for|foreach|forward|from|global|if|import|in|include|init|inputPort|install|instanceof|interface|is_defined|linkIn|linkOut|main|new|nullProcess|outputPort|over|private|provide|public|scope|sequential|service|single|spawn|synchronized|this|throw|throws|type|undef|until|while|with)\b/,
  12. 'function': /\b[a-z_]\w*(?=[ \t]*[@(])/i,
  13. 'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i,
  14. 'operator': /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[?\/%^@|]/,
  15. 'punctuation': /[()[\]{},;.:]/,
  16. 'builtin': /\b(?:Byte|any|bool|char|double|enum|float|int|length|long|ranges|regex|string|undefined|void)\b/
  17. });
  18. Prism.languages.insertBefore('jolie', 'keyword', {
  19. 'aggregates': {
  20. pattern: /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,
  21. lookbehind: true,
  22. inside: {
  23. 'keyword': /\bwith\b/,
  24. 'class-name': /\w+/,
  25. 'punctuation': /,/
  26. }
  27. },
  28. 'redirects': {
  29. pattern: /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,
  30. lookbehind: true,
  31. inside: {
  32. 'punctuation': /,/,
  33. 'class-name': /\w+/,
  34. 'operator': /=>/
  35. }
  36. },
  37. 'property': {
  38. pattern: /\b(?:Aggregates|[Ii]nterfaces|Java|Javascript|Jolie|[Ll]ocation|OneWay|[Pp]rotocol|Redirects|RequestResponse)\b(?=[ \t]*:)/
  39. }
  40. });