prism-smalltalk.js 730 B

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