implements PLN-0053
This commit is contained in:
+32
-2
@@ -56,6 +56,9 @@ prometeu-compiler/frontends/prometeu-frontend-pbs/
|
||||
stdlib/
|
||||
1/
|
||||
sdk/
|
||||
composer/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
gfx/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
@@ -75,7 +78,7 @@ Interpretation:
|
||||
|
||||
- `stdlib/1` selects stdlib major line `1`,
|
||||
- `sdk` and `core` are reserved project spaces,
|
||||
- `gfx`, `audio`, `math` are module paths within those reserved spaces,
|
||||
- `composer`, `gfx`, `audio`, `math` are module paths within those reserved spaces,
|
||||
- `main.pbs` and `mod.barrel` form the interface module contents.
|
||||
|
||||
## 5. Logical Mapping
|
||||
@@ -85,6 +88,7 @@ The compiler must treat the physical layout as a logical stdlib environment.
|
||||
Required mapping:
|
||||
|
||||
- `stdlib/<N>/sdk/gfx` -> `@sdk:gfx`
|
||||
- `stdlib/<N>/sdk/composer` -> `@sdk:composer`
|
||||
- `stdlib/<N>/sdk/asset` -> `@sdk:asset`
|
||||
- `stdlib/<N>/sdk/audio` -> `@sdk:audio`
|
||||
- `stdlib/<N>/core/math` -> `@core:math`
|
||||
@@ -94,7 +98,7 @@ Rules:
|
||||
|
||||
- physical storage is an implementation detail,
|
||||
- logical module identity is authoritative,
|
||||
- callers of the resolver should work with logical addresses such as `@sdk:gfx`, not resource paths.
|
||||
- callers of the resolver should work with logical addresses such as `@sdk:gfx` and `@sdk:composer`, not resource paths.
|
||||
|
||||
## 6. Module File Convention
|
||||
|
||||
@@ -145,6 +149,7 @@ Responsibility:
|
||||
Minimum operations:
|
||||
|
||||
- `resolve(@sdk:gfx)`
|
||||
- `resolve(@sdk:composer)`
|
||||
- `resolve(@core:math/vector)`
|
||||
|
||||
### 7.3 `StdlibModuleSource`
|
||||
@@ -219,6 +224,26 @@ declare host LowAssets {
|
||||
}
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```pbs
|
||||
declare host LowComposer {
|
||||
[Host(module = "composer", name = "emit_sprite", version = 1)]
|
||||
[Capability(name = "gfx")]
|
||||
fn emit_sprite(
|
||||
glyph_id: int,
|
||||
palette_id: int,
|
||||
x: int,
|
||||
y: int,
|
||||
layer: int,
|
||||
bank_id: int,
|
||||
flip_x: bool,
|
||||
flip_y: bool,
|
||||
priority: int
|
||||
) -> int;
|
||||
}
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- the parser reads the attribute as part of the interface module source,
|
||||
@@ -226,6 +251,11 @@ Rules:
|
||||
- the compiler stores the extracted metadata in its interface graph,
|
||||
- the raw attribute surface is not treated as a runtime object,
|
||||
- later lowering stages may consume the extracted metadata to produce PBX host-binding declarations.
|
||||
- stdlib line `1` MUST expose the sprite-composition interface module at `@sdk:composer`,
|
||||
- that module MUST declare `LowComposer` and public service `Composer`,
|
||||
- that module MUST use runtime module `composer` and capability `gfx`,
|
||||
- that module MUST expose `emit_sprite(glyph_id: int, palette_id: int, x: int, y: int, layer: int, bank_id: int, flip_x: bool, flip_y: bool, priority: int) -> int`,
|
||||
- stdlib line `1` MUST NOT expose `Gfx.set_sprite`,
|
||||
- stdlib line `1` MUST expose the low-level asset interface module at `@sdk:asset`,
|
||||
- that module MUST declare `LowAssets`,
|
||||
- that module MUST use runtime module `asset` and capability `asset`,
|
||||
|
||||
Reference in New Issue
Block a user