prism-jolie.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. Prism.languages.jolie = Prism.languages.extend('clike', {
  2. 'keyword': /\b(?:include|define|is_defined|undef|main|init|outputPort|inputPort|Location|Protocol|Interfaces|RequestResponse|OneWay|type|interface|extender|throws|cset|csets|forward|Aggregates|Redirects|embedded|courier|execution|sequential|concurrent|single|scope|install|throw|comp|cH|default|global|linkIn|linkOut|synchronized|this|new|for|if|else|while|in|Jolie|Java|Javascript|nullProcess|spawn|constants|with|provide|until|exit|foreach|instanceof|over|service)\b/,
  3. 'builtin': /\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/,
  4. 'number': /(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?l?/i,
  5. 'operator': /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[:?\/%^]/,
  6. 'symbol': /[|;@]/,
  7. 'punctuation': /[,.]/,
  8. 'string': {
  9. pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
  10. greedy: true
  11. }
  12. });
  13. delete Prism.languages.jolie['class-name'];
  14. Prism.languages.insertBefore( 'jolie', 'keyword', {
  15. 'function':
  16. {
  17. pattern: /((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/,
  18. lookbehind: true
  19. },
  20. 'aggregates': {
  21. pattern: /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,
  22. lookbehind: true,
  23. inside: {
  24. 'with-extension': {
  25. pattern: /\bwith\s+\w+/,
  26. inside: {
  27. 'keyword' : /\bwith\b/
  28. }
  29. },
  30. 'function': {
  31. pattern: /\w+/
  32. },
  33. 'punctuation': {
  34. pattern: /,/
  35. }
  36. }
  37. },
  38. 'redirects': {
  39. pattern: /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,
  40. lookbehind: true,
  41. inside: {
  42. 'punctuation': {
  43. pattern: /,/
  44. },
  45. 'function': {
  46. pattern: /\w+/
  47. },
  48. 'symbol': {
  49. pattern: /=>/
  50. }
  51. }
  52. }
  53. });