aboutsummaryrefslogtreecommitdiff
path: root/core/c
diff options
context:
space:
mode:
authorMaurizio M. Gavioli <mmg@vistamaresoft.com>2024-04-14 17:18:08 +0200
committerMaurizio M. Gavioli <mmg@vistamaresoft.com>2024-04-14 17:18:08 +0200
commita0cff82320840e4be6d40cee8a2432645773a53e (patch)
treedbb5b972d03b14f636ef0aa120da8075ee906fc0 /core/c
parent21969fec612b78d34f14b60ad761a3c37860b36b (diff)
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.
Diffstat (limited to 'core/c')
-rw-r--r--core/c/frontend/tokenizer/doc.odin55
1 files changed, 26 insertions, 29 deletions
diff --git a/core/c/frontend/tokenizer/doc.odin b/core/c/frontend/tokenizer/doc.odin
index 9b1734fc4..43747dfe8 100644
--- a/core/c/frontend/tokenizer/doc.odin
+++ b/core/c/frontend/tokenizer/doc.odin
@@ -1,34 +1,31 @@
/*
-package demo
-
-import tokenizer "core:c/frontend/tokenizer"
-import preprocessor "core:c/frontend/preprocessor"
-import "core:fmt"
-
-main :: proc() {
- t := &tokenizer.Tokenizer{};
- tokenizer.init_defaults(t);
-
- cpp := &preprocessor.Preprocessor{};
- cpp.warn, cpp.err = t.warn, t.err;
- preprocessor.init_lookup_tables(cpp);
- preprocessor.init_default_macros(cpp);
- cpp.include_paths = {"my/path/to/include"};
-
- tok := tokenizer.tokenize_file(t, "the/source/file.c", 1);
-
- tok = preprocessor.preprocess(cpp, tok);
- if tok != nil {
- for t := tok; t.kind != .EOF; t = t.next {
- fmt.println(t.lit);
+Example:
+ package demo
+
+ import tokenizer "core:c/frontend/tokenizer"
+ import preprocessor "core:c/frontend/preprocessor"
+ import "core:fmt"
+
+ main :: proc() {
+ t := &tokenizer.Tokenizer{};
+ tokenizer.init_defaults(t);
+
+ cpp := &preprocessor.Preprocessor{};
+ cpp.warn, cpp.err = t.warn, t.err;
+ preprocessor.init_lookup_tables(cpp);
+ preprocessor.init_default_macros(cpp);
+ cpp.include_paths = {"my/path/to/include"};
+
+ tok := tokenizer.tokenize_file(t, "the/source/file.c", 1);
+
+ tok = preprocessor.preprocess(cpp, tok);
+ if tok != nil {
+ for t := tok; t.kind != .EOF; t = t.next {
+ fmt.println(t.lit);
+ }
}
- }
- fmt.println("[Done]");
-}
+ fmt.println("[Done]");
+ }
*/
-
-
package c_frontend_tokenizer
-
-