feat: add stdlib module support with auto-import resolution
- Parse module paths in stdlib (module Std::Array { ... })
- Collect stdlib declarations and inject into user modules before sema
- Add dkExternFunc support throughout pipeline (parser, sema, hir, c backend)
- Auto-dereference pointer types for field access (arr->field)
- Add hArrowField HIR node for cleaner C emission
- Fix resolveTypeExpr for pointer and cast types
- Fix struct field lowering to use resolveTypeExpr
- Allow int <-> uint implicit conversion for bootstrap convenience
- Add stdlib/Std/Array.bux with dynamic array primitives
- Add stdlib_test demonstrating Array usage via import Std::Array::{Array};
This commit is contained in:
+4
-2
@@ -337,6 +337,7 @@ type
|
||||
declImplMethods*: seq[Decl]
|
||||
of dkModule:
|
||||
declModuleName*: string
|
||||
declModulePath*: seq[string]
|
||||
declModuleItems*: seq[Decl]
|
||||
of dkUse:
|
||||
declUsePath*: seq[string]
|
||||
@@ -370,11 +371,12 @@ type
|
||||
# ---------------------------------------------------------------------------
|
||||
Module* = ref object
|
||||
name*: string
|
||||
path*: seq[string]
|
||||
items*: seq[Decl]
|
||||
|
||||
# Convenience constructors
|
||||
proc newModule*(name: string): Module =
|
||||
result = Module(name: name)
|
||||
proc newModule*(name: string, path: seq[string] = @[]): Module =
|
||||
result = Module(name: name, path: path)
|
||||
|
||||
proc newBlock*(loc: SourceLocation): Block =
|
||||
result = Block(loc: loc)
|
||||
|
||||
Reference in New Issue
Block a user