luaur-analysis 0.1.3

Luau type checker and type inference (Rust).
Documentation
use alloc::string::String;
use core::fmt::Write;

pub fn dot_escape(os: &mut String, s: &str) {
    os.push('"');
    for c in s.chars() {
        match c {
            '"' => os.push_str("\\\""),
            '\\' => os.push_str("\\\\"),
            '\n' => os.push_str("\\n"),
            '<' => os.push_str("\\<"),
            '>' => os.push_str("\\>"),
            '{' => os.push_str("\\{"),
            '}' => os.push_str("\\}"),
            '|' => os.push_str("\\|"),
            _ => os.push(c),
        }
    }
    os.push('"');
}