aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-bison.js
blob: 2d150f18c701d6cbe0fd582ebd0aeb28239a540a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-colo
Prism.languages.bison = Prism.languages.extend('c', {});

Prism.languages.insertBefore('bison', 'comment', {
  bison: {
    // This should match all the beginning of the file
    // including the prologue(s), the bison declarations and
    // the grammar rules.
    pattern: /^(?:[^%]|%(?!%))*%%[\s\S]*?%%/,
    inside: {
      c: {
        // Allow for one level of nested braces
        pattern: /%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,
        inside: {
          delimiter: {
            pattern: /^%?\{|%?\}$/,
            alias: 'punctuation',
          },
          'bison-variable': {
            pattern: /[$@](?:<[^\s>]+>)?[\w$]+/,
            alias: 'variable',
            inside: {
              punctuation: /&l
ss="nx">Prism.languages.c, }, }, comment: Prism.languages.c.comment, string: Prism.languages.c.string, property: /\S+(?=:)/, keyword: /%\w+/, number: { pattern: /(^|[^@])\b(?:0x[\da-f]+|\d+)/i, lookbehind: true, }, punctuation: /%[%?]|[|:;\[\]<>]/, }, }, });