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