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
13
14
15
16
17
use crate::functions::find_attribute_in_array::find_attribute_in_array;
use crate::records::ast_attr::{AstAttr, AstAttrType};
use crate::records::ast_stat_declare_function::AstStatDeclareFunction;

impl AstStatDeclareFunction {
    pub fn get_attribute(&self, attribute_type: AstAttrType) -> *mut AstAttr {
        find_attribute_in_array(self.attributes, attribute_type)
    }
}

#[allow(non_snake_case)]
pub fn ast_stat_declare_function_get_attribute(
    this: &AstStatDeclareFunction,
    attribute_type: AstAttrType,
) -> *mut AstAttr {
    this.get_attribute(attribute_type)
}