luaur-analysis 0.1.1

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Node: `cxx:Method:Luau.Analysis:Analysis/src/ToString.cpp:347:stringifier_state_newline`
//! Source: `Analysis/src/ToString.cpp:347-354` (hand-ported)

use crate::records::stringifier_state::StringifierState;

impl StringifierState {
    /// C++ `void newline()` — `if (!opts.useLineBreaks) return emit(" ");`
    /// (an earlier translation dropped the space, gluing separators).
    pub fn newline(&mut self) {
        let use_line_breaks = unsafe { (*self.opts).use_line_breaks };
        if !use_line_breaks {
            return self.emit_string(" ");
        }

        self.emit_string("\n");
        self.emit_indentation();
    }
}