prism-sas.js 915 B

1234567891011121314151617181920212223242526272829303132333435
  1. Prism.languages.sas = {
  2. 'datalines': {
  3. pattern: /(^|[\r\n])\s*(?:(?:data)?lines|cards);[\s\S]+?[\r\n];/i,
  4. lookbehind: true,
  5. inside: {
  6. 'keyword': {
  7. pattern: /^(\s*)(?:(?:data)?lines|cards)/i,
  8. lookbehind: true
  9. },
  10. 'punctuation': /;/,
  11. 'data': {
  12. pattern: /[\s\S]+/,
  13. alias: 'string'
  14. }
  15. }
  16. },
  17. 'comment': [
  18. {
  19. pattern: /(^\s*|;\s*)\*.*;/m,
  20. lookbehind: true
  21. },
  22. /\/\*[\s\S]+?\*\//
  23. ],
  24. 'datetime': {
  25. // '1jan2013'd, '9:25:19pm't, '18jan2003:9:27:05am'dt
  26. pattern: /'[^']+'(?:d|d?t)\b/i,
  27. alias: 'number'
  28. },
  29. 'string': /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
  30. 'keyword': /\b(?:data|else|format|if|input|proc|run|then)\b/i,
  31. // Decimal (1.2e23), hexadecimal (0c1x)
  32. 'number': /(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,
  33. 'operator': /\*\*|\|\||!!|¦¦|<>|><|[~¬^<>]?=|[*\/+\-<>&\|!¦~¬^]|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,
  34. 'punctuation': /[$%@.(){}\[\];,\\]/
  35. };