Commit Graph

118 Commits

Author SHA1 Message Date
Mohit Sethi
27b59ab7c3 Propogate #caller_location to core:container/queue procs 2025-08-22 16:45:50 +01:00
Feoramund
23c1ce8722 container/queue: Remove trailing whitespace 2025-06-11 11:57:38 -04:00
Feoramund
638a1529a3 container/queue: Add shrink 2025-06-11 11:55:30 -04:00
Feoramund
040d79e1b9 container/queue: Let queues be re-initialized with different allocators 2025-06-11 11:55:30 -04:00
Feoramund
81f5763482 container/queue: Add common aliases enqueue and dequeue 2025-06-11 11:55:30 -04:00
Feoramund
6cb84e467b container/queue: Document the package 2025-06-11 11:55:30 -04:00
Feoramund
862442511a container/queue: Reorganize 2025-06-11 11:55:29 -04:00
Feoramund
58bda1209a container/queue: Deprecate peek_*
The `*_ptr` and `peek_*` procedures did the same thing, except `peek_*`
was over-cautiously putting the index through a modulo when all
assignments to `q.offset` are already wrapped.
2025-06-11 11:54:52 -04:00
Feoramund
27cd508571 container/queue: Fix and add more bounds checking 2025-06-11 11:54:47 -04:00
Feoramund
1662ab10af Fix off-by-one error in priority_queue.remove 2025-05-21 09:33:39 -04:00
Jeroen van Rijn
8c47d42394 Fix lru.remove 2025-04-29 00:14:46 +02:00
Jeroen van Rijn
5a39013339 Let core:container/priority_queue return runtime.Allocator_Error
`init`, `reserve` and `push` now return `runtime.Allocator_Error`.
2025-04-17 14:20:03 +02:00
Jeroen van Rijn
f7c4c80ef3 Fix broken examples in documentation tester.
No more:
```
We could not find the procedure "pkg_foo_example :: proc()" needed to test the example created for "pkg.foo"
The following procedures were found:
   bar()
```
2025-04-05 16:36:26 +02:00
Robin Bergewski
e963ba12fc core:container/small_array: add package documentation 2025-04-05 15:38:42 +02:00
Laytan Laats
a5f3c1b849 container/queue: fix init_with_contents
Fixes #4729
2025-01-20 19:51:46 +01:00
Laytan Laats
bd45900257 container/bit_array: add 'init' procedure 2024-09-29 10:57:42 +02:00
gingerBill
a4fd0c133e Merge pull request #4191 from laytan/improve-package-doc-comments
core: improve package doc comments for the documentation generator
2024-09-04 21:37:48 +01:00
Feoramund
c3bd94a27e Change Bit_Array.max_index to length
This will allow correct iteration of empty `bit_array`s.
2024-09-03 16:56:02 -04:00
Feoramund
d86e56089a Fix iteration of biased Bit_Array 2024-09-03 15:34:38 -04:00
Laytan Laats
288312a812 core: improve package doc comments for the documentation generator 2024-09-03 19:59:04 +02:00
Feoramund
b8f8cb9582 Add bit_array.shrink 2024-09-03 13:33:15 -04:00
Feoramund
001b2b9d8f Let bit_array.create make zero-length arrays 2024-09-03 13:33:11 -04:00
Feoramund
309953e0f2 Return false if Small_Array can't append multiple elements
Fixes #4177
2024-09-03 01:14:17 -04:00
Jeroen van Rijn
03cb585845 Merge pull request #3908 from NicknEma/Intrusive-list-docs
Write docs for `core:container/intrusive/list` package
2024-07-14 23:28:53 +02:00
NicknEma
63276a85ba Fixed grammar and expanded info
Fixed points made by Jeroen.
2024-07-14 18:18:12 +02:00
Laytan Laats
d90d7ed002 Fix off-by-one in queue back and back_ptr procs 2024-07-14 16:00:55 +02:00
gingerBill
8642d719f0 Imply #no_capture to all variadic parameters 2024-07-14 12:19:47 +01:00
gingerBill
c7bd954752 Add more uses of #no_capture 2024-07-14 11:56:04 +01:00
NicknEma
d10694901f Simplify and fix doc examples
Remove unnecessary examples;
fix compilation errors in the remaining ones
2024-07-12 15:48:47 +02:00
NicknEma
c75a872909 Write doc comments in intrusive_list.odin
Write description, inputs/returns and some examples for each procedure
2024-07-12 15:37:34 +02:00
NicknEma
a348a7e84e Create doc.odin
Create a doc file with a brief of the package and an example program (copied from a discord message by laytan)
2024-07-12 15:18:58 +02:00
gingerBill
e296d6fb90 Fix loads of indentation issues with mixing spaces and tabs 2024-06-29 19:50:51 +01:00
gingerBill
663661db53 Update core to -strict-style 2024-06-29 19:16:32 +01:00
gingerBill
5413a8b744 Even more style fixes 2024-06-29 19:11:36 +01:00
gingerBill
3f9a58808c More style improvements 2024-06-29 19:07:34 +01:00
gingerBill
37afd469c6 Merge pull request #3339 from axxeny/patch-1
fix comments in core:container/queue.
2024-06-28 12:00:34 +01:00
Jeroen van Rijn
a0a48bfe34 Fix alignment. 2024-06-27 21:56:26 +02:00
destroycomputers
de44dd5412 Loosen constraint on the Key type in rb & avl tree
The current constraint on the `init_ordered' function accepts only
numeric types. While one still can init a non-numerically-keyed tree by
passing a comparator explicitly, the reason to disallow non-numeric
ordered types is nowhere to be found.
2024-06-18 13:31:45 +02:00
Jeroen van Rijn
11e57fd3fd Address concerns. 2024-05-24 13:58:30 +02:00
Jeroen van Rijn
c43d189a33 Fix package line. 2024-05-24 01:43:17 +02:00
Jeroen van Rijn
410876b36a Add core:container/rbtree
Add a red-black tree with configurable $Key and $Value.
Also includes tests that verify it maintains RB invariants, doesn't leak.

Originally based on the CC0 implementation from literateprograms.org.
But reworked to the same API used by @Yawning's excellent `core:container/avl` for ease of use.
2024-05-23 23:00:00 +02:00
gingerBill
334e08c750 Update numerous package declaration names 2024-04-18 12:17:39 +01:00
Maurizio M. Gavioli
a0cff82320 Fix the format of some doc.odin files of the core library which did not made into the documentation.
`c/frontend/tokenizer`:
   add proper "Example:" header to demo example code,
   removed empty lines.
`container/bit_array`:
   moved comment before package;
   aligned narrative lines to left margin;
   converted case lines into bulleted lines ("- ");
   converted individual examples to single-tab-indented preformatted text.
`dynlib`:
   removed "//+build ignore" line;
   added newline at EOF.
`image/netpmb`:
   converted indented lines of "Reading", "Wrting" and "Some syntax..." into bulleted lists;
   "Formats" indented lines kept as they are as the preformatted text seems relevant to keep the alignments;
   doubly indented lines kept as single-indented to keep them different (as the format does not allow for two-level bulleted lists);
   removed empy lines.
`os/os2`:	WIP, not modified
`sys/info`:
   removed "//+build ignore" line;
   converted tab-indented initial description into regular left-margin comment;
   moved uncommented sample code within the doc comment as an "Example:";
   moved simple- and double-tabbed separate comments with sample Windows and macOS outputs within the doc comment as bulleted headlines with preformatted output listings;
   removed now empty comments and blank lines after the package line.
`text/i18n`:
   removed "//+build ignore" line;
   moved the pacakge line at the end;
   de-indented the tab-indented introductory narrative;
   moved sample code comments into the doc comment as tab-indented code with a proper "Example:" heading;
   removed "```" MD attempts at code formatting.
`text/table`:
   unindented the comment lines of a descriptive kind;
   headlines of major subdivisions are marked as bold;
   kept code samples as tab-indented preformatted text (as there are several of them, the standard "Example:" and "Output:" headings cannot be used) removing the "```" MD attempts at code formatting;
   removed in-between blank lines.
2024-04-14 17:18:08 +02:00
Arseniy Poroshin
77a0e50298 fix comments in core:container/queue. 2024-03-26 22:39:43 +00:00
Yawning Angel
874d6ccb60 core/container/avl: Initial import 2024-02-24 14:05:15 +09:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
Jeroen van Rijn
656e62d724 Add peek to priority queue. 2024-01-08 19:33:30 +01:00
Jeroen van Rijn
04c928fb9e Clear up core:container/queue 2023-11-15 15:20:52 +01:00
flysand7
270348b112 [core]: Remove do keyword from the core library 2023-11-11 20:36:38 +11:00
gingerBill
8e9d1c7ebf Make procedures contextless where possible 2023-09-12 11:52:05 +01:00