summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-neon.js
blob: e3e20f171e7afe59578f702e8232cd9a99f5621e (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
39
40
41
42
43
44
Prism.languages.neon = {
  comment: {
    pattern: /#.*/,
    greedy: true,
  },
  datetime: {
    pattern:
      /(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,
    lookbehind: true,
    alias: 'number',
  },
  key: {
    pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,
    lookbehind: true,
    alias: 'atrule',
  },
  number: {
    pattern:
      /(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,
    lookbehind: true,
  },
  boolean: {
    pattern: /(^|[[{(=:,\s])(?:false|no|true|yes)(?=$|[\]}),:=\s])/i,
    lookbehind: true,
  },
  null: {
    pattern: /(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,
    lookbehind: true,
    alias: 'keyword',
  },
  string: {
    pattern:
      /(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,
    lookbehind: true,
    greedy: true,
  },
  literal: {
    pattern:
      /(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,
    lookbehind: true,
    alias: 'string',
  },
  punctuation: /[,:=[\]{}()-]/,
};
.replace(/<KEYWORD>/g, function () { return keywords.source; }), 'i' ), lookbehind: true, greedy: true, inside: null, // see below }, { pattern: /((?:^|[^\w'])(?:datatype|exception|functor|signature|structure|type)\s+)[a-z_][\w'.]*/i, lookbehind: true, }, ], function: { pattern: /((?:^|[^\w'])fun\s+)[a-z_][\w'.]*/i, lookbehind: true, }, keyword: keywords, variable: { pattern: /(^|[^\w'])'[\w']*/, lookbehind: true, }, number: /~?\b(?:\d+(?:\.\d+)?(?:e~?\d+)?|0x[\da-f]+)\b/i, word: { pattern: /\b0w(?:\d+|x[\da-f]+)\b/i, alias: 'constant', }, boolean: /\b(?:false|true)\b/i, operator: /\.\.\.|:[>=:]|=>?|->|[<>]=?|[!+\-*/^#|@~]/, punctuation: /[(){}\[\].:,;]/, }; Prism.languages.sml['class-name'][0].inside = Prism.languages.sml; Prism.languages.smlnj = Prism.languages.sml; })(Prism);