// @ts-nocheck
/**
 * @import {Refractor} from '../lib/core.js'
 */
bnf.displayName = 'bnf';
bnf.aliases = ['rbnf'];

/** @param {Refractor} Prism */
function bnf(Prism) {
  Prism.languages.bnf = {
    string: {
      pattern: /"[^\r\n"]*"|'[^\r\n']*'/
    },
    definition: {
      pattern: /<[^<>\r\n\t]+>(?=\s*::=)/,
      alias: ['rule', 'keyword'],
      inside: {
        punctuation: /^<|>$/
      }
    },
    rule: {
      pattern: /<[^<>\r\n\t]+>/,
      inside: {
        punctuation: /^<|>$/
      }
    },
    operator: /::=|[|()[\]{}*+?]|\.{3}/
  };
  Prism.languages.rbnf = Prism.languages.bnf;
}

export { bnf as default };
