UNPKG

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

61 lines (60 loc) 1.44 kB
/*! on-codemerge v1.3.1 @author Pavel Kuzmin @license MIT @homepage https://s00d.github.io/on-codemerge/ @repository git+https://github.com/s00d/on-codemerge.git Copyright (c) 2026 Pavel Kuzmin - Built on 2026-07-02T13:39:17.947Z */ import { TokenType as e } from "../../../types.mjs"; const r = { name: "rust", patterns: { [e.Comment]: /^\/\/.*$|^\/\*[\s\S]*?\*\//, [e.String]: /^"(?:\\.|[^"\\])*"|^'(?:\\.|[^'\\])*'/, [e.Number]: /^\b(?:0x[0-9a-fA-F]+|0o[0-7]+|0b[01]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/, [e.Function]: /^\b[a-zA-Z_]\w*(?=\s*[({])/, [e.Type]: /^\b(?:i8|i16|i32|i64|i128|isize|u8|u16|u32|u64|u128|usize|f32|f64|bool|char|str|String)\b/, [e.Decorator]: /^#\[(?:[^\]\\]|\\.)*\]/, [e.Lifetime]: /^'[a-zA-Z_]\w*/, [e.Operator]: /^(?:->|=>|\+=|-=|\*=|\/=|%=|&=|\|=|\^=|<<=|>>=|=|\+|-|\*|\/|%|&|\||!|<|>|<=|>=|==|!=)/, [e.Punctuation]: /^[{}[\]();,.]/ }, keywords: [ "as", "async", "await", "break", "const", "continue", "crate", "dyn", "else", "enum", "extern", "false", "fn", "for", "if", "impl", "in", "let", "loop", "match", "mod", "move", "mut", "pub", "ref", "return", "self", "Self", "static", "struct", "super", "trait", "true", "type", "unsafe", "use", "where", "while", "yield" ] }; export { r as rustDefinition };