Syntax:
import { Counter, shared_count } from "./shared"
export let shared_count = 0
export component Counter = ...
Implementation:
- Lexer: Import, Export keywords
- AST: ImportDecl(names, source), Export(name, inner_decl)
- Parser: parse_import_decl, parse_export_decl
- CLI: resolve_imports() — recursive file resolution, dedup, inline
Resolves relative paths, adds .ds extension, handles transitive imports.
110 tests, 0 failures.
10 lines
267 B
Text
10 lines
267 B
Text
-- Shared state module — exported values used by the main app
|
|
|
|
export let shared_count = 0
|
|
|
|
export component Counter =
|
|
column [
|
|
text "Shared counter: {shared_count}"
|
|
button "+" { click: shared_count += 1 }
|
|
button "-" { click: shared_count -= 1 }
|
|
]
|