Files
sakurac/tests/programs/module_exports_1.sakura
2026-11-19 04:54:17 -06:00

19 lines
526 B
Plaintext

import std::io;
import lib;
import lib::inner;
def main(): void {
var c := start();
c.bump();
println($"{c.n} {label()} {total()}");
}
module lib;
pub struct counter { pub var n: int; }
def step(): int { return 2; }
pub def counter::bump(&mut this): void { this.n = this.n + step(); }
pub def total(): int { return step() + deeper::extra(); }
module lib::inner;
pub def start(): counter { return counter{ n = step() }; }
pub def label(): string { return "inner"; }
module lib::deeper;
pub def extra(): int { return 5; }