Compiler pipeline
CL++ is a source-to-source compiler. Pest parses .clpp / .clh / .clp. Analysis builds scopes and feeds the editor. Codegen writes Luau. There is no CL++ virtual machine, no opcode table, and no C++ embedding API — host tools call clpp compile or clpp api compile.
How this maps to the Luau repo: Luau engineering map.
flowchart TD src["Source .clpp / .clh / .clp"] --> pp["Preprocessor includes and pragma"] pp --> pest["Pest grammar"] pest --> ast["AST plus spans"] ast --> analysis["Analysis: check, symbols, complete_at"] analysis --> emit["Luau codegen"] emit --> out[".luau file"] analysis --> api["clpp api complete / hover / symbols"] api --> lsp["editors/vscode LSP"] out --> rojo["Rojo / Cluaupp"]
Stages
Section titled “Stages”| Stage | Where | Output |
|---|---|---|
| Include / pragma | src/preprocess | One translation unit; comments keep source lines |
| Parse | src/parser/grammar.pest | AST (recovery for the IDE after the first Pest error) |
| Analysis | src/analysis + src/semantic/check.rs | Diagnostics, scopes, completions, hover, outline |
| Builtins | src/builtins | One table for emit, manifest, and IDE |
| Emit | src/codegen/emit | Luau (function Class:Method, self, game:GetService) |
| Editor | editors/vscode | LSP calls clpp api complete |
Host tools
Section titled “Host tools”Cluaupp (and anything else) should use:
clpp api compile # JSON stdin/stdoutclpp api complete # { source, fileName, line, column } 1-basedclpp api hoverclpp api symbolsclpp api definitionclpp manifest # extensions, tags, operators, builtinsclpp fmt # indentclpp watch # recompile on changeSee Cluaupp 0.7.0, Update Cluaupp, CL++ + luau-lsp, and Cluaupp support. Current compiler: 0.7.0.