This commit is contained in:
Nilton Constantino
2026-02-02 15:43:13 +00:00
parent 6732111328
commit ad1650592d
7 changed files with 51 additions and 55 deletions
@@ -203,10 +203,10 @@ Visibility is mandatory for services.
### 3.4 Functions
```
FnDecl ::= 'fn' Identifier ParamList ReturnType? ElseFallback? Block
FnDecl ::= Visibility? 'fn' Identifier ParamList ReturnType? ElseFallback? Block
```
Top‑level `fn` are always file‑private.
Top‑level `fn` are `mod` or `file-private` (default). They cannot be `pub`.
---
@@ -202,7 +202,7 @@ The **value namespace** contains executable and runtime-visible symbols.
Symbols in the value namespace are introduced by:
* `service`
* top-level `fn` - always file-private.
* top-level `fn` — `mod` or `file-private` (default).
* top-level `let` are not allowed.
Rules:
@@ -360,9 +360,9 @@ Top-level `fn` declarations define reusable executable logic.
Rules:
* A top-level `fn` is always **file-private**.
* A top-level `fn` cannot be declared as `mod` or `pub`.
* A top-level `fn` is visible only within the file where it is declared.
* A top-level `fn` is always **mod** or **file-private**.
* A top-level `fn` cannot be declared as `pub`.
* `fn` defaults to **file-private** visibility.
Example (VALID):
-44
View File
@@ -1,47 +1,3 @@
## PR-13 — Build Plan v0: deterministic compilation order
**Why:** We need a stable, reproducible pipeline: compile dependencies first, then the root project.
### Scope
* Implement `prometeu_compiler::build::plan`:
* **Input:** `ResolvedGraph`
* **Output:** `BuildPlan` with topologically sorted build steps
* Each `BuildStep` MUST include:
* `project_id` — canonical project identity (`prometeu.json.name`)
* `project_dir` — absolute or normalized path
* `target` — `main` or `test`
* `sources` — ordered list of `.pbs` source files (from `src/<target>/modules`)
* `deps` — dependency edge map: `alias -> ProjectId`
### Determinism Rules (MANDATORY)
* Topological sort must be stable:
* when multiple nodes have indegree 0, choose by lexicographic `project_id`
* `sources` list must be:
* discovered only under `src/<target>/modules`
* sorted lexicographically by normalized relative path
* `deps` must be stored/exported in deterministic order (e.g. `BTreeMap`)
### Deliverables
* `BuildPlan { steps: Vec<BuildStep> }`
### Tests
* topo ordering stable across runs
* sources ordering stable regardless of filesystem order
### Acceptance
* BuildPlan is deterministic and contains all information needed to compile without further graph traversal.
---
## PR-14 — Compiler Output Format v0: emit per-project object module (intermediate)
**Why:** Linking requires a well-defined intermediate representation per project.