Skip to main content

luaur_compiler/records/
l_value.rs

1use luaur_ast::records::location::Location;
2use luaur_bytecode::records::string_ref::StringRef;
3
4use crate::enums::kind::Kind;
5
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
7pub struct LValue {
8    pub(crate) kind: Kind,
9    pub(crate) reg: u8,
10    pub(crate) upval: u8,
11    pub(crate) index: u8,
12    pub(crate) number: u8,
13    pub(crate) name: StringRef,
14    pub(crate) location: Location,
15}
16
17impl Default for LValue {
18    fn default() -> Self {
19        Self {
20            kind: Kind::Kind_Local,
21            reg: 0,
22            upval: 0,
23            index: 0,
24            number: 0,
25            name: StringRef::default(),
26            location: Location::default(),
27        }
28    }
29}