| Crates.io | onion-frontend |
| lib.rs | onion-frontend |
| version | 0.3.4 |
| created_at | 2025-05-28 15:13:18.197943+00 |
| updated_at | 2025-08-15 10:26:47.220294+00 |
| description | Compilation frontend for the Onion programming language - lexer, parser, and IR generator |
| homepage | https://github.com/sjrsjz/onion-lang |
| repository | https://github.com/sjrsjz/onion-lang |
| max_upload_size | |
| id | 1692939 |
| size | 341,033 |
The compilation frontend for the Onion programming language. This package handles lexical analysis, parsing, semantic analysis, and intermediate representation generation.
The onion-frontend package is responsible for transforming Onion source code into intermediate representation (IR) that can be executed by the Onion Virtual Machine. It implements a complete compilation pipeline from source text to executable bytecode.
Source Code → Lexer → Parser → AST -> Comptime → Analyzer → IR Generator → IR/Bytecode
parser/lexer.rs) - Tokenizes source code into a stream of tokensparser/ast.rs) - Builds Abstract Syntax Tree (AST) from tokensparser/analyzer.rs) - Performs semantic analysis and error checkingir_generator/) - Generates intermediate representation from ASTcompile.rs) - Orchestrates the entire compilation processonion-frontend/
├── src/
│ ├── lib.rs # Public API exports
│ ├── compile.rs # Main compilation orchestration
│ ├── parser/ # Lexical and syntactic analysis
│ │ ├── comptime/ # Compile-time evaluation and solving
│ │ ├── mod.rs
│ │ ├── lexer.rs # Tokenization
│ │ ├── ast.rs # AST construction
│ │ └── analyzer.rs # Semantic analysis
│ └── ir_generator/ # Intermediate representation
│ ├── mod.rs
│ └── ir_generator.rs # IR generation logic
└── Cargo.toml
This package is designed to work seamlessly with:
onion compile commandThis package is part of the Onion programming language project and is licensed under the MIT License.