aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-r.js
blob: b794fa93d8203198e3a431669f45c80416f78dfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Prism.languages.r = {
  comment: /#.*/,
  string: {
    pattern: /(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,
    greedy: true,
  },
  'percent-operator': {
    // Includes user-defined operators
    // and %%, %*%, %/%, %in%, %o%, %x%
    pattern: /%[^%\s]*%/,
    alias: 'operator',
  },
  boolean: /\b(?:FALSE|TRUE)\b/,
  ellipsis: /\.\.(?:\.|\d+)/,
  number: [
    /\b(?:Inf|NaN)\b/,
    /(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/,
  ],
  keyword:
    /\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,
  operator: /->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,
  punctuation: /[(){}\[\],;]/,
};
span class="nx">lookbehind: true, inside: { content: { pattern: /^(\\\()[\s\S]+(?=\)$)/, lookbehind: true, inside: null, // see below }, punctuation: /^\\\(|\)$/, }, }, }; var jq = (Prism.languages.jq = { comment: /#.*/, property: { pattern: RegExp(string.source + /(?=\s*:(?!:))/.source), lookbehind: true, greedy: true, inside: stringInterpolation, }, string: { pattern: string, lookbehind: true, greedy: true, inside: stringInterpolation, }, function: { pattern: /(\bdef\s+)[a-z_]\w+/i, lookbehind: true, }, variable: /\B\$\w+/, 'property-literal': { pattern: /\b[a-z_]\w*(?=\s*:(?!:))/i, alias: 'property', }, keyword: /\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/, boolean: /\b(?:false|true)\b/, number: /(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/, operator: [ { pattern: /\|=?/, alias: 'pipe', }, /\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|not|or)\b/, ], 'c-style-function': { pattern: /\b[a-z_]\w*(?=\s*\()/i, alias: 'function', }, punctuation: /::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/, dot: { pattern: /\./, alias: 'important', }, }); stringInterpolation.interpolation.inside.content.inside = jq; })(Prism);