(function (Prism) { // We don't allow for pipes inside parentheses // to not break table pattern |(. foo |). bar | var modifierRegex = /\([^|()\n]+\)|\[[^\]\n]+\]|\{[^}\n]+\}/.source; // Opening and closing parentheses which are not a modifier // This pattern is necessary to prevent exponential backtracking var parenthesesRegex = /\)|\((?![^|()\n]+\))/.source; /** * @param {string} source * @param {string} [flags] */ function withModifier(source, flags) { return RegExp( source .replace(//g, function () { return '(?:' + modifierRegex + ')'; }) .replace(//g, function () { return '(?:' + parenthesesRegex + ')'; }), flags || '' ); } var modifierTokens = { css: { pattern: /\{[^{}]+\}/, inside: { rest: Prism.languages.css, }, }, 'class-id': { pattern: /(\()[^()]+(?=\))/, lookbehind: true, alias: 'attr-value', }, lang: { pattern: /(\[)[^\[\]]+(?=\])/, lookbehind: true, alias: 'attr-value', }, // Anything else is punctuation (the first pattern is for row/col spans inside tables) punctuation: /[\\\/]\d+|\S/, }; var textile = (Prism.languages.textile = Prism.languages.extend('markup', { phrase: { pattern: /(^|\r|\n)\S[\s\S]*?(?=$|\r?\n\r?\n|\r\r)/, lookbehind: true, inside: { // h1. Header 1 'block-tag': { pattern: withModifier(/^[a-z]\w*(?:||[<>=])*\./.source), inside: { modifier: { pattern: withModifier( /(^[a-z]\w*)(?:||[<>=])+(?=\.)/.source ), lookbehind: true, inside: modifierTokens, }, tag: /^[a-z]\w*/, punctuation: /\.$/, }, }, // # List item // * List item list: { pattern: withModifier(/^[*#]+*\s+\S.*/.source, 'm'), inside: { modifier: { pattern: withModifier(/(^[*#]+)+/.source), lookbehind: true, inside: modifierTokens, }, punctuation: /^[*#]+/, }, }, // | cell | cell | cell | table: { // Modifiers can be applied to the row: {color:red}.|1|2|3| // or the cell: |{color:red}.1|2|3| pattern: withModifier( /^(?:(?:||[<>=^~])+\.\s*)?(?:\|(?:(?:||[<>=^~_]|[\\/]\d+)+\.|(?!(?:||[<>=^~_]|[\\/]\d+)+\.))[^|]*)+\|/ .source, 'm' ), inside: { modifier: { // Modifiers for rows after the first one are // preceded by a pipe and a line feed pattern: withModifier( /(^|\|(?:\r?\n|\r)?)(?:||[<>=^~_]|[\\/]\d+)+(?=\.)/ .source ), lookbehind: true, inside: modifierTokens, }, punctuation: /\||^\./, }, }, inline: { // eslint-disable-next-line regexp/no-super-linear-backtracking pattern: withModifier( /(^|[^a-zA-Z\d])(\*\*|__|\?\?|[*_%@+\-^~])*.+?\2(?![a-zA-Z\d])/ .source ), lookbehind: true, inside: { // Note: superscripts and subscripts are not handled specifically // *bold*, **bold** bold: { // eslint-disable-next-line regexp/no-super-linear-backtracking pattern: withModifier(/(^(\*\*?)*).+?(?=\2)/.source), lookbehind: true, }, // _italic_, __italic__ italic: { // eslint-disable-next-line regexp/no-super-linear-backtracking pattern: withModifier(/(^(__?)*).+?(?=\2)/.source), lookbehind: true, }, // ??cite?? cite: { // eslint-disable-next-line regexp/no-super-linear-backtracking pattern: withModifier(/(^\?\?*).+?(?=\?\?)/.source), lookbehind: true, alias: 'string', }, // @code@ code: { // eslint-disable-next-line regexp/no-super-linear-backtracking pattern: withModifier(/(^@*).+?(?=@)/.source), lookbehind: true, alias: 'keyword', }, // +inserted+ inserted: { // eslint-disable-next-line regexp/no-super-linear-backtracking pattern: withModifier(/(^\+*).+?(?=\+)/.source), lookbehind: true, }, // -deleted- deleted: { // eslint-disable-next-line regexp/no-super-linear-backtracking pattern: withModifie
!(function (e) {
  for (
    var t = '\\(\\*(?:[^(*]|\\((?!\\*)|\\*(?!\\))|<self>)*\\*\\)', i = 0;
    i < 2;
    i++
  )
    t = t.replace(/<self>/g, function () {
      return t;
    });
  (t = t.replace(/<self>/g, '[]')),
    (e.languages.coq = {
      comment: RegExp(t),
      string: { pattern: /"(?:[^"]|"")*"(?!")/, greedy: !0 },
      attribute: [
        {
          pattern: RegExp(
            '#\\[(?:[^\\[\\]("]|"(?:[^"]|"")*"(?!")|\\((?!\\*)|<comment>)*\\]'.replace(
              /<comment>/g,
              function () {
                return t;
              }
            )
          ),
          greedy: !0,
          alias: 'attr-name',
          inside: {
            comment: RegExp(t),
            string: { pattern: /"(?:[^"]|"")*"(?!")/, greedy: !0 },
            operator: /=/,
            punctuation: /^#\[|\]$|[,()]/,
          },
        },
        {
          pattern:
            /\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,
          alias: 'attr-name',
        },
      ],
      keyword:
        /\b(?:Abort|About|Add|Admit|Admitted|All|Arguments|As|Assumptions|Axiom|Axioms|Back|BackTo|Backtrace|BinOp|BinOpSpec|BinRel|Bind|Blacklist|Canonical|Case|Cd|Check|Class|Classes|Close|CoFixpoint|CoInductive|Coercion|Coercions|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|Fixpoint|Flags|Focus|From|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|IF|Identity|Immediate|Implicit|Implicits|Import|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|ML|Match|Method|Minimality|Module|Modules|Morphism|Next|NoInline|Notation|Number|OCaml|Obligation|Obligations|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|PropOp|PropUOp|Property|Proposition|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|Require|Reserved|Reset|Resolve|Restart|Rewrite|Right|Ring|Rings|SProp|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|Step|Strategies|Strategy|String|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|UnOp|UnOpSpec|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|Unshelve|Variable|Variables|Variant|Verbose|View|Visibility|Zify|_|apply|as|at|by|cofix|else|end|exists|exists2|fix|for|forall|fun|if|in|let|match|measure|move|removed|return|struct|then|using|wf|where|with)\b/,
      number:
        /\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,
      punct: { pattern: /@\{|\{\||\[=|:>/, alias: 'punctuation' },
      operator:
        /\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,
      punctuation: /\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/,
    });
})(Prism);