[BIG UPDATE] Refactor code formatting and remove unused bit module#217
Merged
levno-710 merged 3 commits intoprometheus-lua:masterfrom Mar 23, 2026
Merged
[BIG UPDATE] Refactor code formatting and remove unused bit module#217levno-710 merged 3 commits intoprometheus-lua:masterfrom
levno-710 merged 3 commits intoprometheus-lua:masterfrom
Conversation
- Cleaned up whitespace inconsistencies across multiple files. - Removed the unused 'bit' module from the project. - Updated comments and documentation for clarity. - REFACTORED SINGLE-FILE COMPILER! Replaced with behaviourally identical modularised version. - tested integrity of 'identical' using Vmify on seed 1 with NameGenerator set to Mangled. - Removed unused dependencies initialised in pipeline.lua. - Removed unused functions from util.lua previouslty used for compiler_old. - Fixed inconsistent whitespaces in steps.lua. NOTE: This makes maintenance to the compiler much easier, and allows significant security modifications in the future when needed, Given the deobfuscation rumours.
- Cleaned up whitespace inconsistencies across multiple files. - Removed the unused 'bit' module from the project. - Updated comments and documentation for clarity. - REFACTORED SINGLE-FILE COMPILER! Replaced with behaviourally identical modularised version. - tested integrity of 'identical' using Vmify on seed 1 with NameGenerator set to Mangled. - Removed unused dependencies initialised in pipeline.lua. - Removed unused functions from util.lua previouslty used for compiler_old. - Fixed inconsistent whitespaces in steps.lua. NOTE: This makes maintenance to the compiler much easier, and allows significant security modifications in the future when needed, Given the deobfuscation rumours.
|
its time to buy claude with max plan so it can rewrite the compiler to 100% accurate luraph vm like |
There was a problem hiding this comment.
Pull request overview
This PR primarily refactors and modularizes the Prometheus compiler implementation while also doing broad whitespace/formatting cleanup and removing an unused internal bitwise module.
Changes:
- Removed the unused
src/prometheus/bit.luamodule and pruned related utilities fromsrc/prometheus/util.lua. - Modularized the compiler into dedicated modules for blocks/registers/upvalues/emission, plus statement/expression handler tables.
- Standardized whitespace/formatting across several core Prometheus modules and comments.
Reviewed changes
Copilot reviewed 49 out of 56 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests.lua | Minor formatting cleanup in test harness configuration and output capture. |
| src/prometheus/util.lua | Removes unused bit/packing helpers and tightens keys() implementation + exports. |
| src/prometheus/unparser.lua | Whitespace-only formatting changes. |
| src/prometheus/tokenizer.lua | Whitespace-only formatting changes. |
| src/prometheus/steps.lua | Normalizes step table formatting (commas, alignment). |
| src/prometheus/step.lua | Whitespace changes around settings validation logic. |
| src/prometheus/scope.lua | Whitespace-only formatting changes. |
| src/prometheus/pipeline.lua | Removes unused requires/locals and normalizes whitespace. |
| src/prometheus/parser.lua | Removes unused local aliases and normalizes whitespace. |
| src/prometheus/enums.lua | Whitespace-only formatting changes in conventions tables. |
| src/prometheus/compiler/upvalue.lua | New: upvalue + GC/proxy/allocation helpers extracted into module. |
| src/prometheus/compiler/statements/while_statement.lua | New: compiler handler for WhileStatement. |
| src/prometheus/compiler/statements/return.lua | New: compiler handler for ReturnStatement. |
| src/prometheus/compiler/statements/repeat_statement.lua | New: compiler handler for RepeatStatement. |
| src/prometheus/compiler/statements/pass_self_function_call.lua | New: compiler handler for PassSelfFunctionCallStatement. |
| src/prometheus/compiler/statements/local_variable_declaration.lua | New: compiler handler for LocalVariableDeclaration. |
| src/prometheus/compiler/statements/local_function_declaration.lua | New: compiler handler for LocalFunctionDeclaration. |
| src/prometheus/compiler/statements/if_statement.lua | New: compiler handler for IfStatement. |
| src/prometheus/compiler/statements/function_declaration.lua | New: compiler handler for FunctionDeclaration. |
| src/prometheus/compiler/statements/function_call.lua | New: compiler handler for FunctionCallStatement. |
| src/prometheus/compiler/statements/for_statement.lua | New: compiler handler for ForStatement. |
| src/prometheus/compiler/statements/for_in_statement.lua | New: compiler handler for ForInStatement. |
| src/prometheus/compiler/statements/do_statement.lua | New: compiler handler for DoStatement. |
| src/prometheus/compiler/statements/continue_statement.lua | New: compiler handler for ContinueStatement. |
| src/prometheus/compiler/statements/compound.lua | New: shared compiler handler for compound assignment statements. |
| src/prometheus/compiler/statements/break_statement.lua | New: compiler handler for BreakStatement. |
| src/prometheus/compiler/statements/assignment.lua | New: compiler handler for AssignmentStatement. |
| src/prometheus/compiler/statements.lua | New: AstKind→statement-handler dispatch table. |
| src/prometheus/compiler/register.lua | New: register allocation/freeing + register read/write AST helpers. |
| src/prometheus/compiler/expressions/variable.lua | New: expression handler for VariableExpression. |
| src/prometheus/compiler/expressions/vararg.lua | New: expression handler for VarargExpression. |
| src/prometheus/compiler/expressions/table_constructor.lua | New: expression handler for TableConstructorExpression. |
| src/prometheus/compiler/expressions/string.lua | New: expression handler for StringExpression. |
| src/prometheus/compiler/expressions/pass_self_function_call.lua | New: expression handler for PassSelfFunctionCallExpression. |
| src/prometheus/compiler/expressions/or.lua | New: expression handler for OrExpression (short-circuit handling). |
| src/prometheus/compiler/expressions/number.lua | New: expression handler for NumberExpression. |
| src/prometheus/compiler/expressions/not.lua | New: expression handler for NotExpression. |
| src/prometheus/compiler/expressions/nil.lua | New: expression handler for NilExpression. |
| src/prometheus/compiler/expressions/negate.lua | New: expression handler for NegateExpression. |
| src/prometheus/compiler/expressions/len.lua | New: expression handler for LenExpression. |
| src/prometheus/compiler/expressions/index.lua | New: expression handler for IndexExpression. |
| src/prometheus/compiler/expressions/function_literal.lua | New: expression handler for FunctionLiteralExpression. |
| src/prometheus/compiler/expressions/function_call.lua | New: expression handler for FunctionCallExpression. |
| src/prometheus/compiler/expressions/boolean.lua | New: expression handler for BooleanExpression. |
| src/prometheus/compiler/expressions/binary.lua | New: shared handler for binary operator expressions. |
| src/prometheus/compiler/expressions/and.lua | New: expression handler for AndExpression (short-circuit handling). |
| src/prometheus/compiler/expressions.lua | New: AstKind→expression-handler dispatch table. |
| src/prometheus/compiler/emit.lua | New: emits/shuffles container function blocks and builds dispatch while-body. |
| src/prometheus/compiler/constants.lua | New: shared compiler constants (e.g., MAX_REGS). |
| src/prometheus/compiler/compiler.lua | Refactors the compiler entrypoint to compose the new modules. |
| src/prometheus/compiler/compile_top.lua | New: compilation of top node, functions, and blocks extracted into module. |
| src/prometheus/compiler/compile_core.lua | New: compileStatement/compileExpression dispatch + wiring of top compilation. |
| src/prometheus/compiler/block.lua | New: block creation/activation + statement recording extracted into module. |
| src/prometheus/bit.lua | Removed: unused bitwise module implementation. |
| src/prometheus/ast.lua | Whitespace-only formatting changes. |
| src/presets.lua | Fixes incorrect file header comment label. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
so what are we thinking? 👀 |
Contributor
Author
|
i already aggressively tested it for bugs lmao it's all good |
Member
|
I also checked your code by hand. Looks good to me. Thank you for this work :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: This makes maintenance to the compiler much easier, and allows significant security modifications in the future when needed, Given the deobfuscation rumours.
tldr: Refactored compiler while maintaining 1:1 behavioural profile fixed whitespacing issues and corrected file comments
Nice try deobfuscators. Not happening while I'm still around.