aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-reason.js
blob: 0832388e826e5bac298d7a7cc9644c5fee0c06fe (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
Prism.languages.reason = Prism.languages.extend('clike', {
  string: {
    pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
    greedy: true,
  },
  // 'class-name' must be matched *after* 'constructor' defined below
  'class-name': /\b[A-Z]\w*/,
  keyword:
    /\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,
  operator:
    /\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/,
});
Prism.languages.insertBefore('reason', 'class-name', {
  char: {
    pattern: /'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,
    greedy: true,
  },
  // Negative look-ahead prevents from matching things like String.capitalize
  constructor: /\b[A-Z]\w*\b(?!\s*\.)/,
  label: {
    pattern: /\b[a-z]\w*(?=::)/,
    alias: 'symbol',
  },
});

// We can't match functions property, so let's not even try.
delete Prism.languages.reason.function;
an>flex; flex-flow: column nowrap; justify-content: flex-start; } .cover { align-self: flex-start; place-content: center; height: fun.convert-px(150); margin: auto; border-bottom: fun.convert-px(1) solid var(--color-border); } .title, .tagline, .footer { padding: 0 var(--spacing-md); } .title { flex: 1; margin-top: var(--spacing-sm); margin-bottom: var(--spacing-sm); } h2.title { background: none; text-shadow: none; } .tagline { flex: 1; margin-bottom: var(--spacing-md); color: var(--color-fg); font-weight: 400; } .list { margin-bottom: var(--spacing-md); } .meta { &__item { flex-flow: row wrap; place-content: center; gap: var(--spacing-2xs); margin: auto; } &__label { flex: 0 0 100%; } &__value { padding: fun.convert-px(2) var(--spacing-xs); border: fun.convert-px(1) solid var(--color-primary-darker); color: var(--color-fg); font-weight: 400; &::before { display: none; } } } &:not(:disabled):focus { text-decoration: none; .title { text-decoration: underline solid var(--color-primary) 0.3ex; } } }