prism-smalltalk.js 801 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Prism.languages.smalltalk = {
  2. 'comment': {
  3. pattern: /"(?:""|[^"])*"/,
  4. greedy: true
  5. },
  6. 'char': {
  7. pattern: /\$./,
  8. greedy: true
  9. },
  10. 'string': {
  11. pattern: /'(?:''|[^'])*'/,
  12. greedy: true
  13. },
  14. 'symbol': /#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,
  15. 'block-arguments': {
  16. pattern: /(\[\s*):[^\[|]*\|/,
  17. lookbehind: true,
  18. inside: {
  19. 'variable': /:[\da-z]+/i,
  20. 'punctuation': /\|/
  21. }
  22. },
  23. 'temporary-variables': {
  24. pattern: /\|[^|]+\|/,
  25. inside: {
  26. 'variable': /[\da-z]+/i,
  27. 'punctuation': /\|/
  28. }
  29. },
  30. 'keyword': /\b(?:new|nil|self|super)\b/,
  31. 'boolean': /\b(?:false|true)\b/,
  32. 'number': [
  33. /\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/,
  34. /\b\d+(?:\.\d+)?(?:e-?\d+)?/
  35. ],
  36. 'operator': /[<=]=?|:=|~[~=]|\/\/?|\\\\|>[>=]?|[!^+\-*&|,@]/,
  37. 'punctuation': /[.;:?\[\](){}]/
  38. };