flow-web/static/highlight/languages/bnf.js
Andreas Widen a4a5c7daa5
Initial commit.
Signed-off-by: Andreas Widen <aw@luflow.net>
2026-07-27 17:57:03 +02:00

49 lines
No EOL
980 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! `bnf` grammar compiled for Highlight.js 11.11.1 */
(function(){
var hljsGrammar = (function () {
'use strict';
/*
Language: BackusNaur Form
Website: https://en.wikipedia.org/wiki/BackusNaur_form
Category: syntax
Author: Oleg Efimov <efimovov@gmail.com>
*/
/** @type LanguageFn */
function bnf(hljs) {
return {
name: 'BackusNaur Form',
contains: [
// Attribute
{
className: 'attribute',
begin: /</,
end: />/
},
// Specific
{
begin: /::=/,
end: /$/,
contains: [
{
begin: /</,
end: />/
},
// Common
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
}
]
};
}
return bnf;
})();
hljs.registerLanguage('bnf', hljsGrammar);
})();