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
69 lines (68 loc) • 1.23 kB
JavaScript
import { TokenType as t } from "../../../types.mjs";
const r = {
name: "swift",
patterns: {
[t.Comment]: /^\/\/.*$|^\/\*[\s\S]*?\*\//,
[t.String]: /^"(?:[^"\\]|\\.)*"/,
[t.Number]: /^\b(?:0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/,
[t.Function]: /^\b[a-zA-Z_]\w*(?=\s*\()/,
[t.Type]: /^\b(?:Int|Double|Float|String|Bool|Character|Any|AnyObject)\b/,
[t.Decorator]: /^@\w+/,
[t.Operator]: /^(?:->|===|!==|\?\?|\+\+|--|&&|\|\||[+\-*/%&|^<>!=]=?)/,
[t.Punctuation]: /^[{}[\]();,.]/
},
keywords: [
"as",
"break",
"case",
"catch",
"class",
"continue",
"default",
"defer",
"do",
"else",
"enum",
"extension",
"fallthrough",
"false",
"fileprivate",
"final",
"for",
"func",
"guard",
"if",
"import",
"in",
"init",
"inout",
"internal",
"is",
"let",
"nil",
"open",
"operator",
"private",
"protocol",
"public",
"repeat",
"rethrows",
"return",
"self",
"static",
"struct",
"super",
"switch",
"throw",
"throws",
"true",
"try",
"typealias",
"var",
"where",
"while"
]
};
export {
r as swiftDefinition
};