1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-08 08:26:20 +00:00
Jan Korf d533557324
Websocket refactoring (#190)
Websocket refactoring
2024-02-24 19:21:47 +01:00

47 lines
1.0 KiB
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.

/*
Language: Extended Backus-Naur Form
Author: Alex McKibben <alex@nullscope.net>
Website: https://en.wikipedia.org/wiki/Extended_BackusNaur_form
*/
export default function(hljs) {
var commentMode = hljs.COMMENT(/\(\*/, /\*\)/);
var nonTerminalMode = {
className: "attribute",
begin: /^[ ]*[a-zA-Z][a-zA-Z-_]*([\s-_]+[a-zA-Z][a-zA-Z]*)*/
};
var specialSequenceMode = {
className: "meta",
begin: /\?.*\?/
};
var ruleBodyMode = {
begin: /=/, end: /[.;]/,
contains: [
commentMode,
specialSequenceMode,
{
// terminals
className: 'string',
variants: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{begin: '`', end: '`'},
]
},
]
};
return {
name: 'Extended Backus-Naur Form',
illegal: /\S/,
contains: [
commentMode,
nonTerminalMode,
ruleBodyMode
]
};
}