Commit Graph

103 Commits

Author SHA1 Message Date
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
gingerBill
53380632a1 Swap order of prev and next 2023-09-12 11:44:54 +01:00
Laytan Laats
076b20a9a5 fix queue reserve always doubling in size when there is enough space 2023-08-26 19:09:04 +02:00
gingerBill
3dec55f009 Replace x in &y Use &v in y syntax through core & vendor for switch/for statements 2023-06-26 15:42:57 +01:00
gingerBill
319a465429 Correct queue usage of runtime.Allocator_Error 2023-05-27 15:26:27 +01:00
Jon Lipstate
bcb01bdc52 added set overload, made make explicit 2023-05-02 18:21:52 -07:00
Jon Lipstate
075193af1d update docs, add unsafe_get/set, add round up to create 2023-04-30 16:56:05 -07:00
Lucas Perlind
f029b4beb1 Add more utility procedures to small array 2022-12-21 13:00:33 +11:00
gingerBill
035c75d6a9 Add contextless where appropriate 2022-11-11 11:23:59 +00:00
Colin Davidson
7a6fc3a93b Add bounds check for peeks 2022-08-29 02:03:12 -07:00
Colin Davidson
83c002c197 add peeks 2022-08-29 01:53:40 -07:00
Colin Davidson
6c2e0b09ba Add more queue helpers 2022-08-29 00:43:35 -07:00
Jeroen van Rijn
e40b3ad338 Remove unused n from PQ; add reflect.is_bit_set 2022-08-18 18:00:25 +02:00
gingerBill
79eb7b52d9 Merge pull request #1828 from JungerBoyo/patch-2
front() and back()
2022-06-12 16:17:39 +01:00
JungerBoyo
78e6cd0c60 front() and back()
based on pop_front(), pop_back()
2022-06-04 00:12:34 +02:00
JungerBoyo
ad6b3bd95f unset function
unset function, clear single bits
2022-06-03 15:53:14 +02:00