Skip to content

Commit 1dc2392

Browse files
committed
docs, builtin: clean up the homepage of modules.vlang.io a little, do not use //==== comments for now in builtin
1 parent 7f70493 commit 1dc2392

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

vlib/builtin/string_interpolation.v

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ that can be found in the LICENSE file.
1111
This file contains string interpolation V functions
1212
=============================================================================*/
1313

14-
//=============================================================================
15-
// Enum format types max 0x1F => 32 types
16-
//=============================================================================
14+
/*============================================================================
15+
Enum format types max 0x1F => 32 types
16+
=============================================================================*/
1717
pub enum StrIntpType {
1818
si_no_str = 0 // no parameter to print only fix string
1919
si_c
@@ -60,9 +60,7 @@ pub fn (x StrIntpType) str() string {
6060
}
6161
}
6262

63-
//=============================================================================
64-
// Union data
65-
//=============================================================================
63+
// Union data used by StrIntpData
6664
pub union StrIntpMem {
6765
pub mut:
6866
d_c u32
@@ -96,10 +94,7 @@ fn abs64(x i64) u64 {
9694
return if x < 0 { u64(-x) } else { u64(x) }
9795
}
9896

99-
//=========================================
100-
//
10197
// u32/u64 bit compact format
102-
//
10398
//___ 32 24 16 8
10499
//___ | | | |
105100
//_3333333333222222222211111111110000000000
@@ -116,7 +111,7 @@ fn abs64(x i64) u64 {
116111
// P pad char 1/8 bit padding char (in u32 format reduced to 1 bit as flag for `0` padding)
117112
// --------------
118113
// TOTAL: 39/32 bit
119-
//=========================================
114+
//---------------------------------------
120115

121116
// convert from data format to compact u64
122117
pub fn get_str_intp_u64_format(fmt_type StrIntpType, in_width int, in_precision int, in_tail_zeros bool, in_sign bool, in_pad_ch byte, in_base int, in_upper_case bool) u64 {
@@ -639,7 +634,7 @@ fn (data &StrIntpData) process_str_intp_data(mut sb strings.Builder) {
639634
}
640635
}
641636

642-
//====================================================================================
637+
//--------------------------------------------------
643638

644639
// storing struct used by cgen
645640
pub struct StrIntpCgenData {
@@ -680,15 +675,11 @@ pub fn str_intp(data_len int, in_data voidptr) string {
680675
return ret
681676
}
682677

683-
//====================================================================================
684-
// Utility for the compiler "auto_str_methods.v"
685-
//====================================================================================
686-
687-
// substitute old _STR calls
688-
678+
// The consts here are utilities for the compiler's "auto_str_methods.v".
679+
// They are used to substitute old _STR calls.
680+
// FIXME: this const is not released from memory => use a precalculated string const for now.
681+
// si_s_code = "0x" + int(StrIntpType.si_s).hex() // code for a simple string.
689682
pub const (
690-
// BUG: this const is not released from the memory! use a const for now
691-
// si_s_code = "0x" + int(StrIntpType.si_s).hex() // code for a simple string
692683
si_s_code = '0xfe10'
693684
si_g32_code = '0xfe0e'
694685
si_g64_code = '0xfe0f'

0 commit comments

Comments
 (0)