luaur-ast 0.1.0

Lexer, parser, and AST for Luau (faithful Rust port).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::records::ast_attr::AstAttr;
use crate::records::printer::Printer;

impl<'a> Printer<'a> {
    pub fn visualize_attribute(&mut self, attribute: &mut AstAttr) {
        self.advance(&attribute.base.location.begin);
        self.writer.symbol("@");
        let name_val = attribute.name.value;
        let name_str = unsafe { core::ffi::CStr::from_ptr(name_val).to_string_lossy() };
        self.writer.identifier(&name_str);
    }
}