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
88 lines (87 loc) • 1.54 kB
JavaScript
import { TokenType as e } from "../../../types.mjs";
const t = {
name: "kotlin",
patterns: {
[e.Comment]: /^\/\/.*$|^\/\*[\s\S]*?\*\//,
[e.String]: /^"(?:[^"\\]|\\.)*"|^'''[\s\S]*?'''/,
[e.Number]: /^\b(?:0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?[fFL]?)\b/,
[e.Function]: /^\b[a-zA-Z_]\w*(?=\s*\()/,
[e.Type]: /^\b(?:Byte|Short|Int|Long|Float|Double|Boolean|Char|String|Any|Unit|Nothing)\b/,
[e.Decorator]: /^@\w+/,
[e.Operator]: /^(?:->|::|\?\.|!!|\+\+|--|&&|\|\||[+\-*/%&|^<>!=]=?)/,
[e.Punctuation]: /^[{}[\]();,.]/
},
keywords: [
"abstract",
"actual",
"annotation",
"as",
"break",
"by",
"catch",
"class",
"companion",
"const",
"constructor",
"continue",
"crossinline",
"data",
"delegate",
"do",
"dynamic",
"else",
"enum",
"expect",
"external",
"false",
"field",
"final",
"finally",
"for",
"fun",
"get",
"if",
"import",
"in",
"infix",
"init",
"inline",
"inner",
"interface",
"internal",
"is",
"lateinit",
"noinline",
"null",
"object",
"open",
"operator",
"out",
"override",
"package",
"private",
"protected",
"public",
"reified",
"return",
"sealed",
"set",
"super",
"suspend",
"tailrec",
"this",
"throw",
"true",
"try",
"typealias",
"val",
"var",
"vararg",
"when",
"where",
"while"
]
};
export {
t as kotlinDefinition
};