Skip to main content

luaur_ast/methods/
printer_write_end.rs

1use crate::records::location::Location;
2use crate::records::position::Position;
3use crate::records::printer::Printer;
4use luaur_common::macros::luau_assert::LUAU_ASSERT;
5
6impl<'a> Printer<'a> {
7    pub fn write_end(&mut self, loc: &Location) {
8        let mut end_pos = loc.end;
9        if end_pos.column >= 3 {
10            end_pos.column -= 3;
11        }
12        self.advance(&end_pos);
13        self.writer.keyword("end");
14    }
15}
16
17#[no_mangle]
18pub extern "C" fn printer_write_end(this: *mut Printer, loc: *const Location) {
19    unsafe {
20        (*this).write_end(&*loc);
21    }
22}