pub struct Reducer { /* private fields */ }Expand description
Reducer is a native-only utility for reducing Luau source code while preserving a bug.
It is not portable to wasm32-unknown-unknown.
Implementations§
Source§impl Reducer
impl Reducer
pub fn delete_child_statements_ast_stat_block_usize( &mut self, block: *mut AstStatBlock, chunk_count: usize, ) -> (bool, usize)
Source§impl Reducer
impl Reducer
pub fn delete_child_statements_ast_stat_block( &mut self, b: *mut AstStatBlock, ) -> bool
Source§impl Reducer
impl Reducer
pub fn pruned_span( &self, block: *mut AstStatBlock, span1: Span, span2: Span, ) -> Vec<*mut AstStat>
Source§impl Reducer
impl Reducer
Sourcepub fn reallocate_statements(
&mut self,
statements: &Vec<*mut AstStat>,
) -> *mut *mut AstStat
pub fn reallocate_statements( &mut self, statements: &Vec<*mut AstStat>, ) -> *mut *mut AstStat
Move new body data into allocator-managed storage so that it’s safe to keep around
longterm. C++ (CLI/src/Reduce.cpp:233-239):
AstStat** newData = static_cast<AstStat**>(allocator.allocate(sizeof(AstStat*) * statements.size()));
std::copy(statements.data(), statements.data() + statements.size(), newData);
return newData;The pointers are copied into arena storage owned by self.allocator, which outlives
the Reducer, so the returned pointer stays valid for the rest of the run.
Source§impl Reducer
impl Reducer
pub fn try_promoting_child_statements_ast_stat_block_usize( &mut self, b: *mut AstStatBlock, index: usize, ) -> bool
Source§impl Reducer
impl Reducer
pub fn try_promoting_child_statements_ast_stat_block( &mut self, b: *mut AstStatBlock, ) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Send for Reducer
impl !Sync for Reducer
impl Freeze for Reducer
impl RefUnwindSafe for Reducer
impl Unpin for Reducer
impl UnsafeUnpin for Reducer
impl UnwindSafe for Reducer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more