From 30ce22866df62b032da5e1fb39a2e5d1edd9f5c3 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 2 Jul 2025 16:12:03 +0300 Subject: [PATCH] docs: put some more dots in the doc comments of public APIs, found by find_doc_comments_with_no_dots.v --- vlib/json/cjson/cjson_wrapper.c.v | 2 +- vlib/x/json2/encoder.v | 4 ++-- vlib/x/json2/json2.v | 2 +- vlib/x/json2/scanner.v | 2 +- vlib/x/json2/strict/strict.v | 4 ++-- vlib/x/json2/types.v | 11 ++++++----- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/vlib/json/cjson/cjson_wrapper.c.v b/vlib/json/cjson/cjson_wrapper.c.v index 879900f1a9..bf949d0892 100644 --- a/vlib/json/cjson/cjson_wrapper.c.v +++ b/vlib/json/cjson/cjson_wrapper.c.v @@ -107,7 +107,7 @@ fn C.cJSON_free(voidptr) // -// version returns the version of cJSON as a string +// version returns the version of cJSON as a string. pub fn version() string { return unsafe { tos3(&char(C.cJSON_Version())) } } diff --git a/vlib/x/json2/encoder.v b/vlib/x/json2/encoder.v index b270f87c0c..ff1b758827 100644 --- a/vlib/x/json2/encoder.v +++ b/vlib/x/json2/encoder.v @@ -436,8 +436,8 @@ pub fn (f []Any) str() string { return Any(f).json_str() } -// str returns the string representation of the `Any` type. Use the `json_str` method -// if you want to use the escaped str() version of the `Any` type. +// str returns the string representation of the `Any` type. Use the `json_str` method. +// If you want to use the escaped str() version of the `Any` type. pub fn (f Any) str() string { if f is string { return f diff --git a/vlib/x/json2/json2.v b/vlib/x/json2/json2.v index 228816704d..269d7ab996 100644 --- a/vlib/x/json2/json2.v +++ b/vlib/x/json2/json2.v @@ -326,7 +326,7 @@ pub fn (f Any) to_time() !time.Time { } } -// map_from convert a struct to map of Any +// map_from converts a struct to a map of Any. pub fn map_from[T](t T) map[string]Any { mut m := map[string]Any{} $if T is $struct { diff --git a/vlib/x/json2/scanner.v b/vlib/x/json2/scanner.v index 2586331c88..f24db86fe4 100644 --- a/vlib/x/json2/scanner.v +++ b/vlib/x/json2/scanner.v @@ -37,7 +37,7 @@ pub struct Token { col int // the column in the source where the token occurred } -// full_col returns the full column information which includes the length +// full_col returns the full column information which includes the length. pub fn (t Token) full_col() int { return t.col + t.lit.len } diff --git a/vlib/x/json2/strict/strict.v b/vlib/x/json2/strict/strict.v index 94cda3eaf9..74d1464866 100644 --- a/vlib/x/json2/strict/strict.v +++ b/vlib/x/json2/strict/strict.v @@ -21,7 +21,7 @@ pub: superfluous []string } -// strict_check +// strict_check . pub fn strict_check[T](json_data string) StructCheckResult { // REVIEW how performatic is it? $if T is $struct { @@ -112,7 +112,7 @@ fn get_keys_from_[T]() []string { return struct_keys } -// get_keys_from_json +// get_keys_from_json . pub fn get_keys_from_json(tokens []string) []KeyStruct { mut key_structs := []KeyStruct{} diff --git a/vlib/x/json2/types.v b/vlib/x/json2/types.v index f932f8337f..58dd1c386b 100644 --- a/vlib/x/json2/types.v +++ b/vlib/x/json2/types.v @@ -2,7 +2,7 @@ module json2 import time -// `Any` is a sum type that lists the possible types to be decoded and used. +// Any is a sum type that lists the possible types to be decoded and used. // `Any` priority order for numbers: floats -> signed integers -> unsigned integers // `Any` priority order for strings: string -> time.Time pub type Any = []Any @@ -23,21 +23,22 @@ pub type Any = []Any | u8 | Null -// Decodable is an interface, that allows custom implementations for decoding structs from JSON encoded values +// Decodable is an interface, that allows custom implementations for decoding structs from JSON encoded values. pub interface Decodable { from_json(f Any) } -// Decodable is an interface, that allows custom implementations for encoding structs to their string based JSON representations +// Encodable is an interface, that allows custom implementations for encoding structs to their string based JSON representations. pub interface Encodable { json_str() string } -// `Null` struct is a simple representation of the `null` value in JSON. +// Null is a simple representation of the `null` value in JSON. pub struct Null { is_null bool = true } +// null is an instance of the Null type, to ease comparisons with it. pub const null = Null{} // ValueKind enumerates the kinds of possible values of the Any sumtype. @@ -49,7 +50,7 @@ pub enum ValueKind { number } -// str returns the string representation of the specific ValueKind +// str returns the string representation of the specific ValueKind. pub fn (k ValueKind) str() string { return match k { .unknown { 'unknown' }