on-codemerge
Version:
A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product
101 lines (100 loc) • 1.88 kB
JavaScript
import { TokenType as e } from "../../../types.mjs";
const o = {
name: "cpp",
patterns: {
[e.Comment]: /^\/\/.*$|^\/\*[\s\S]*?\*\//,
[e.String]: /^"(?:\\.|[^"\\])*"|^'(?:\\.|[^'\\])*'/,
[e.Number]: /^\b(?:0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/,
[e.Function]: /^\b[a-zA-Z_]\w*(?=\s*\()/,
[e.Type]: /^\b(?:void|int|float|double|bool|char|unsigned|signed|short|long|auto|const|volatile|static|extern|struct|class|enum|union|template|typename|virtual|explicit|override|final)\b/,
[e.Operator]: /^(?:->|::|\+\+|--|&&|\|\||[+\-*/%&|^<>!=]=?)/,
[e.Punctuation]: /^[{}[\]();,.]/
},
keywords: [
"alignas",
"alignof",
"and",
"and_eq",
"asm",
"atomic_cancel",
"atomic_commit",
"atomic_noexcept",
"bitand",
"bitor",
"break",
"case",
"catch",
"class",
"compl",
"concept",
"const",
"constexpr",
"const_cast",
"continue",
"co_await",
"co_return",
"co_yield",
"decltype",
"default",
"delete",
"do",
"dynamic_cast",
"else",
"enum",
"explicit",
"export",
"extern",
"false",
"for",
"friend",
"goto",
"if",
"import",
"inline",
"module",
"mutable",
"namespace",
"new",
"noexcept",
"not",
"not_eq",
"nullptr",
"operator",
"or",
"or_eq",
"private",
"protected",
"public",
"reflexpr",
"register",
"reinterpret_cast",
"requires",
"return",
"sizeof",
"static",
"static_assert",
"static_cast",
"struct",
"switch",
"synchronized",
"template",
"this",
"thread_local",
"throw",
"true",
"try",
"typedef",
"typeid",
"typename",
"union",
"using",
"virtual",
"volatile",
"while",
"xor",
"xor_eq"
]
};
export {
o as cppDefinition
};