docs: backtick parameter references in API comments
This commit is contained in:
+1
-1
@@ -156,7 +156,7 @@ InvalidView :: struct {
|
||||
diagnostic DiagnosticId
|
||||
}
|
||||
|
||||
#! retains allocator for node storage and borrows source; release with deinit_builder.
|
||||
#! retains `allocator` for node storage and borrows `source`; release with deinit_builder.
|
||||
init_builder proc(allocator mem.Allocator, source []u8) Builder {
|
||||
return Builder{
|
||||
storage = Storage{
|
||||
|
||||
@@ -7,7 +7,7 @@ Renderer :: struct {
|
||||
bytes arraylist.ArrayList(u8)
|
||||
}
|
||||
|
||||
#! retains allocator for rendered output; the caller owns the returned Renderer.
|
||||
#! retains `allocator` for rendered output; the caller owns the returned Renderer.
|
||||
init proc(allocator mem.Allocator) Renderer {
|
||||
return Renderer{ bytes = arraylist.init(allocator) }
|
||||
}
|
||||
@@ -17,7 +17,7 @@ deinit proc(renderer @mut Renderer) void {
|
||||
arraylist.deinit(&renderer.bytes)
|
||||
}
|
||||
|
||||
#! borrows tree during rendering; output stays renderer-owned until render or deinit.
|
||||
#! borrows `tree` during rendering; output stays renderer-owned until render or deinit.
|
||||
render proc(renderer @mut Renderer, tree @ast.Tree) void ! mem.AllocError {
|
||||
arraylist.clear(&renderer.bytes)
|
||||
try append_text(renderer, "package\n")
|
||||
|
||||
@@ -28,7 +28,7 @@ Store :: struct { list arraylist.ArrayList(Diagnostic) }
|
||||
|
||||
CapacityError :: enum { diagnostic_limit_reached }
|
||||
|
||||
#! retains allocator for added diagnostics; the caller owns the returned Store.
|
||||
#! retains `allocator` for added diagnostics; the caller owns the returned Store.
|
||||
init proc(allocator mem.Allocator) Store {
|
||||
return Store{ list = arraylist.init(allocator) }
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ State :: struct {
|
||||
tokens arraylist.ArrayList(Token)
|
||||
}
|
||||
|
||||
#! retains allocator for scanned tokens; the caller owns the returned State.
|
||||
#! retains `allocator` for scanned tokens; the caller owns the returned State.
|
||||
init proc(allocator mem.Allocator) State {
|
||||
return State{ tokens = arraylist.init(allocator) }
|
||||
}
|
||||
@@ -44,7 +44,7 @@ deinit proc(state @mut State) void {
|
||||
arraylist.deinit(&state.tokens)
|
||||
}
|
||||
|
||||
#! borrows program and diagnostic_store during scanning; tokens remain state-owned.
|
||||
#! borrows `program` and `diagnostic_store` during scanning; tokens remain state-owned.
|
||||
#! token allocation uses the retained allocator; identifiers use strpool.strings's allocator.
|
||||
#! initialize strpool.strings before scanning and keep it alive while using identifier IDs.
|
||||
scan proc(
|
||||
|
||||
@@ -29,8 +29,8 @@ State :: struct {
|
||||
next_token usize
|
||||
}
|
||||
|
||||
#! borrows tokens and source while parsing; the returned Tree borrows source until ast.deinit.
|
||||
#! allocator supplies returned node storage and temporary lists released before return.
|
||||
#! borrows `tokens` and `source` while parsing; the returned Tree borrows `source` until ast.deinit.
|
||||
#! `allocator` supplies returned node storage and temporary lists released before return.
|
||||
#! the caller owns the Tree and must release it with ast.deinit.
|
||||
parse proc(
|
||||
allocator mem.Allocator,
|
||||
|
||||
@@ -53,8 +53,8 @@ State :: struct {
|
||||
allocator mem.Allocator
|
||||
}
|
||||
|
||||
#! borrows tree and diagnostic_store during resolution, without retaining their storage.
|
||||
#! allocator supplies caller-owned bindings and temporary scopes released before return.
|
||||
#! borrows `tree` and `diagnostic_store` during resolution, without retaining their storage.
|
||||
#! `allocator` supplies caller-owned bindings and temporary scopes released before return.
|
||||
#! release the returned Resolution with deinit, which uses the retained allocator.
|
||||
resolve proc(
|
||||
allocator mem.Allocator,
|
||||
|
||||
@@ -18,7 +18,7 @@ StringPool :: struct {
|
||||
allocator mem.Allocator
|
||||
}
|
||||
|
||||
#! retains allocator for interned copies and indexes; the caller owns the pool.
|
||||
#! retains `allocator` for interned copies and indexes; the caller owns the pool.
|
||||
init proc(allocator mem.Allocator) StringPool {
|
||||
return StringPool{
|
||||
ids = hashmap.init(allocator),
|
||||
|
||||
Reference in New Issue
Block a user