From a0cff82320840e4be6d40cee8a2432645773a53e Mon Sep 17 00:00:00 2001 From: "Maurizio M. Gavioli" Date: Sun, 14 Apr 2024 17:18:08 +0200 Subject: 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. --- core/container/bit_array/doc.odin | 75 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 38 deletions(-) (limited to 'core/container/bit_array') diff --git a/core/container/bit_array/doc.odin b/core/container/bit_array/doc.odin index 52e252d8a..371f63f0e 100644 --- a/core/container/bit_array/doc.odin +++ b/core/container/bit_array/doc.odin @@ -1,53 +1,52 @@ -package dynamic_bit_array - /* - The Bit Array can be used in several ways: +The Bit Array can be used in several ways: - -- By default you don't need to instantiate a Bit Array: +- By default you don't need to instantiate a Bit Array: - package test + package test - import "core:fmt" - import "core:container/bit_array" + import "core:fmt" + import "core:container/bit_array" - main :: proc() { - using bit_array + main :: proc() { + using bit_array - bits: Bit_Array + bits: Bit_Array - // returns `true` - fmt.println(set(&bits, 42)) + // returns `true` + fmt.println(set(&bits, 42)) - // returns `false`, `false`, because this Bit Array wasn't created to allow negative indices. - was_set, was_retrieved := get(&bits, -1) - fmt.println(was_set, was_retrieved) - destroy(&bits) - } + // returns `false`, `false`, because this Bit Array wasn't created to allow negative indices. + was_set, was_retrieved := get(&bits, -1) + fmt.println(was_set, was_retrieved) + destroy(&bits) + } - -- A Bit Array can optionally allow for negative indices, if the mininum value was given during creation: +- A Bit Array can optionally allow for negative indices, if the minimum value was given during creation: - package test + package test - import "core:fmt" - import "core:container/bit_array" + import "core:fmt" + import "core:container/bit_array" - main :: proc() { - Foo :: enum int { - Negative_Test = -42, - Bar = 420, - Leaves = 69105, - } + main :: proc() { + Foo :: enum int { + Negative_Test = -42, + Bar = 420, + Leaves = 69105, + } - using bit_array + using bit_array - bits := create(int(max(Foo)), int(min(Foo))) - defer destroy(bits) + bits := create(int(max(Foo)), int(min(Foo))) + defer destroy(bits) - fmt.printf("Set(Bar): %v\n", set(bits, Foo.Bar)) - fmt.printf("Get(Bar): %v, %v\n", get(bits, Foo.Bar)) - fmt.printf("Set(Negative_Test): %v\n", set(bits, Foo.Negative_Test)) - fmt.printf("Get(Leaves): %v, %v\n", get(bits, Foo.Leaves)) - fmt.printf("Get(Negative_Test): %v, %v\n", get(bits, Foo.Negative_Test)) - fmt.printf("Freed.\n") - } -*/ \ No newline at end of file + fmt.printf("Set(Bar): %v\n", set(bits, Foo.Bar)) + fmt.printf("Get(Bar): %v, %v\n", get(bits, Foo.Bar)) + fmt.printf("Set(Negative_Test): %v\n", set(bits, Foo.Negative_Test)) + fmt.printf("Get(Leaves): %v, %v\n", get(bits, Foo.Leaves)) + fmt.printf("Get(Negative_Test): %v, %v\n", get(bits, Foo.Negative_Test)) + fmt.printf("Freed.\n") + } +*/ +package dynamic_bit_array -- cgit v1.2.3 From 334e08c750a1eac3042b867c0e460b7bc516743e Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 18 Apr 2024 12:17:39 +0100 Subject: Update numerous package declaration names --- core/compress/gzip/example.odin | 2 +- core/compress/gzip/gzip.odin | 2 +- core/compress/shoco/model.odin | 2 +- core/compress/shoco/shoco.odin | 2 +- core/compress/zlib/example.odin | 2 +- core/compress/zlib/zlib.odin | 2 +- core/container/bit_array/bit_array.odin | 2 +- core/container/bit_array/doc.odin | 2 +- core/encoding/base32/base32.odin | 2 +- core/encoding/base64/base64.odin | 2 +- core/encoding/cbor/cbor.odin | 2 +- core/encoding/cbor/coding.odin | 2 +- core/encoding/cbor/doc.odin | 2 +- core/encoding/cbor/marshal.odin | 2 +- core/encoding/cbor/tags.odin | 2 +- core/encoding/cbor/unmarshal.odin | 2 +- core/encoding/csv/reader.odin | 2 +- core/encoding/csv/writer.odin | 2 +- core/encoding/entity/entity.odin | 2 +- core/encoding/entity/generated.odin | 2 +- core/encoding/hex/hex.odin | 2 +- core/encoding/json/marshal.odin | 2 +- core/encoding/json/parser.odin | 2 +- core/encoding/json/tokenizer.odin | 2 +- core/encoding/json/types.odin | 2 +- core/encoding/json/unmarshal.odin | 2 +- core/encoding/json/validator.odin | 2 +- core/encoding/varint/doc.odin | 2 +- core/encoding/varint/leb128.odin | 2 +- core/encoding/xml/debug_print.odin | 2 +- core/encoding/xml/helpers.odin | 2 +- core/encoding/xml/tokenizer.odin | 2 +- core/encoding/xml/xml_reader.odin | 2 +- 33 files changed, 33 insertions(+), 33 deletions(-) (limited to 'core/container/bit_array') diff --git a/core/compress/gzip/example.odin b/core/compress/gzip/example.odin index 635134e40..09540aafc 100644 --- a/core/compress/gzip/example.odin +++ b/core/compress/gzip/example.odin @@ -1,5 +1,5 @@ //+build ignore -package gzip +package compress_gzip /* Copyright 2021 Jeroen van Rijn . diff --git a/core/compress/gzip/gzip.odin b/core/compress/gzip/gzip.odin index 50945fc77..57ed3c3c5 100644 --- a/core/compress/gzip/gzip.odin +++ b/core/compress/gzip/gzip.odin @@ -1,4 +1,4 @@ -package gzip +package compress_gzip /* Copyright 2021 Jeroen van Rijn . diff --git a/core/compress/shoco/model.odin b/core/compress/shoco/model.odin index bbc38903d..f62236c00 100644 --- a/core/compress/shoco/model.odin +++ b/core/compress/shoco/model.odin @@ -5,7 +5,7 @@ */ // package shoco is an implementation of the shoco short string compressor -package shoco +package compress_shoco DEFAULT_MODEL :: Shoco_Model { min_char = 39, diff --git a/core/compress/shoco/shoco.odin b/core/compress/shoco/shoco.odin index e65acb0bc..3c1f412ba 100644 --- a/core/compress/shoco/shoco.odin +++ b/core/compress/shoco/shoco.odin @@ -9,7 +9,7 @@ */ // package shoco is an implementation of the shoco short string compressor -package shoco +package compress_shoco import "base:intrinsics" import "core:compress" diff --git a/core/compress/zlib/example.odin b/core/compress/zlib/example.odin index 19017b279..fedd6671d 100644 --- a/core/compress/zlib/example.odin +++ b/core/compress/zlib/example.odin @@ -1,5 +1,5 @@ //+build ignore -package zlib +package compress_zlib /* Copyright 2021 Jeroen van Rijn . diff --git a/core/compress/zlib/zlib.odin b/core/compress/zlib/zlib.odin index d4dc6e3d7..b7f381f2b 100644 --- a/core/compress/zlib/zlib.odin +++ b/core/compress/zlib/zlib.odin @@ -1,5 +1,5 @@ //+vet !using-param -package zlib +package compress_zlib /* Copyright 2021 Jeroen van Rijn . diff --git a/core/container/bit_array/bit_array.odin b/core/container/bit_array/bit_array.odin index dbd2e0d3a..a8720715c 100644 --- a/core/container/bit_array/bit_array.odin +++ b/core/container/bit_array/bit_array.odin @@ -1,4 +1,4 @@ -package dynamic_bit_array +package container_dynamic_bit_array import "base:intrinsics" import "core:mem" diff --git a/core/container/bit_array/doc.odin b/core/container/bit_array/doc.odin index 371f63f0e..77e1904a8 100644 --- a/core/container/bit_array/doc.odin +++ b/core/container/bit_array/doc.odin @@ -49,4 +49,4 @@ The Bit Array can be used in several ways: fmt.printf("Freed.\n") } */ -package dynamic_bit_array +package container_dynamic_bit_array diff --git a/core/encoding/base32/base32.odin b/core/encoding/base32/base32.odin index 7ab35afd0..962a3ead4 100644 --- a/core/encoding/base32/base32.odin +++ b/core/encoding/base32/base32.odin @@ -1,4 +1,4 @@ -package base32 +package encoding_base32 // @note(zh): Encoding utility for Base32 // A secondary param can be used to supply a custom alphabet to diff --git a/core/encoding/base64/base64.odin b/core/encoding/base64/base64.odin index 535d457d5..1013a7d0b 100644 --- a/core/encoding/base64/base64.odin +++ b/core/encoding/base64/base64.odin @@ -1,4 +1,4 @@ -package base64 +package encoding_base64 import "core:io" import "core:mem" diff --git a/core/encoding/cbor/cbor.odin b/core/encoding/cbor/cbor.odin index 550cf87fd..d0e406ab1 100644 --- a/core/encoding/cbor/cbor.odin +++ b/core/encoding/cbor/cbor.odin @@ -1,4 +1,4 @@ -package cbor +package encoding_cbor import "base:intrinsics" diff --git a/core/encoding/cbor/coding.odin b/core/encoding/cbor/coding.odin index 11db994da..0d276a7a1 100644 --- a/core/encoding/cbor/coding.odin +++ b/core/encoding/cbor/coding.odin @@ -1,4 +1,4 @@ -package cbor +package encoding_cbor import "base:intrinsics" import "base:runtime" diff --git a/core/encoding/cbor/doc.odin b/core/encoding/cbor/doc.odin index 77eac51cb..937b1b61b 100644 --- a/core/encoding/cbor/doc.odin +++ b/core/encoding/cbor/doc.odin @@ -137,5 +137,5 @@ Output: "str": "Hello, World!" } */ -package cbor +package encoding_cbor diff --git a/core/encoding/cbor/marshal.odin b/core/encoding/cbor/marshal.odin index 87e91bbd8..37c9dd180 100644 --- a/core/encoding/cbor/marshal.odin +++ b/core/encoding/cbor/marshal.odin @@ -1,4 +1,4 @@ -package cbor +package encoding_cbor import "base:intrinsics" import "base:runtime" diff --git a/core/encoding/cbor/tags.odin b/core/encoding/cbor/tags.odin index 040ce2458..3dc79a5dd 100644 --- a/core/encoding/cbor/tags.odin +++ b/core/encoding/cbor/tags.odin @@ -1,4 +1,4 @@ -package cbor +package encoding_cbor import "base:runtime" diff --git a/core/encoding/cbor/unmarshal.odin b/core/encoding/cbor/unmarshal.odin index 5480b9125..a1524d9f4 100644 --- a/core/encoding/cbor/unmarshal.odin +++ b/core/encoding/cbor/unmarshal.odin @@ -1,4 +1,4 @@ -package cbor +package encoding_cbor import "base:intrinsics" import "base:runtime" diff --git a/core/encoding/csv/reader.odin b/core/encoding/csv/reader.odin index 44a9fdcc4..22eea9568 100644 --- a/core/encoding/csv/reader.odin +++ b/core/encoding/csv/reader.odin @@ -1,6 +1,6 @@ // package csv reads and writes comma-separated values (CSV) files. // This package supports the format described in RFC 4180 -package csv +package encoding_csv import "core:bufio" import "core:bytes" diff --git a/core/encoding/csv/writer.odin b/core/encoding/csv/writer.odin index d519104f2..46145ecc1 100644 --- a/core/encoding/csv/writer.odin +++ b/core/encoding/csv/writer.odin @@ -1,4 +1,4 @@ -package csv +package encoding_csv import "core:io" import "core:strings" diff --git a/core/encoding/entity/entity.odin b/core/encoding/entity/entity.odin index ec640c69f..cee6230ef 100644 --- a/core/encoding/entity/entity.odin +++ b/core/encoding/entity/entity.odin @@ -1,4 +1,4 @@ -package unicode_entity +package encoding_unicode_entity /* A unicode entity encoder/decoder diff --git a/core/encoding/entity/generated.odin b/core/encoding/entity/generated.odin index 3d1c02513..d2acde20d 100644 --- a/core/encoding/entity/generated.odin +++ b/core/encoding/entity/generated.odin @@ -1,4 +1,4 @@ -package unicode_entity +package encoding_unicode_entity /* ------ GENERATED ------ DO NOT EDIT ------ GENERATED ------ DO NOT EDIT ------ GENERATED ------ diff --git a/core/encoding/hex/hex.odin b/core/encoding/hex/hex.odin index ef0bab1d0..dbffe216b 100644 --- a/core/encoding/hex/hex.odin +++ b/core/encoding/hex/hex.odin @@ -1,4 +1,4 @@ -package hex +package encoding_hex import "core:strings" diff --git a/core/encoding/json/marshal.odin b/core/encoding/json/marshal.odin index 3d57316b3..04ef6d434 100644 --- a/core/encoding/json/marshal.odin +++ b/core/encoding/json/marshal.odin @@ -1,4 +1,4 @@ -package json +package encoding_json import "core:mem" import "core:math/bits" diff --git a/core/encoding/json/parser.odin b/core/encoding/json/parser.odin index 8bcef1339..3973725dc 100644 --- a/core/encoding/json/parser.odin +++ b/core/encoding/json/parser.odin @@ -1,4 +1,4 @@ -package json +package encoding_json import "core:mem" import "core:unicode/utf8" diff --git a/core/encoding/json/tokenizer.odin b/core/encoding/json/tokenizer.odin index a406a73a5..5c20a2cc3 100644 --- a/core/encoding/json/tokenizer.odin +++ b/core/encoding/json/tokenizer.odin @@ -1,4 +1,4 @@ -package json +package encoding_json import "core:unicode/utf8" diff --git a/core/encoding/json/types.odin b/core/encoding/json/types.odin index 20c806236..73e183615 100644 --- a/core/encoding/json/types.odin +++ b/core/encoding/json/types.odin @@ -1,4 +1,4 @@ -package json +package encoding_json import "core:strings" diff --git a/core/encoding/json/unmarshal.odin b/core/encoding/json/unmarshal.odin index b2052e43c..691303521 100644 --- a/core/encoding/json/unmarshal.odin +++ b/core/encoding/json/unmarshal.odin @@ -1,4 +1,4 @@ -package json +package encoding_json import "core:mem" import "core:math" diff --git a/core/encoding/json/validator.odin b/core/encoding/json/validator.odin index 961c2dc23..a6873319d 100644 --- a/core/encoding/json/validator.odin +++ b/core/encoding/json/validator.odin @@ -1,4 +1,4 @@ -package json +package encoding_json import "core:mem" diff --git a/core/encoding/varint/doc.odin b/core/encoding/varint/doc.odin index 5e4708a59..c0a09873c 100644 --- a/core/encoding/varint/doc.odin +++ b/core/encoding/varint/doc.odin @@ -25,4 +25,4 @@ ``` */ -package varint \ No newline at end of file +package encoding_varint \ No newline at end of file diff --git a/core/encoding/varint/leb128.odin b/core/encoding/varint/leb128.odin index 1cdbb81b0..ca6513f04 100644 --- a/core/encoding/varint/leb128.odin +++ b/core/encoding/varint/leb128.odin @@ -8,7 +8,7 @@ // package varint implements variable length integer encoding and decoding using // the LEB128 format as used by DWARF debug info, Android .dex and other file formats. -package varint +package encoding_varint // In theory we should use the bigint package. In practice, varints bigger than this indicate a corrupted file. // Instead we'll set limits on the values we'll encode/decode diff --git a/core/encoding/xml/debug_print.odin b/core/encoding/xml/debug_print.odin index 2607bec23..be958baaa 100644 --- a/core/encoding/xml/debug_print.odin +++ b/core/encoding/xml/debug_print.odin @@ -1,4 +1,4 @@ -package xml +package encoding_xml /* An XML 1.0 / 1.1 parser diff --git a/core/encoding/xml/helpers.odin b/core/encoding/xml/helpers.odin index 42a5258b3..a9d4ad493 100644 --- a/core/encoding/xml/helpers.odin +++ b/core/encoding/xml/helpers.odin @@ -1,4 +1,4 @@ -package xml +package encoding_xml /* An XML 1.0 / 1.1 parser diff --git a/core/encoding/xml/tokenizer.odin b/core/encoding/xml/tokenizer.odin index a223a75d6..0f87c366b 100644 --- a/core/encoding/xml/tokenizer.odin +++ b/core/encoding/xml/tokenizer.odin @@ -1,4 +1,4 @@ -package xml +package encoding_xml /* An XML 1.0 / 1.1 parser diff --git a/core/encoding/xml/xml_reader.odin b/core/encoding/xml/xml_reader.odin index bf8646bc3..5b4b12948 100644 --- a/core/encoding/xml/xml_reader.odin +++ b/core/encoding/xml/xml_reader.odin @@ -24,7 +24,7 @@ MAYBE: List of contributors: - Jeroen van Rijn: Initial implementation. */ -package xml +package encoding_xml // An XML 1.0 / 1.1 parser import "core:bytes" -- cgit v1.2.3