all: fix typos (#21089)

This commit is contained in:
Turiiya 2024-03-25 11:18:27 +01:00 committed by GitHub
parent 9ad84ddc21
commit f77bb32044
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
193 changed files with 403 additions and 402 deletions

View file

@ -146,7 +146,7 @@
- io: add a `string_reader` submodule (#20893) - io: add a `string_reader` submodule (#20893)
- toml: return an error from toml.parse_file(), when the passed file path does not exist (#20912) - toml: return an error from toml.parse_file(), when the passed file path does not exist (#20912)
- x.json2: fix encoder commas (#20916) - x.json2: fix encoder commas (#20916)
- time: microoptimise the Time formating methods (use custom number->string conversion, instead of string interpolation) (#20917) - time: microoptimise the Time formatting methods (use custom number->string conversion, instead of string interpolation) (#20917)
- x.json2: improve performance of string encoding for unicode special characters and emojis (#20867) - x.json2: improve performance of string encoding for unicode special characters and emojis (#20867)
- x.json2: minor performance improvement, update benchmark recommendations (#20954) - x.json2: minor performance improvement, update benchmark recommendations (#20954)
- os: workaround a `-prod -cc gcc` bug, affecting os.open_file (fix #20923) (related to #20872) (#20960) - os: workaround a `-prod -cc gcc` bug, affecting os.open_file (fix #20923) (related to #20872) (#20960)
@ -168,7 +168,7 @@
- net: remove unused import in tcp_test.v - net: remove unused import in tcp_test.v
- x.vweb: add error, when static directory does not exist (#20455) - x.vweb: add error, when static directory does not exist (#20455)
- net.urllib: fix parsing url error, when querypath is '//' (fix #20476) (#20504) - net.urllib: fix parsing url error, when querypath is '//' (fix #20476) (#20504)
- vweb: unify listen addres from tcp and print (#20448) - vweb: unify listen address from tcp and print (#20448)
- net.unix: make the error messages in unix_test.v more specific (#20537) - net.unix: make the error messages in unix_test.v more specific (#20537)
- vweb: add an optional Context.before_accept_loop/0 method, to make testing easier and more robust (#20538) - vweb: add an optional Context.before_accept_loop/0 method, to make testing easier and more robust (#20538)
- vweb: fix routes without results in vweb_app_test.v (#20548) - vweb: fix routes without results in vweb_app_test.v (#20548)
@ -182,7 +182,7 @@
- x.vweb: add cors middleware (#20713) - x.vweb: add cors middleware (#20713)
- x.vweb: add new sessions module (#20642) - x.vweb: add new sessions module (#20642)
- net: fix non-blocking read/write (#20438) - net: fix non-blocking read/write (#20438)
- net: reduce flakyness of tcp test (#20761) - net: reduce flakiness of tcp test (#20761)
- picoev: renaming, doc (#20567) - picoev: renaming, doc (#20567)
- x.vweb: add full static host support, for urls ending with /folder/ , where the folder backing it, has `index.html` inside (#20784) - x.vweb: add full static host support, for urls ending with /folder/ , where the folder backing it, has `index.html` inside (#20784)
- x.sessions: change session Store interface to use results instead of options (#20796) - x.sessions: change session Store interface to use results instead of options (#20796)
@ -464,7 +464,7 @@
- Fix arrays alias built-in methods call(fix #19896) (#19910) - Fix arrays alias built-in methods call(fix #19896) (#19910)
- Fix generic array initialization (fix #19903) (#19916) - Fix generic array initialization (fix #19903) (#19916)
- Fix option sumtype auto deref (#19919) - Fix option sumtype auto deref (#19919)
- Ast, checker, cgen: fix interface embeded methods call(fix #16496) (#19936) - Ast, checker, cgen: fix interface embedded methods call(fix #16496) (#19936)
- Fix ref and deref when an interface is used as a function parameter (fix #19947) (#19966) - Fix ref and deref when an interface is used as a function parameter (fix #19947) (#19966)
- Fix auto str for interface struct member which implements str method (#19970) - Fix auto str for interface struct member which implements str method (#19970)
- Fix generics call with interface arg (fix #19976) (#20002) - Fix generics call with interface arg (fix #19976) (#20002)
@ -559,7 +559,7 @@
- Fix fn call with option call argument in autofree mode (#19515) - Fix fn call with option call argument in autofree mode (#19515)
- Bring back pascal case check for aliases - Bring back pascal case check for aliases
- C.xx = C.yy aliases - C.xx = C.yy aliases
- Allow casted integeral types in match ranges (#19572) - Allow casted integral types in match ranges (#19572)
- Warn about byte deprecation, when used as a fn parameter (#19629) - Warn about byte deprecation, when used as a fn parameter (#19629)
- Allow size of fixed array to be integral casts (#19663) - Allow size of fixed array to be integral casts (#19663)
- Fix generic array append (#19658) - Fix generic array append (#19658)
@ -631,7 +631,7 @@
- orm: make is_null/is_not_null unary ops; don't bind null in where (#19635) - orm: make is_null/is_not_null unary ops; don't bind null in where (#19635)
#### Database drivers #### Database drivers
- pg: hande C calls, move to .c.v files (#19739) - pg: handle C calls, move to .c.v files (#19739)
#### Native backend #### Native backend
- native: support `-no-builtin` (generate executables < 1KB Linux with `v -no-builtin -b native examples/hello_world.v`) - native: support `-no-builtin` (generate executables < 1KB Linux with `v -no-builtin -b native examples/hello_world.v`)
@ -654,7 +654,7 @@
#### vfmt #### vfmt
- Remove additional line breaks after call_expr before params struct args (#19795) - Remove additional line breaks after call_expr before params struct args (#19795)
- Fix map value aligment when using keys with uft8 symbols (#19689) - Fix map value alignment when using keys with uft8 symbols (#19689)
- Align ternary expressions in const blocks (#19721) - Align ternary expressions in const blocks (#19721)
- Respect range index expressions in match branches (#19684) - Respect range index expressions in match branches (#19684)
- Respect raw strings in `$embed_file(r'/some/path')` expressions (#19753) - Respect raw strings in `$embed_file(r'/some/path')` expressions (#19753)
@ -1021,7 +1021,7 @@ https://github.com/vlang/v/blob/master/changelogs0.x/0.4.md
- Disallow type matching with primitive vars. - Disallow type matching with primitive vars.
- Warning instead of error for unnecessary brackets in if/match. - Warning instead of error for unnecessary brackets in if/match.
- Include import aliases when checking for import duplicates. - Include import aliases when checking for import duplicates.
- Fix infering generic array type in nested call. - Fix inferring generic array type in nested call.
- Allow casted `enum val` and `const` as fixed array size. - Allow casted `enum val` and `const` as fixed array size.
- Disallow multiple return values in const declarations. - Disallow multiple return values in const declarations.
- Fix contains() with array of interfaces. - Fix contains() with array of interfaces.

View file

@ -95,7 +95,7 @@
- Disallow type matching with primitive vars. - Disallow type matching with primitive vars.
- Warning instead of error for unnecessary brackets in if/match. - Warning instead of error for unnecessary brackets in if/match.
- Include import aliases when checking for import duplicates. - Include import aliases when checking for import duplicates.
- Fix infering generic array type in nested call. - Fix inferring generic array type in nested call.
- Allow casted `enum val` and `const` as fixed array size. - Allow casted `enum val` and `const` as fixed array size.
- Disallow multiple return values in const declarations. - Disallow multiple return values in const declarations.
- Fix contains() with array of interfaces. - Fix contains() with array of interfaces.

View file

@ -525,7 +525,7 @@ fn auto_complete_request(args []string) []string {
add_sep := if part == '~' { os.path_separator } else { '' } add_sep := if part == '~' { os.path_separator } else { '' }
part = part.replace_once('~', os.home_dir().trim_right(os.path_separator)) + add_sep part = part.replace_once('~', os.home_dir().trim_right(os.path_separator)) + add_sep
} }
is_abs_path := part.starts_with(os.path_separator) // TODO Windows support for drive prefixes is_abs_path := part.starts_with(os.path_separator) // TODO: Windows support for drive prefixes
if part.ends_with(os.path_separator) || part == '.' || part == '..' { if part.ends_with(os.path_separator) || part == '.' || part == '..' {
// 'v <command>(.*/$|.|..)<tab>' -> output full directory list // 'v <command>(.*/$|.|..)<tab>' -> output full directory list
ls_path = '.' + os.path_separator + part ls_path = '.' + os.path_separator + part

View file

@ -32,7 +32,7 @@ mut:
symbol_name string symbol_name string
platform doc.Platform platform doc.Platform
run_examples bool // `-run-examples` will run all `// Example: assert mod.abc() == y` comments in the processed modules run_examples bool // `-run-examples` will run all `// Example: assert mod.abc() == y` comments in the processed modules
// The options below are useful for generating a more stable HMTL, that is easier to regression test: // The options below are useful for generating a more stable HTML, that is easier to regression test:
html_only_contents bool // `-html-only-contents` will produce only the content of any given page, without styling tags etc. html_only_contents bool // `-html-only-contents` will produce only the content of any given page, without styling tags etc.
html_no_vhash bool // `-html-no-vhash` will remove the version hash from the generated html html_no_vhash bool // `-html-no-vhash` will remove the version hash from the generated html
html_no_assets bool // `-html-no-assets` will not include CSS and JS asset tags in the generated html html_no_assets bool // `-html-no-assets` will not include CSS and JS asset tags in the generated html

View file

@ -712,7 +712,7 @@ fn (mut app App) handle_tap() {
} else if avgy < (m * 9 / 10) + ypad { } else if avgy < (m * 9 / 10) + ypad {
app.new_game() app.new_game()
} else { } else {
// TODO remove and implement an actual way to toggle themes on mobile // TODO: remove and implement an actual way to toggle themes on mobile
} }
} }
} else if app.state == .over { } else if app.state == .over {

View file

@ -59,7 +59,7 @@ pub fn load_texture(file_name string) (gfx.Image, gfx.Sampler) {
buffer := read_bytes_from_file(file_name) buffer := read_bytes_from_file(file_name)
stbi.set_flip_vertically_on_load(true) stbi.set_flip_vertically_on_load(true)
img := stbi.load_from_memory(buffer.data, buffer.len) or { img := stbi.load_from_memory(buffer.data, buffer.len) or {
eprintln('Texure file: [${file_name}] ERROR!') eprintln('Texture file: [${file_name}] ERROR!')
exit(0) exit(0)
} }
sg_img, sg_smp := create_texture(int(img.width), int(img.height), img.data) sg_img, sg_smp := create_texture(int(img.width), int(img.height), img.data)

View file

@ -30,13 +30,13 @@ pub fn read_bytes_from_file(file_path string) []u8 {
$if android { $if android {
path = 'models/' + file_path path = 'models/' + file_path
buffer = os.read_apk_asset(path) or { buffer = os.read_apk_asset(path) or {
eprintln('Texure file: [${path}] NOT FOUND!') eprintln('Texture file: [${path}] NOT FOUND!')
exit(0) exit(0)
} }
} $else { } $else {
path = os.resource_abs_path('assets/models/' + file_path) path = os.resource_abs_path('assets/models/' + file_path)
buffer = os.read_bytes(path) or { buffer = os.read_bytes(path) or {
eprintln('Texure file: [${path}] NOT FOUND!') eprintln('Texture file: [${path}] NOT FOUND!')
exit(0) exit(0)
} }
} }

View file

@ -80,7 +80,7 @@ fn (mut a App) event(e &ui.Event) {
if a.mode != .game { if a.mode != .game {
return return
} }
// TODO mouse movement for real Pong sharks // TODO: mouse movement for real Pong sharks
// a.game.move_player(player_one, 0, -1) // a.game.move_player(player_one, 0, -1)
} }
.key_down { .key_down {
@ -344,7 +344,7 @@ fn (mut g Game) quit() {
} }
fn (mut g Game) draw_big_digit(px f32, py f32, digit int) { fn (mut g Game) draw_big_digit(px f32, py f32, digit int) {
// TODO use draw_line or draw_point to fix tearing with non-monospaced terminal fonts // TODO: use draw_line or draw_point to fix tearing with non-monospaced terminal fonts
mut gfx := g.app.tui mut gfx := g.app.tui
x, y := int(px), int(py) x, y := int(px), int(py)
match digit { match digit {
@ -457,7 +457,7 @@ fn (mut g Game) free() {
g.players.clear() g.players.clear()
} }
// TODO Remove these wrapper functions when we can assign methods as callbacks // TODO: Remove these wrapper functions when we can assign methods as callbacks
fn init(mut app App) { fn init(mut app App) {
app.init() app.init()
} }

View file

@ -320,7 +320,7 @@ fn (mut g Game) get_tetro() {
// g.tetro = g.tetros_cache[idx..idx + tetro_size].clone() // g.tetro = g.tetros_cache[idx..idx + tetro_size].clone()
} }
// TODO mut // TODO: mut
fn (mut g Game) drop_tetro() { fn (mut g Game) drop_tetro() {
for i in 0 .. tetro_size { for i in 0 .. tetro_size {
tetro := g.tetro[i] tetro := g.tetro[i]

View file

@ -221,7 +221,7 @@ fn (mut app App) read_bytes(path string) bool {
pub fn read_bytes_from_file(file_path string) []u8 { pub fn read_bytes_from_file(file_path string) []u8 {
mut buffer := []u8{} mut buffer := []u8{}
buffer = os.read_bytes(file_path) or { buffer = os.read_bytes(file_path) or {
eprintln('ERROR: Texure file: [${file_path}] NOT FOUND.') eprintln('ERROR: Texture file: [${file_path}] NOT FOUND.')
exit(0) exit(0)
} }
return buffer return buffer

View file

@ -69,7 +69,7 @@ pub fn (app &App) create_todo(mut ctx Context, name string) vweb.Result {
// insert the todo into our database // insert the todo into our database
sql app.db { sql app.db {
insert todo into Todo insert todo into Todo
} or { return ctx.server_error('could not insert a new TODO in the datbase') } } or { return ctx.server_error('could not insert a new TODO in the database') }
ctx.created_todo = true ctx.created_todo = true
@ -127,7 +127,7 @@ pub fn (app &App) delete_todo(mut ctx Context, id int) vweb.Result {
fn main() { fn main() {
os.chdir(os.dir(@FILE))! os.chdir(os.dir(@FILE))!
// create a new App instance with a connection to the datbase // create a new App instance with a connection to the database
mut app := &App{ mut app := &App{
db: sqlite.connect('todo.db')! db: sqlite.connect('todo.db')!
} }

View file

@ -102,7 +102,7 @@ typedef struct FONStextIter FONStextIter;
typedef struct FONScontext FONScontext; typedef struct FONScontext FONScontext;
// Contructor and destructor. // Constructor and destructor.
FONS_DEF FONScontext* fonsCreateInternal(FONSparams* params); FONS_DEF FONScontext* fonsCreateInternal(FONSparams* params);
FONS_DEF void fonsDeleteInternal(FONScontext* s); FONS_DEF void fonsDeleteInternal(FONScontext* s);

View file

@ -270,7 +270,7 @@
# include <machine/sys/inline.h> # include <machine/sys/inline.h>
# define AO_compiler_barrier() _Asm_sched_fence() # define AO_compiler_barrier() _Asm_sched_fence()
# else # else
/* FIXME - We do not know how to do this. This is a guess. */ /* FIXME: We do not know how to do this. This is a guess. */
/* And probably a bad one. */ /* And probably a bad one. */
static volatile int AO_barrier_dummy; static volatile int AO_barrier_dummy;
# define AO_compiler_barrier() (void)(AO_barrier_dummy = AO_barrier_dummy) # define AO_compiler_barrier() (void)(AO_barrier_dummy = AO_barrier_dummy)

View file

@ -28976,7 +28976,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void)
in_allocd_block = is_header_found_async(addr); in_allocd_block = is_header_found_async(addr);
# endif # endif
if (!in_allocd_block) { if (!in_allocd_block) {
/* FIXME - We should make sure that we invoke the */ /* FIXME: We should make sure that we invoke the */
/* old handler with the appropriate calling */ /* old handler with the appropriate calling */
/* sequence, which often depends on SA_SIGINFO. */ /* sequence, which often depends on SA_SIGINFO. */

View file

@ -14592,7 +14592,7 @@ _SOKOL_PRIVATE void _sg_wgpu_commit(void) {
_SOKOL_PRIVATE void _sg_wgpu_apply_viewport(int x, int y, int w, int h, bool origin_top_left) { _SOKOL_PRIVATE void _sg_wgpu_apply_viewport(int x, int y, int w, int h, bool origin_top_left) {
SOKOL_ASSERT(_sg.wgpu.pass_enc); SOKOL_ASSERT(_sg.wgpu.pass_enc);
// FIXME FIXME FIXME: CLIPPING THE VIEWPORT HERE IS WRONG!!! // FIXME: CLIPPING THE VIEWPORT HERE IS WRONG!!!
// (but currently required because WebGPU insists that the viewport rectangle must be // (but currently required because WebGPU insists that the viewport rectangle must be
// fully contained inside the framebuffer, but this doesn't make any sense, and also // fully contained inside the framebuffer, but this doesn't make any sense, and also
// isn't required by the backend APIs) // isn't required by the backend APIs)

View file

@ -85,7 +85,7 @@ pub fn merge[T](a []T, b []T) []T {
mut ia := 0 mut ia := 0
mut ib := 0 mut ib := 0
mut j := 0 mut j := 0
// TODO efficient approach to merge_desc where: a[ia] >= b[ib] // TODO: efficient approach to merge_desc where: a[ia] >= b[ib]
for ia < a.len && ib < b.len { for ia < a.len && ib < b.len {
if a[ia] <= b[ib] { if a[ia] <= b[ib] {
m[j] = a[ia] m[j] = a[ia]

View file

@ -156,7 +156,7 @@ fn new_array_from_c_array(len int, cap int, elm_size int, c_array voidptr) array
len: len len: len
cap: cap_ cap: cap_
} }
// TODO Write all memory functions (like memcpy) in V // TODO: Write all memory functions (like memcpy) in V
unsafe { vmemcpy(arr.data, c_array, u64(len) * u64(elm_size)) } unsafe { vmemcpy(arr.data, c_array, u64(len) * u64(elm_size)) }
return arr return arr
} }

View file

@ -82,7 +82,7 @@ fn new_array_from_c_array_noscan(len int, cap int, elm_size int, c_array voidptr
len: len len: len
cap: cap_ cap: cap_
} }
// TODO Write all memory functions (like memcpy) in V // TODO: Write all memory functions (like memcpy) in V
unsafe { vmemcpy(arr.data, c_array, u64(len) * u64(elm_size)) } unsafe { vmemcpy(arr.data, c_array, u64(len) * u64(elm_size)) }
return arr return arr
} }

View file

@ -925,7 +925,7 @@ fn test_i64_sort() {
fn test_sort_index_expr() { fn test_sort_index_expr() {
mut f := [[i64(50), 48], [i64(15)], [i64(1)], [i64(79)], [i64(38)], mut f := [[i64(50), 48], [i64(15)], [i64(1)], [i64(79)], [i64(38)],
[i64(0)], [i64(27)]] [i64(0)], [i64(27)]]
// TODO This currently gives "indexing pointer" error without unsafe // TODO: This currently gives "indexing pointer" error without unsafe
unsafe { unsafe {
f.sort(a[0] < b[0]) f.sort(a[0] < b[0])
} }

View file

@ -67,7 +67,7 @@ fn builtin_init() {
} }
} }
// TODO copypaste from os // TODO: copypaste from os
// we want to be able to use this here without having to `import os` // we want to be able to use this here without having to `import os`
struct ExceptionRecord { struct ExceptionRecord {
pub: pub:

View file

@ -59,7 +59,7 @@ fn C.fputs(str &char, stream &C.FILE) int
fn C.fflush(&C.FILE) int fn C.fflush(&C.FILE) int
// TODO define args in these functions // TODO: define args in these functions
fn C.fseek(stream &C.FILE, offset int, whence int) int fn C.fseek(stream &C.FILE, offset int, whence int) int
fn C.fopen(filename &char, mode &char) &C.FILE fn C.fopen(filename &char, mode &char) &C.FILE

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT license that can be found in the LICENSE file. // Use of this source code is governed by an MIT license that can be found in the LICENSE file.
module builtin module builtin
// TODO implement compile time conditional include // TODO: implement compile time conditional include
// [if !nofloat] // [if !nofloat]
import strconv import strconv

View file

@ -918,7 +918,7 @@ fn test_i64_sort() {
fn test_sort_index_expr() { fn test_sort_index_expr() {
mut f := [[i64(50), 48], [i64(15)], [i64(1)], [i64(79)], [i64(38)], mut f := [[i64(50), 48], [i64(15)], [i64(1)], [i64(79)], [i64(38)],
[i64(0)], [i64(27)]] [i64(0)], [i64(27)]]
// TODO This currently gives "indexing pointer" error without unsafe // TODO: This currently gives "indexing pointer" error without unsafe
unsafe { unsafe {
f.sort(a[0] < b[0]) f.sort(a[0] < b[0])
} }

View file

@ -670,7 +670,7 @@ fn test_repeat() {
assert s2.repeat(5) == s2 assert s2.repeat(5) == s2
assert s2.repeat(1) == s2 assert s2.repeat(1) == s2
assert s2.repeat(0) == s2 assert s2.repeat(0) == s2
// TODO Add test for negative values // TODO: Add test for negative values
} }
fn test_starts_with() { fn test_starts_with() {

View file

@ -40,7 +40,7 @@ fn map_hash_int_8(pkey voidptr) u64 {
// Move all zeros to the end of the array and resize array // Move all zeros to the end of the array and resize array
fn (mut d DenseArray) zeros_to_end() { fn (mut d DenseArray) zeros_to_end() {
// TODO alloca? // TODO: alloca?
mut tmp_value := unsafe { malloc(d.value_bytes) } mut tmp_value := unsafe { malloc(d.value_bytes) }
mut tmp_key := unsafe { malloc(d.key_bytes) } mut tmp_key := unsafe { malloc(d.key_bytes) }
mut count := 0 mut count := 0

View file

@ -271,7 +271,7 @@ fn new_map(key_bytes int, value_bytes int, hash_fn MapHashFn, key_eq_fn MapEqFn,
fn new_map_init(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map { fn new_map_init(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map {
mut out := new_map(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn, free_fn) mut out := new_map(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn, free_fn)
// TODO pre-allocate n slots // TODO: pre-allocate n slots
mut pkey := &u8(keys) mut pkey := &u8(keys)
mut pval := &u8(values) mut pval := &u8(values)
for _ in 0 .. n { for _ in 0 .. n {

View file

@ -98,7 +98,7 @@ fn new_map_noscan_key_value(key_bytes int, value_bytes int, hash_fn MapHashFn, k
fn new_map_init_noscan_key(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map { fn new_map_init_noscan_key(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map {
mut out := new_map_noscan_key(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn, mut out := new_map_noscan_key(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn,
free_fn) free_fn)
// TODO pre-allocate n slots // TODO: pre-allocate n slots
mut pkey := &u8(keys) mut pkey := &u8(keys)
mut pval := &u8(values) mut pval := &u8(values)
for _ in 0 .. n { for _ in 0 .. n {
@ -114,7 +114,7 @@ fn new_map_init_noscan_key(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapClo
fn new_map_init_noscan_value(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map { fn new_map_init_noscan_value(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map {
mut out := new_map_noscan_value(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn, mut out := new_map_noscan_value(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn,
free_fn) free_fn)
// TODO pre-allocate n slots // TODO: pre-allocate n slots
mut pkey := &u8(keys) mut pkey := &u8(keys)
mut pval := &u8(values) mut pval := &u8(values)
for _ in 0 .. n { for _ in 0 .. n {
@ -130,7 +130,7 @@ fn new_map_init_noscan_value(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapC
fn new_map_init_noscan_key_value(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map { fn new_map_init_noscan_key_value(hash_fn MapHashFn, key_eq_fn MapEqFn, clone_fn MapCloneFn, free_fn MapFreeFn, n int, key_bytes int, value_bytes int, keys voidptr, values voidptr) map {
mut out := new_map_noscan_key_value(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn, mut out := new_map_noscan_key_value(key_bytes, value_bytes, hash_fn, key_eq_fn, clone_fn,
free_fn) free_fn)
// TODO pre-allocate n slots // TODO: pre-allocate n slots
mut pkey := &u8(keys) mut pkey := &u8(keys)
mut pval := &u8(values) mut pval := &u8(values)
for _ in 0 .. n { for _ in 0 .. n {

View file

@ -354,7 +354,7 @@ pub fn (s string) replace(rep string, with string) string {
if !s.contains(rep) { if !s.contains(rep) {
return s.clone() return s.clone()
} }
// TODO PERF Allocating ints is expensive. Should be a stack array // TODO: PERF Allocating ints is expensive. Should be a stack array
// Get locations of all reps within this string // Get locations of all reps within this string
mut idxs := []int{cap: s.len / rep.len} mut idxs := []int{cap: s.len / rep.len}
defer { defer {
@ -515,7 +515,7 @@ pub fn (s string) replace_char(rep u8, with u8, repeat int) string {
if s.len == 0 { if s.len == 0 {
return s.clone() return s.clone()
} }
// TODO Allocating ints is expensive. Should be a stack array // TODO: Allocating ints is expensive. Should be a stack array
// - string.replace() // - string.replace()
mut idxs := []int{cap: s.len} mut idxs := []int{cap: s.len}
defer { defer {
@ -575,7 +575,7 @@ pub fn (s string) normalize_tabs(tab_len int) string {
// bool returns `true` if the string equals the word "true" it will return `false` otherwise. // bool returns `true` if the string equals the word "true" it will return `false` otherwise.
@[inline] @[inline]
pub fn (s string) bool() bool { pub fn (s string) bool() bool {
return s == 'true' || s == 't' // TODO t for pg, remove return s == 'true' || s == 't' // TODO: t for pg, remove
} }
// int returns the value of the string as an integer `'1'.int() == 1`. // int returns the value of the string as an integer `'1'.int() == 1`.
@ -1402,7 +1402,7 @@ pub fn (s string) count(substr string) int {
i += substr.len i += substr.len
n++ n++
} }
return 0 // TODO can never get here - v doesn't know that return 0 // TODO: can never get here - v doesn't know that
} }
// contains_u8 returns `true` if the string contains the byte value `x`. // contains_u8 returns `true` if the string contains the byte value `x`.
@ -1497,7 +1497,7 @@ pub fn (s string) ends_with(p string) bool {
} }
// to_lower returns the string in all lowercase characters. // to_lower returns the string in all lowercase characters.
// TODO only works with ASCII // TODO: only works with ASCII
@[direct_array_access] @[direct_array_access]
pub fn (s string) to_lower() string { pub fn (s string) to_lower() string {
unsafe { unsafe {
@ -2102,7 +2102,7 @@ pub fn (s string) before(sub string) string {
// Example: assert '23:34:45.234'.all_before('.') == '23:34:45' // Example: assert '23:34:45.234'.all_before('.') == '23:34:45'
// Example: assert 'abcd'.all_before('.') == 'abcd' // Example: assert 'abcd'.all_before('.') == 'abcd'
pub fn (s string) all_before(sub string) string { pub fn (s string) all_before(sub string) string {
// TODO remove dup method // TODO: remove dup method
pos := s.index_(sub) pos := s.index_(sub)
if pos == -1 { if pos == -1 {
return s.clone() return s.clone()

View file

@ -1111,7 +1111,7 @@ fn test_repeat() {
assert s2.repeat(5) == s2 assert s2.repeat(5) == s2
assert s2.repeat(1) == s2 assert s2.repeat(1) == s2
assert s2.repeat(0) == s2 assert s2.repeat(0) == s2
// TODO Add test for negative values // TODO: Add test for negative values
} }
fn test_starts_with() { fn test_starts_with() {

View file

@ -13,7 +13,7 @@ pub struct Clipboard {
pb voidptr pb voidptr
last_cb_serial i64 last_cb_serial i64
mut: mut:
foo int // TODO remove, for mut hack foo int // TODO: remove, for mut hack
} }
fn C.darwin_new_pasteboard() voidptr fn C.darwin_new_pasteboard() voidptr

View file

@ -60,7 +60,7 @@ pub struct Clipboard {
retry_delay int retry_delay int
mut: mut:
hwnd voidptr hwnd voidptr
foo int // TODO remove foo int // TODO: remove
} }
fn (cb &Clipboard) get_clipboard_lock() bool { fn (cb &Clipboard) get_clipboard_lock() bool {

View file

@ -43,7 +43,7 @@ fn C.XGetSelectionOwner(d &C.Display, a Atom) Window
fn C.XChangeProperty(d &C.Display, requestor Window, property Atom, typ Atom, format int, mode int, data voidptr, nelements int) int fn C.XChangeProperty(d &C.Display, requestor Window, property Atom, typ Atom, format int, mode int, data voidptr, nelements int) int
fn C.XSendEvent(d &C.Display, requestor Window, propogate int, mask i64, event &C.XEvent) fn C.XSendEvent(d &C.Display, requestor Window, propagate int, mask i64, event &C.XEvent)
fn C.XInternAtom(d &C.Display, typ &u8, only_if_exists int) Atom fn C.XInternAtom(d &C.Display, typ &u8, only_if_exists int) Atom

View file

@ -409,7 +409,7 @@ pub fn compress(data []u8, params CompressParams) ![]u8 {
} }
check_zstd(cctx.set_parameter(.zstd_c_compression_level, params.compression_level))! check_zstd(cctx.set_parameter(.zstd_c_compression_level, params.compression_level))!
$if !(tinyc && windows) { $if !(tinyc && windows) {
// TODO: tinyc on windows doesn't support mutiple thread // TODO: tinyc on windows doesn't support multiple thread
check_zstd(cctx.set_parameter(.zstd_c_nb_workers, params.nb_threads))! check_zstd(cctx.set_parameter(.zstd_c_nb_workers, params.nb_threads))!
} }
check_zstd(cctx.set_parameter(.zstd_c_checksum_flag, if params.checksum_flag { 1 } else { 0 }))! check_zstd(cctx.set_parameter(.zstd_c_checksum_flag, if params.checksum_flag { 1 } else { 0 }))!
@ -457,7 +457,7 @@ pub fn new_cctx(params CompressParams) !&ZSTD_CCtx {
} }
check_zstd(cctx.set_parameter(.zstd_c_compression_level, params.compression_level))! check_zstd(cctx.set_parameter(.zstd_c_compression_level, params.compression_level))!
$if !(tinyc && windows) { $if !(tinyc && windows) {
// TODO: tinyc on windows doesn't support mutiple thread // TODO: tinyc on windows doesn't support multiple thread
check_zstd(cctx.set_parameter(.zstd_c_nb_workers, params.nb_threads))! check_zstd(cctx.set_parameter(.zstd_c_nb_workers, params.nb_threads))!
} }
check_zstd(cctx.set_parameter(.zstd_c_checksum_flag, if params.checksum_flag { 1 } else { 0 }))! check_zstd(cctx.set_parameter(.zstd_c_checksum_flag, if params.checksum_flag { 1 } else { 0 }))!

View file

@ -60,7 +60,7 @@ pub fn (ctx &TodoContext) str() string {
return 'context.TODO' return 'context.TODO'
} }
// todo returns an empty Context. Code should use todo when // TODO: returns an empty Context. Code should use todo when
// it's unclear which Context to use or it is not yet available (because the // it's unclear which Context to use or it is not yet available (because the
// surrounding function has not yet been extended to accept a Context // surrounding function has not yet been extended to accept a Context
// parameter). // parameter).

View file

@ -4,7 +4,7 @@ module hmac
import crypto.internal.subtle import crypto.internal.subtle
const ipad = []u8{len: 256, init: 0x36} // TODO is 256 enough?? const ipad = []u8{len: 256, init: 0x36} // TODO: is 256 enough??
const opad = []u8{len: 256, init: 0x5C} const opad = []u8{len: 256, init: 0x5C}
const npad = []u8{len: 256, init: 0} const npad = []u8{len: 256, init: 0}

View file

@ -4,7 +4,7 @@ module datatypes
@[heap] @[heap]
struct BloomFilter[T] { struct BloomFilter[T] {
// TODO V bug // TODO: V bug
hash_func fn (T) u32 = unsafe { nil } // hash function, input [T] , output u32 hash_func fn (T) u32 = unsafe { nil } // hash function, input [T] , output u32
// hash_func fn (T) u32 = empty_cb // hash function, input [T] , output u32 // hash_func fn (T) u32 = empty_cb // hash function, input [T] , output u32
table_size int // every entry is one-bit, packed into `table` table_size int // every entry is one-bit, packed into `table`

View file

@ -99,8 +99,8 @@ fn test_remove_from_bst_one() {
assert bst.in_order_traversal() == [1, 10, 20] assert bst.in_order_traversal() == [1, 10, 20]
} }
// Another test n the remove BST, this remove an intermidia node // Another test n the remove BST, this remove an intermediate node
// that it is a triky operation. // that it is a tricky operation.
fn test_remove_from_bst_two() { fn test_remove_from_bst_two() {
mut bst := BSTree[int]{} mut bst := BSTree[int]{}
assert bst.insert(10) assert bst.insert(10)

View file

@ -199,7 +199,7 @@ fn overhead_for(c &Chunk) usize {
} }
} }
// In order for dlmalloc to efficently manage memory, it needs a way to communicate with the underlying platform. // In order for dlmalloc to efficiently manage memory, it needs a way to communicate with the underlying platform.
// This `Allocator` type provides an interface for this communication. // This `Allocator` type provides an interface for this communication.
// //
// //
@ -954,7 +954,7 @@ fn (mut dl Dlmalloc) malloc_real(size usize) voidptr {
// todo(playXE): Find out why in the world this part of code does not work in // todo(playXE): Find out why in the world this part of code does not work in
// some programs (esp. x.json2). Theoretically disabling this path just // some programs (esp. x.json2). Theoretically disabling this path just
// makes fragmentation a little worser but nothing really bad should happen // makes fragmentation a little worse but nothing really bad should happen
if false && smallbits != 0 { if false && smallbits != 0 {
leftbits := (smallbits << idx) & left_bits(1 << idx) leftbits := (smallbits << idx) & left_bits(1 << idx)
leastbit := least_bit(leftbits) leastbit := least_bit(leftbits)

View file

@ -85,7 +85,7 @@ fn is_marker(data string) (string, string) {
} }
// fix_nl returns the data, if it is empty, or if it ends in \n. // fix_nl returns the data, if it is empty, or if it ends in \n.
// Otherwise it returns data + a final \n addded. // Otherwise it returns data + a final \n added.
fn fix_nl(data string) string { fn fix_nl(data string) string {
if data.len == 0 || data[data.len - 1] == `\n` { if data.len == 0 || data[data.len - 1] == `\n` {
return data return data

View file

@ -321,7 +321,7 @@ fn test_multiple_arguments() {
'-c', '-c',
'3.45', '3.45',
]) ])
// TODO Move to array comparison once it's implemented // TODO: Move to array comparison once it's implemented
// assert fp.int_multi('some-flag', `a`, '') == [2, 3, 5] && // assert fp.int_multi('some-flag', `a`, '') == [2, 3, 5] &&
// fp.string_multi('some-flag', `b`, '') == ['a', 'c', 'b'] && // fp.string_multi('some-flag', `b`, '') == ['a', 'c', 'b'] &&
// fp.float_multi('some-flag', `c`, '') == [1.23, 2.34, 3.45] // fp.float_multi('some-flag', `c`, '') == [1.23, 2.34, 3.45]

View file

@ -234,7 +234,7 @@ pub fn (s &Context) vert_metrics(ascender &f32, descender &f32, lineh &f32) {
C.fonsVertMetrics(s, ascender, descender, lineh) C.fonsVertMetrics(s, ascender, descender, lineh)
} }
// text_iter_init initalizes the text iterator `iter`. // text_iter_init initializes the text iterator `iter`.
@[inline] @[inline]
pub fn (s &Context) text_iter_init(iter &C.FONStextIter, x f32, y f32, str &char, end &char) int { pub fn (s &Context) text_iter_init(iter &C.FONStextIter, x f32, y f32, str &char, end &char) int {
return C.fonsTextIterInit(s, iter, x, y, str, end) return C.fonsTextIterInit(s, iter, x, y, str, end)

View file

@ -1,6 +1,6 @@
module fontstash module fontstash
// Contructor and destructor. // Constructor and destructor.
fn C.fonsCreateInternal(params &C.FONSparams) &C.FONScontext fn C.fonsCreateInternal(params &C.FONSparams) &C.FONScontext
fn C.fonsDeleteInternal(s &C.FONScontext) fn C.fonsDeleteInternal(s &C.FONScontext)

View file

@ -729,7 +729,7 @@ pub fn screen_size() Size {
height: int(C.GetSystemMetrics(C.SM_CYSCREEN)) height: int(C.GetSystemMetrics(C.SM_CYSCREEN))
} }
} }
// TODO linux, etc // TODO: linux, etc
return Size{} return Size{}
} }

View file

@ -100,7 +100,7 @@ gg__Image darwin_create_image(string path_) {
res.path = path_; res.path = path_;
res.ok = true; res.ok = true;
// printf("inited img width=%d\n", res.width) ; // printf("inited img width=%d\n", res.width) ;
// need __brige_retained so that the pointer is not freed by ARC // need __bridge_retained so that the pointer is not freed by ARC
res.data = (__bridge_retained voidptr)(img); res.data = (__bridge_retained voidptr)(img);
return res; return res;
} }

View file

@ -195,7 +195,7 @@ pub fn (mut img Image) update_pixel_data(buf &u8) {
// create_image_with_size creates an `Image` from `file` in the given // create_image_with_size creates an `Image` from `file` in the given
// `width` x `height` dimension. // `width` x `height` dimension.
// //
// TODO copypasta // TODO: copypasta
pub fn (mut ctx Context) create_image_with_size(file string, width int, height int) Image { pub fn (mut ctx Context) create_image_with_size(file string, width int, height int) Image {
if !gfx.is_valid() { if !gfx.is_valid() {
// Sokol is not initialized yet, add stbi object to a queue/cache // Sokol is not initialized yet, add stbi object to a queue/cache
@ -222,7 +222,7 @@ pub fn (mut ctx Context) create_image_with_size(file string, width int, height i
// create_image creates an `Image` from `file`. // create_image creates an `Image` from `file`.
// //
// TODO remove this // TODO: remove this
fn create_image(file string) Image { fn create_image(file string) Image {
if !os.exists(file) { if !os.exists(file) {
println('gg.create_image(): file not found: ${file}') println('gg.create_image(): file not found: ${file}')

View file

@ -191,7 +191,7 @@ pub fn (x Vec4) sum() f32 {
/********************************************************************* /*********************************************************************
* Operators * Operators
*********************************************************************/ *********************************************************************/
// + returns `a` + `b` (corresponding elements are addded) // + returns `a` + `b` (corresponding elements are added)
@[inline] @[inline]
pub fn (a Vec4) + (b Vec4) Vec4 { pub fn (a Vec4) + (b Vec4) Vec4 {
return Vec4{ return Vec4{
@ -236,7 +236,7 @@ pub fn (a Vec4) % (b Vec4) Vec4 {
} }
} }
// mul_vec4 returns a vectore, where the corresponding `x` and `y` elements are multiplied // mul_vec4 returns a vector, where the corresponding `x` and `y` elements are multiplied
@[inline] @[inline]
pub fn (x Vec4) mul_vec4(y Vec4) Vec4 { pub fn (x Vec4) mul_vec4(y Vec4) Vec4 {
return Vec4{ return Vec4{

View file

@ -176,7 +176,7 @@ pub fn (ctx &Context) draw_text2(p DrawTextParams) {
bold: p.bold bold: p.bold
mono: p.mono mono: p.mono
italic: p.italic italic: p.italic
}) // TODO perf once it's the only function to draw text }) // TODO: perf once it's the only function to draw text
} }
// draw_text draws the string in `text_` starting at top-left position `x`,`y`. // draw_text draws the string in `text_` starting at top-left position `x`,`y`.
@ -197,7 +197,7 @@ pub fn (ctx &Context) draw_text(x int, y int, text_ string, cfg gx.TextCfg) {
eprintln('gg: draw_text(): font not initialized') eprintln('gg: draw_text(): font not initialized')
return return
} }
// text := text_.trim_space() // TODO remove/optimize // text := text_.trim_space() // TODO: remove/optimize
// mut text := text_ // mut text := text_
// if text.contains('\t') { // if text.contains('\t') {
// text = text.replace('\t', ' ') // text = text.replace('\t', ' ')
@ -233,7 +233,7 @@ pub fn (ctx &Context) text_width(s string) int {
ctx.ft.fons.text_bounds(0, 0, s, &buf[0]) ctx.ft.fons.text_bounds(0, 0, s, &buf[0])
if s.ends_with(' ') { if s.ends_with(' ') {
return int((buf[2] - buf[0]) / ctx.scale) + return int((buf[2] - buf[0]) / ctx.scale) +
ctx.text_width('i') // TODO fix this in fontstash? ctx.text_width('i') // TODO: fix this in fontstash?
} }
res := int((buf[2] - buf[0]) / ctx.scale) res := int((buf[2] - buf[0]) / ctx.scale)
// println('TW "$s" = $res') // println('TW "$s" = $res')

View file

@ -9,7 +9,7 @@
// currently the C version performs slightly better // currently the C version performs slightly better
// because it uses 128 bit int when available and // because it uses 128 bit int when available and
// branch prediction hints. the C version will be // branch prediction hints. the C version will be
// removed once the perfomance is matched. // removed once the performance is matched.
// you can test performance by running: // you can test performance by running:
// `v run cmd/tools/bench/wyhash.v` // `v run cmd/tools/bench/wyhash.v`
// try running with and without the `-prod` flag // try running with and without the `-prod` flag

View file

@ -27,7 +27,7 @@ mut:
salary f32 salary f32
title JobTitle @[json: 'ETitle'] // the key for this field will be 'ETitle', not 'title' title JobTitle @[json: 'ETitle'] // the key for this field will be 'ETitle', not 'title'
notes string @[omitempty] // the JSON property is not created if the string is equal to '' (an empty string). notes string @[omitempty] // the JSON property is not created if the string is equal to '' (an empty string).
// TODO document @[raw] // TODO: document @[raw]
} }
fn main() { fn main() {

View file

@ -324,7 +324,7 @@ fn test_nested_type() {
assert data2.users[key].last_name == user.last_name assert data2.users[key].last_name == user.last_name
assert data2.users[key].is_registered == user.is_registered assert data2.users[key].is_registered == user.is_registered
assert data2.users[key].typ == user.typ assert data2.users[key].typ == user.typ
// assert data2.users[key].pets == user.pets // TODO FIX // assert data2.users[key].pets == user.pets // TODO: FIX
} }
for k, v in data.extra { for k, v in data.extra {
for k2, v2 in v { for k2, v2 in v {

View file

@ -153,7 +153,7 @@ pub fn delete(url string) !Response {
return fetch(method: .delete, url: url) return fetch(method: .delete, url: url)
} }
// TODO - @[noinline] attribut is used for temporary fix the 'get_text()' intermittent segfault / nil value when compiling with GCC 13.2.x and -prod option ( Issue #20506 ) // TODO: @[noinline] attribute is used for temporary fix the 'get_text()' intermittent segfault / nil value when compiling with GCC 13.2.x and -prod option ( Issue #20506 )
// fetch sends an HTTP request to the `url` with the given method and configuration. // fetch sends an HTTP request to the `url` with the given method and configuration.
@[noinline] @[noinline]
pub fn fetch(config FetchConfig) !Response { pub fn fetch(config FetchConfig) !Response {

View file

@ -92,7 +92,7 @@ fn (pr &HttpProxy) http_do(host urllib.URL, method Method, path string, req &Req
mut client := pr.ssl_dial('${host.host}:443')! mut client := pr.ssl_dial('${host.host}:443')!
$if windows { $if windows {
return error('Windows Not SUPPORTED') // todo windows ssl return error('Windows Not SUPPORTED') // TODO: windows ssl
// response_text := req.do_request(req.build_request_headers(req.method, host_name, // response_text := req.do_request(req.build_request_headers(req.method, host_name,
// path))! // path))!
// client.shutdown()! // client.shutdown()!

View file

@ -218,7 +218,7 @@ fn (req &Request) http_do(host string, method Method, path string) !Response {
mut client := net.dial_tcp(host)! mut client := net.dial_tcp(host)!
client.set_read_timeout(req.read_timeout) client.set_read_timeout(req.read_timeout)
client.set_write_timeout(req.write_timeout) client.set_write_timeout(req.write_timeout)
// TODO this really needs to be exposed somehow // TODO: this really needs to be exposed somehow
client.write(s.bytes())! client.write(s.bytes())!
$if trace_http_request ? { $if trace_http_request ? {
eprintln('> ${s}') eprintln('> ${s}')

View file

@ -345,7 +345,7 @@ pub fn (mut s SSLConn) write_ptr(bytes &u8, len int) !int {
$if trace_ssl ? { $if trace_ssl ? {
eprintln('${@METHOD} ---> res: ssl write on closed connection .ssl_error_zero_return') eprintln('${@METHOD} ---> res: ssl write on closed connection .ssl_error_zero_return')
} }
return error('ssl write on closed connection') // Todo error_with_code close return error('ssl write on closed connection') // TODO: error_with_code close
} }
$if trace_ssl ? { $if trace_ssl ? {
eprintln('${@METHOD} ---> res: could not write SSL, err_res: ${err_res}') eprintln('${@METHOD} ---> res: could not write SSL, err_res: ${err_res}')

View file

@ -92,7 +92,7 @@ fn handshake(mut con net.TcpConn, host string, username string, password string)
} else if address.contains_only(':1234567890abcdf') { } else if address.contains_only(':1234567890abcdf') {
// v << addr_type_ipv6 // v << addr_type_ipv6
// v << parse_ipv4(address)! // v << parse_ipv4(address)!
// todo support ipv6 // TODO: support ipv6
} else { // domain } else { // domain
if address.len > 255 { if address.len > 255 {
return error('${address} is too long') return error('${address} is too long')

View file

@ -547,7 +547,7 @@ fn (mut s TcpSocket) set_option(level int, opt int, value int) ! {
} }
pub fn (mut s TcpSocket) set_option_bool(opt SocketOption, value bool) ! { pub fn (mut s TcpSocket) set_option_bool(opt SocketOption, value bool) ! {
// TODO reenable when this `in` operation works again // TODO: reenable when this `in` operation works again
// if opt !in opts_can_set { // if opt !in opts_can_set {
// return err_option_not_settable // return err_option_not_settable
// } // }

View file

@ -252,7 +252,7 @@ fn new_udp_socket_for_remote(raddr Addr) !&UdpSocket {
} }
pub fn (mut s UdpSocket) set_option_bool(opt SocketOption, value bool) ! { pub fn (mut s UdpSocket) set_option_bool(opt SocketOption, value bool) ! {
// TODO reenable when this `in` operation works again // TODO: reenable when this `in` operation works again
// if opt !in opts_can_set { // if opt !in opts_can_set {
// return err_option_not_settable // return err_option_not_settable
// } // }

View file

@ -191,7 +191,7 @@ pub fn (c &StreamConn) write_timeout() time.Duration {
return c.write_timeout return c.write_timeout
} }
// set_write_timout sets the write timeout // set_write_timeout sets the write timeout
pub fn (mut c StreamConn) set_write_timeout(t time.Duration) { pub fn (mut c StreamConn) set_write_timeout(t time.Duration) {
c.write_timeout = t c.write_timeout = t
} }

View file

@ -209,7 +209,7 @@ fn unescape(s_ string, mode EncodingMode) !string {
} }
} }
if n == 0 && !has_plus { if n == 0 && !has_plus {
return '${s}' // TODO `return s` once an autofree bug is fixed return '${s}' // TODO: `return s` once an autofree bug is fixed
} }
if s.len < 2 * n { if s.len < 2 * n {
return error(error_msg('unescape: invalid escape sequence', '')) return error(error_msg('unescape: invalid escape sequence', ''))
@ -751,7 +751,7 @@ pub fn (u URL) str() string {
// path reference. // path reference.
i := path.index_u8(`:`) i := path.index_u8(`:`)
if i > -1 { if i > -1 {
// TODO remove this when autofree handles tmp // TODO: remove this when autofree handles tmp
// expressions like this // expressions like this
if i > -1 && path[..i].index_u8(`/`) == -1 { if i > -1 && path[..i].index_u8(`/`) == -1 {
buf.write_string('./') buf.write_string('./')

View file

@ -291,7 +291,7 @@ pub fn (mut f File) writeln(s string) !int {
} }
} }
*/ */
// TODO perf // TODO: perf
written := int(C.fwrite(s.str, 1, s.len, f.cfile)) written := int(C.fwrite(s.str, 1, s.len, f.cfile))
if written == 0 && s.len != 0 { if written == 0 && s.len != 0 {
return error('0 bytes written') return error('0 bytes written')
@ -751,7 +751,7 @@ pub fn (mut f File) write_struct_at[T](t &T, pos u64) ! {
} }
} }
// TODO `write_raw[_at]` implementations are copy-pasted from `write_struct[_at]` // TODO: `write_raw[_at]` implementations are copy-pasted from `write_struct[_at]`
// write_raw writes a single instance of type `T` // write_raw writes a single instance of type `T`
pub fn (mut f File) write_raw[T](t &T) ! { pub fn (mut f File) write_raw[T](t &T) ! {

View file

@ -84,7 +84,7 @@ fn test_read_bytes_into_newline_text() {
// This test simulates the scenario when a byte stream is read and a newline byte // This test simulates the scenario when a byte stream is read and a newline byte
// appears in that stream and an EOF occurs before the buffer is full. // appears in that stream and an EOF occurs before the buffer is full.
fn test_read_bytes_into_newline_binary() { fn test_read_bytes_into_newline_binary() {
os.rm(tfile) or {} // FIXME This is a workaround for macos, because the file isn't truncated when open with 'w' os.rm(tfile) or {} // FIXME: This is a workaround for macos, because the file isn't truncated when open with 'w'
mut bw := []u8{len: 15} mut bw := []u8{len: 15}
bw[9] = 0xff bw[9] = 0xff
bw[12] = 10 // newline bw[12] = 10 // newline
@ -179,7 +179,7 @@ fn test_read_eof_last_read_full_buffer_fill() {
} }
fn test_write_struct() { fn test_write_struct() {
os.rm(tfile) or {} // FIXME This is a workaround for macos, because the file isn't truncated when open with 'w' os.rm(tfile) or {} // FIXME: This is a workaround for macos, because the file isn't truncated when open with 'w'
size_of_point := int(sizeof(Point)) size_of_point := int(sizeof(Point))
mut f := os.open_file(tfile, 'w')! mut f := os.open_file(tfile, 'w')!
f.write_struct(another_point)! f.write_struct(another_point)!
@ -234,7 +234,7 @@ fn test_read_struct_at() {
} }
fn test_write_raw() { fn test_write_raw() {
os.rm(tfile) or {} // FIXME This is a workaround for macos, because the file isn't truncated when open with 'w' os.rm(tfile) or {} // FIXME: This is a workaround for macos, because the file isn't truncated when open with 'w'
size_of_point := int(sizeof(Point)) size_of_point := int(sizeof(Point))
mut f := os.open_file(tfile, 'w')! mut f := os.open_file(tfile, 'w')!
f.write_raw(another_point)! f.write_raw(another_point)!

View file

@ -60,7 +60,7 @@ pub fn (m FileMode) bitmask() u32 {
// inode returns the metadata of the file/inode, containing inode type, permission information, size and modification time. // inode returns the metadata of the file/inode, containing inode type, permission information, size and modification time.
// it supports windows for regular files, but it doesn't matter if you use owner, group or others when checking permissions on windows. // it supports windows for regular files, but it doesn't matter if you use owner, group or others when checking permissions on windows.
// if a symlink is targetted, it returns info on the link, not the target // if a symlink is targeted, it returns info on the link, not the target
pub fn inode(path string) FileInfo { pub fn inode(path string) FileInfo {
attr := lstat(path) or { Stat{} } attr := lstat(path) or { Stat{} }
fm := attr.get_mode() fm := attr.get_mode()

View file

@ -239,7 +239,7 @@ pub fn cp(src string, dst string) ! {
return error_with_code('cp (permission): failed to write to ${dst} (fp_to: ${fp_to})', return error_with_code('cp (permission): failed to write to ${dst} (fp_to: ${fp_to})',
int(fp_to)) int(fp_to))
} }
// TODO use defer{} to close files in case of error or return. // TODO: use defer{} to close files in case of error or return.
// Currently there is a C-Error when building. // Currently there is a C-Error when building.
mut buf := [1024]u8{} mut buf := [1024]u8{}
mut count := 0 mut count := 0
@ -351,7 +351,7 @@ fn vpclose(f voidptr) int {
// system works like `exec`, but only returns a return code. // system works like `exec`, but only returns a return code.
pub fn system(cmd string) int { pub fn system(cmd string) int {
// if cmd.contains(';') || cmd.contains('&&') || cmd.contains('||') || cmd.contains('\n') { // if cmd.contains(';') || cmd.contains('&&') || cmd.contains('||') || cmd.contains('\n') {
// TODO remove panic // TODO: remove panic
// panic(';, &&, || and \\n are not allowed in shell commands') // panic(';, &&, || and \\n are not allowed in shell commands')
// } // }
mut ret := 0 mut ret := 0

View file

@ -173,7 +173,7 @@ pub fn sigint_to_signal_name(si int) string {
$if linux { $if linux {
// From `man 7 signal` on linux: // From `man 7 signal` on linux:
match si { match si {
// TODO dependent on platform // TODO: dependent on platform
// works only on x86/ARM/most others // works only on x86/ARM/most others
10 { // , 30, 16 10 { // , 30, 16
return 'SIGUSR1' return 'SIGUSR1'
@ -780,7 +780,7 @@ pub fn temp_dir() string {
mut path := getenv('TMPDIR') mut path := getenv('TMPDIR')
$if windows { $if windows {
if path == '' { if path == '' {
// TODO see Qt's implementation? // TODO: see Qt's implementation?
// https://doc.qt.io/qt-5/qdir.html#tempPath // https://doc.qt.io/qt-5/qdir.html#tempPath
// https://github.com/qt/qtbase/blob/e164d61ca8263fc4b46fdd916e1ea77c7dd2b735/src/corelib/io/qfilesystemengine_win.cpp#L1275 // https://github.com/qt/qtbase/blob/e164d61ca8263fc4b46fdd916e1ea77c7dd2b735/src/corelib/io/qfilesystemengine_win.cpp#L1275
path = getenv('TEMP') path = getenv('TEMP')
@ -798,7 +798,7 @@ pub fn temp_dir() string {
return '/tmp' return '/tmp'
} }
$if android { $if android {
// TODO test+use '/data/local/tmp' on Android before using cache_dir() // TODO: test+use '/data/local/tmp' on Android before using cache_dir()
if path == '' { if path == '' {
path = cache_dir() path = cache_dir()
} }

View file

@ -239,7 +239,7 @@ pub fn get_module_filename(handle HANDLE) !string {
} }
} }
} }
panic('this should be unreachable') // TODO remove unreachable after loop panic('this should be unreachable') // TODO: remove unreachable after loop
} }
// Ref - https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-FormatMessageWa#parameters // Ref - https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-FormatMessageWa#parameters

View file

@ -316,7 +316,7 @@ pub fn (mut rng PRNG) f64_in_range(min f64, max f64) !f64 {
return min + rng.f64n(max - min)! return min + rng.f64n(max - min)!
} }
// ulid generates an Unique Lexicographically sortable IDentifier. // ulid generates an unique lexicographically sortable identifier.
// See https://github.com/ulid/spec . // See https://github.com/ulid/spec .
// Note: ULIDs can leak timing information, if you make them public, because // Note: ULIDs can leak timing information, if you make them public, because
// you can infer the rate at which some resource is being created, like // you can infer the rate at which some resource is being created, like
@ -661,7 +661,7 @@ const english_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
const hex_chars = 'abcdef0123456789' const hex_chars = 'abcdef0123456789'
const ascii_chars = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\^_`abcdefghijklmnopqrstuvwxyz{|}~' const ascii_chars = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\^_`abcdefghijklmnopqrstuvwxyz{|}~'
// ulid generates an Unique Lexicographically sortable IDentifier. // ulid generates an unique lexicographically sortable identifier.
// See https://github.com/ulid/spec . // See https://github.com/ulid/spec .
// Note: ULIDs can leak timing information, if you make them public, because // Note: ULIDs can leak timing information, if you make them public, because
// you can infer the rate at which some resource is being created, like // you can infer the rate at which some resource is being created, like

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT license // Use of this source code is governed by an MIT license
// that can be found in the LICENSE file. // that can be found in the LICENSE file.
// //
// TODO Mac version needs to be implemented // TODO: Mac version needs to be implemented
// Will serve as more advanced input method // Will serve as more advanced input method
// based on the work of https://github.com/AmokHuginnsson/replxx // based on the work of https://github.com/AmokHuginnsson/replxx
// //

View file

@ -27,7 +27,7 @@ enum Action {
delete_line delete_line
move_cursor_left move_cursor_left
move_cursor_right move_cursor_right
move_cursor_begining move_cursor_start
move_cursor_end move_cursor_end
move_cursor_word_left move_cursor_word_left
move_cursor_word_right move_cursor_word_right
@ -206,7 +206,7 @@ fn (mut r Readline) analyse(c int) Action {
return .delete_word_left return .delete_word_left
} // CTRL + W } // CTRL + W
1 { 1 {
return .move_cursor_begining return .move_cursor_start
} // ^A } // ^A
5 { 5 {
return .move_cursor_end return .move_cursor_end
@ -235,7 +235,7 @@ fn (r Readline) analyse_control() Action {
`D` { return .move_cursor_left } `D` { return .move_cursor_left }
`B` { return .history_next } `B` { return .history_next }
`A` { return .history_previous } `A` { return .history_previous }
`H` { return .move_cursor_begining } `H` { return .move_cursor_start }
`F` { return .move_cursor_end } `F` { return .move_cursor_end }
`1` { return r.analyse_extended_control() } `1` { return r.analyse_extended_control() }
`2`, `3` { return r.analyse_extended_control_no_eat(u8(sequence)) } `2`, `3` { return r.analyse_extended_control_no_eat(u8(sequence)) }
@ -296,7 +296,7 @@ fn (mut r Readline) execute(a Action, c int) bool {
.delete_word_left { r.delete_word_left() } .delete_word_left { r.delete_word_left() }
.move_cursor_left { r.move_cursor_left() } .move_cursor_left { r.move_cursor_left() }
.move_cursor_right { r.move_cursor_right() } .move_cursor_right { r.move_cursor_right() }
.move_cursor_begining { r.move_cursor_begining() } .move_cursor_start { r.move_cursor_start() }
.move_cursor_end { r.move_cursor_end() } .move_cursor_end { r.move_cursor_end() }
.move_cursor_word_left { r.move_cursor_word_left() } .move_cursor_word_left { r.move_cursor_word_left() }
.move_cursor_word_right { r.move_cursor_word_right() } .move_cursor_word_right { r.move_cursor_word_right() }
@ -505,8 +505,8 @@ fn (mut r Readline) move_cursor_right() {
} }
} }
// move_cursor_begining moves the cursor to the beginning of the current line. // move_cursor_start moves the cursor to the beginning of the current line.
fn (mut r Readline) move_cursor_begining() { fn (mut r Readline) move_cursor_start() {
r.cursor = 0 r.cursor = 0
r.refresh_line() r.refresh_line()
} }

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT license // Use of this source code is governed by an MIT license
// that can be found in the LICENSE file. // that can be found in the LICENSE file.
// //
// TODO Windows version needs to be implemented. // TODO: Windows version needs to be implemented.
// Will serve as more advanced input method // Will serve as more advanced input method
// based on the work of https://github.com/AmokHuginnsson/replxx // based on the work of https://github.com/AmokHuginnsson/replxx
// //

View file

@ -50,7 +50,7 @@ pub fn from(input string) !Version {
// build returns a `Version` structure with given `major`, `minor` and `patch` versions. // build returns a `Version` structure with given `major`, `minor` and `patch` versions.
pub fn build(major int, minor int, patch int) Version { pub fn build(major int, minor int, patch int) Version {
// TODO Check if versions are greater than zero. // TODO: Check if versions are greater than zero.
return Version{major, minor, patch, '', ''} return Version{major, minor, patch, '', ''}
} }

View file

@ -59,7 +59,7 @@ $if emscripten ? {
// for simplicity, all header includes are here because import order matters and we dont have any way // for simplicity, all header includes are here because import order matters and we dont have any way
// to ensure import order with V yet // to ensure import order with V yet
#define SOKOL_IMPL #define SOKOL_IMPL
// TODO should not be defined for android graphic (apk/aab using sokol) builds, but we have no ways to undefine // TODO: should not be defined for android graphic (apk/aab using sokol) builds, but we have no ways to undefine
//#define SOKOL_NO_ENTRY //#define SOKOL_NO_ENTRY
#flag linux -DSOKOL_NO_ENTRY #flag linux -DSOKOL_NO_ENTRY
#flag darwin -DSOKOL_NO_ENTRY #flag darwin -DSOKOL_NO_ENTRY
@ -68,7 +68,7 @@ $if emscripten ? {
#flag freebsd -DSOKOL_NO_ENTRY #flag freebsd -DSOKOL_NO_ENTRY
#flag openbsd -DSOKOL_NO_ENTRY #flag openbsd -DSOKOL_NO_ENTRY
#flag solaris -DSOKOL_NO_ENTRY #flag solaris -DSOKOL_NO_ENTRY
// TODO end // TODO: end
#flag linux -ldl #flag linux -ldl

View file

@ -186,7 +186,7 @@ pub fn cancel_quit() {
C.sapp_cancel_quit() C.sapp_cancel_quit()
} }
// intiate a "hard quit" (quit application without sending SAPP_EVENTTYPE_QUIT_REQUSTED) // initiate a "hard quit" (quit application without sending SAPP_EVENTTYPE_QUIT_REQUESTED)
@[inline] @[inline]
pub fn quit() { pub fn quit() {
C.sapp_quit() C.sapp_quit()

View file

@ -65,7 +65,7 @@ fn C.sapp_request_quit()
// cancel a pending quit (when SAPP_EVENTTYPE_QUIT_REQUESTED has been received) // cancel a pending quit (when SAPP_EVENTTYPE_QUIT_REQUESTED has been received)
fn C.sapp_cancel_quit() fn C.sapp_cancel_quit()
// intiate a "hard quit" (quit application without sending SAPP_EVENTTYPE_QUIT_REQUSTED) // intiate a "hard quit" (quit application without sending SAPP_EVENTTYPE_QUIT_REQUESTED)
fn C.sapp_quit() fn C.sapp_quit()
// call from inside event callback to consume the current event (don't forward to platform) // call from inside event callback to consume the current event (don't forward to platform)

View file

@ -117,7 +117,7 @@ enum ParserState {
} }
// parser tries to parse the given string into a number // parser tries to parse the given string into a number
// NOTE: #TOFIX need one char after the last char of the number // FIXME: need one char after the last char of the number
@[direct_array_access] @[direct_array_access]
fn parser(s string) (ParserState, PrepNumber) { fn parser(s string) (ParserState, PrepNumber) {
mut digx := 0 mut digx := 0

View file

@ -54,7 +54,7 @@ fn test_atof() {
} }
// check conversion case 2 string <==> f64 // check conversion case 2 string <==> f64
// we don't test atof_quick beacuse we already know the rounding error // we don't test atof_quick because we already know the rounding error
for c, x in src_num_str { for c, x in src_num_str {
b := src_num[c].strlong() b := src_num[c].strlong()
value := strconv.atof64(x) or { panic(err) } value := strconv.atof64(x) or { panic(err) }

View file

@ -459,7 +459,7 @@ pub fn format_es(f f64, p BF_param) string {
} }
} }
// remove_tail_zeros strips traling zeros from `s` and return the resulting `string`. // remove_tail_zeros strips trailing zeros from `s` and return the resulting `string`.
@[direct_array_access] @[direct_array_access]
pub fn remove_tail_zeros(s string) string { pub fn remove_tail_zeros(s string) string {
unsafe { unsafe {

View file

@ -22,7 +22,7 @@ enum Char_parse_state {
reset_params reset_params
} }
// v_printf prints a sprintf-like formated `string` to the terminal. // v_printf prints a sprintf-like formatted `string` to the terminal.
// The format string `str` can be constructed at runtime. // The format string `str` can be constructed at runtime.
// Note, that this function is unsafe. // Note, that this function is unsafe.
// In most cases, you are better off using V's string interpolation, // In most cases, you are better off using V's string interpolation,
@ -32,7 +32,7 @@ pub fn v_printf(str string, pt ...voidptr) {
print(unsafe { v_sprintf(str, ...pt) }) print(unsafe { v_sprintf(str, ...pt) })
} }
// v_sprintf returns a sprintf-like formated `string`. // v_sprintf returns a sprintf-like formatted `string`.
// The format string `str` can be constructed at runtime. // The format string `str` can be constructed at runtime.
// Note, that this function is unsafe. // Note, that this function is unsafe.
// In most cases, you are better off using V's string interpolation, // In most cases, you are better off using V's string interpolation,
@ -249,7 +249,7 @@ pub fn v_sprintf(str string, pt ...voidptr) string {
// println("$ch1 $ch2") // println("$ch1 $ch2")
match ch1 { match ch1 {
// h for 16 bit int // h for 16 bit int
// hh fot 8 bit int // hh for 8 bit int
`h` { `h` {
if ch2 == `h` { if ch2 == `h` {
v_sprintf_panic(p_index, pt.len) v_sprintf_panic(p_index, pt.len)
@ -316,7 +316,7 @@ pub fn v_sprintf(str string, pt ...voidptr) string {
v_sprintf_panic(p_index, pt.len) v_sprintf_panic(p_index, pt.len)
match ch1 { match ch1 {
// h for 16 bit unsigned int // h for 16 bit unsigned int
// hh fot 8 bit unsigned int // hh for 8 bit unsigned int
`h` { `h` {
if ch2 == `h` { if ch2 == `h` {
d1 = u64(unsafe { *(&u8(pt[p_index])) }) d1 = u64(unsafe { *(&u8(pt[p_index])) })

View file

@ -44,7 +44,7 @@ fn do_rec_f64(ch chan f64, sumch chan f64) {
fn test_select() { fn test_select() {
ch1 := chan int{cap: 3} ch1 := chan int{cap: 3}
ch2 := chan int{} ch2 := chan int{}
// buffer length of chf1 mus be mutiple of 3 (# select threads) // buffer length of chf1 mus be multiple of 3 (# select threads)
chf1 := chan f64{cap: 30} chf1 := chan f64{cap: 30}
chf2 := chan f64{} chf2 := chan f64{}
chsum1 := chan i64{} chsum1 := chan i64{}

View file

@ -63,7 +63,7 @@ fn test_try_lock_rwmutex() {
assert try_fail_writing2 == false assert try_fail_writing2 == false
mx.runlock() mx.runlock()
mx.runlock() // you must release rlock mutiple times, as it was rlocked multiple times mx.runlock() // you must release rlock multiple times, as it was rlocked multiple times
// after mx release all rlock, try_wlock will succeed // after mx release all rlock, try_wlock will succeed
try_success_writing3 := mx.try_wlock() try_success_writing3 := mx.try_wlock()

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT license // Use of this source code is governed by an MIT license
// that can be found in the LICENSE file. // that can be found in the LICENSE file.
// //
// TODO Windows version needs to be implemented. // TODO: Windows version needs to be implemented.
// Will serve as more advanced input method // Will serve as more advanced input method
// based on the work of https://github.com/AmokHuginnsson/replxx // based on the work of https://github.com/AmokHuginnsson/replxx
// //

View file

@ -264,7 +264,7 @@ pub fn (t Time) md() string {
return t.get_fmt_date_str(.space, .mmmd) return t.get_fmt_date_str(.space, .mmmd)
} }
// TODO test, improve performance // TODO: test, improve performance
// appends ordinal suffix to a number // appends ordinal suffix to a number
fn ordinal_suffix(n int) string { fn ordinal_suffix(n int) string {
if n > 3 && n < 21 { if n > 3 && n < 21 {
@ -481,11 +481,11 @@ pub fn (t Time) custom_format(s string) string {
sb.write_string('${t.day_of_week() + 1}') sb.write_string('${t.day_of_week() + 1}')
} }
'N' { 'N' {
// TODO integrate BC // TODO: integrate BC
sb.write_string('AD') sb.write_string('AD')
} }
'NN' { 'NN' {
// TODO integrate Before Christ // TODO: integrate Before Christ
sb.write_string('Anno Domini') sb.write_string('Anno Domini')
} }
'Z' { 'Z' {
@ -498,7 +498,7 @@ pub fn (t Time) custom_format(s string) string {
} }
} }
'ZZ' { 'ZZ' {
// TODO update if minute differs? // TODO: update if minute differs?
mut hours := offset() / seconds_per_hour mut hours := offset() / seconds_per_hour
if hours >= 0 { if hours >= 0 {
sb.write_string('+${hours:02}00') sb.write_string('+${hours:02}00')
@ -508,7 +508,7 @@ pub fn (t Time) custom_format(s string) string {
} }
} }
'ZZZ' { 'ZZZ' {
// TODO update if minute differs? // TODO: update if minute differs?
mut hours := offset() / seconds_per_hour mut hours := offset() / seconds_per_hour
if hours >= 0 { if hours >= 0 {
sb.write_string('+${hours:02}:00') sb.write_string('+${hours:02}:00')

View file

@ -96,7 +96,7 @@ pub fn ticks() i64 {
// str returns the time in the same format as `parse` expects ("YYYY-MM-DD HH:mm:ss"). // str returns the time in the same format as `parse` expects ("YYYY-MM-DD HH:mm:ss").
pub fn (t Time) str() string { pub fn (t Time) str() string {
// TODO Define common default format for // TODO: Define common default format for
// `str` and `parse` and use it in both ways // `str` and `parse` and use it in both ways
return t.format_ss() return t.format_ss()
} }

View file

@ -37,7 +37,7 @@ pub fn (a Any) string() string {
pub fn (a Any) to_toml() string { pub fn (a Any) to_toml() string {
match a { match a {
map[string]Any { map[string]Any {
// TODO more format control? // TODO: more format control?
return a.to_inline_toml() return a.to_inline_toml()
} }
[]Any { []Any {

View file

@ -510,7 +510,7 @@ fn validate_utf8_codepoint_string(str string) ! {
return error('Unicode code point `${str}` is outside the valid Unicode scalar value ranges.') return error('Unicode code point `${str}` is outside the valid Unicode scalar value ranges.')
} }
// Check if the Unicode value is actually in the valid Unicode scalar value ranges. // Check if the Unicode value is actually in the valid Unicode scalar value ranges.
// TODO should probably be transferred / implemented in `utf8.validate(...)` also? // TODO: should probably be transferred / implemented in `utf8.validate(...)` also?
if !((int_val >= 0x0000 && int_val <= 0xD7FF) || (int_val >= 0xE000 && int_val <= 0x10FFFF)) { if !((int_val >= 0x0000 && int_val <= 0xD7FF) || (int_val >= 0xE000 && int_val <= 0x10FFFF)) {
return error('Unicode code point `${str}` is not a valid Unicode scalar value.') return error('Unicode code point `${str}` is not a valid Unicode scalar value.')
} }
@ -535,7 +535,7 @@ fn (c Checker) check_unicode_escape(esc_unicode string) ! {
return error('Unicode escape sequence `${esc_unicode}` should be at least ${hex_digits_len} in length.') return error('Unicode escape sequence `${esc_unicode}` should be at least ${hex_digits_len} in length.')
} }
sequence = sequence[..hex_digits_len] sequence = sequence[..hex_digits_len]
// TODO not enforced in BurnSushi testsuite?? // TODO: not enforced in BurnSushi testsuite??
// if !sequence.is_upper() { // if !sequence.is_upper() {
// return error('Unicode escape sequence `$esc_unicode` is not in all uppercase.') // return error('Unicode escape sequence `$esc_unicode` is not in all uppercase.')
//} //}

View file

@ -74,7 +74,7 @@ fn (d Decoder) decode_number(mut n ast.Number) ! {
pub fn decode_quoted_escapes(mut q ast.Quoted) ! { pub fn decode_quoted_escapes(mut q ast.Quoted) ! {
// Setup a scanner in stack memory for easier navigation. // Setup a scanner in stack memory for easier navigation.
mut eat_whitespace := false mut eat_whitespace := false
// TODO use string builder // TODO: use string builder
mut decoded_s := '' mut decoded_s := ''
// See https://toml.io/en/v1.0.0#string for more info on string types. // See https://toml.io/en/v1.0.0#string for more info on string types.
is_basic := q.quote == `\"` is_basic := q.quote == `\"`

View file

@ -271,7 +271,7 @@ fn (p Parser) build_abs_dotted_key(key DottedKey) DottedKey {
} }
// todo_msvc_astring2dkey worksaround a MSVC compile error. // todo_msvc_astring2dkey worksaround a MSVC compile error.
// TODO remove. // TODO: remove.
fn todo_msvc_astring2dkey(s []string) DottedKey { fn todo_msvc_astring2dkey(s []string) DottedKey {
return s return s
} }
@ -1489,7 +1489,7 @@ pub fn (mut p Parser) time() !ast.Time {
lit += p.tok.lit lit += p.tok.lit
p.check(.number)! p.check(.number)!
lit += p.tok.lit lit += p.tok.lit
// TODO does TOML even have optional seconds? // TODO: does TOML even have optional seconds?
// if p.peek_tok.kind == .colon { // if p.peek_tok.kind == .colon {
p.check(.colon)! p.check(.colon)!
lit += p.tok.lit lit += p.tok.lit

View file

@ -285,7 +285,7 @@ fn to_alexcrichton(value ast.Value, array_type int) string {
return '{ "type": "float", "value": "${val}" }' return '{ "type": "float", "value": "${val}" }'
} }
v := value.i64() v := value.i64()
// TODO workaround https://github.com/vlang/v/issues/9507 // TODO: workaround https://github.com/vlang/v/issues/9507
if v == i64(-9223372036854775807 - 1) { if v == i64(-9223372036854775807 - 1) {
return '{ "type": "integer", "value": "-9223372036854775808" }' return '{ "type": "integer", "value": "-9223372036854775808" }'
} }

View file

@ -25,7 +25,7 @@ const invalid_exceptions = [
] ]
const valid_value_exceptions = []string{} const valid_value_exceptions = []string{}
// BUG with string interpolation of '${i64(-9223372036854775808)}') see below for workaround // BUG with string interpolation of '${i64(-9223372036854775808)}') see below for workaround
//'integer/long.toml', // TODO https://github.com/vlang/v/issues/9507 //'integer/long.toml', // TODO: https://github.com/vlang/v/issues/9507
const jq = os.find_abs_path_of_executable('jq') or { '' } const jq = os.find_abs_path_of_executable('jq') or { '' }
const compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml', 'burntsushi') const compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml', 'burntsushi')
@ -251,7 +251,7 @@ fn to_burntsushi(value ast.Value) string {
return '{ "type": "float", "value": "${val}" }' return '{ "type": "float", "value": "${val}" }'
} }
v := value.i64() v := value.i64()
// TODO workaround https://github.com/vlang/v/issues/9507 // TODO: workaround https://github.com/vlang/v/issues/9507
if v == i64(-9223372036854775807 - 1) { if v == i64(-9223372036854775807 - 1) {
return '{ "type": "integer", "value": "-9223372036854775808" }' return '{ "type": "integer", "value": "-9223372036854775808" }'
} }

View file

@ -367,7 +367,7 @@ fn to_iarna(value ast.Value, skip_value_map bool) string {
return '{ "type": "float", "value": "${val}" }' return '{ "type": "float", "value": "${val}" }'
} }
v := value.i64() v := value.i64()
// TODO workaround https://github.com/vlang/v/issues/9507 // TODO: workaround https://github.com/vlang/v/issues/9507
if v == i64(-9223372036854775807 - 1) { if v == i64(-9223372036854775807 - 1) {
if skip_value_map { if skip_value_map {
return '-9223372036854775808' return '-9223372036854775808'

View file

@ -30,7 +30,7 @@ fn test_parse() {
// assert false // assert false
assert toml_doc.value('db.enabled').bool() assert toml_doc.value('db.enabled').bool()
// TODO make this work // TODO: make this work
assert toml_doc.value('servers.alpha.ip').string() == '10.0.0.1' assert toml_doc.value('servers.alpha.ip').string() == '10.0.0.1'
assert toml_doc.value('servers.alpha.dc').string() == 'eqdc10' assert toml_doc.value('servers.alpha.dc').string() == 'eqdc10'

View file

@ -486,7 +486,7 @@ pub fn ast_to_any(value ast.Value) Any {
} }
return toml.null return toml.null
// TODO decide this // TODO: decide this
// panic(@MOD + '.' + @STRUCT + '.' + @FN + ' can\'t convert "$value"') // panic(@MOD + '.' + @STRUCT + '.' + @FN + ' can\'t convert "$value"')
// return Any('') // return Any('')
} }

View file

@ -550,7 +550,7 @@ pub:
is_unsafe bool // true, when [unsafe] is used on a fn is_unsafe bool // true, when [unsafe] is used on a fn
is_markused bool // true, when an explicit `[markused]` tag was put on a fn; `-skip-unused` will not remove that fn is_markused bool // true, when an explicit `[markused]` tag was put on a fn; `-skip-unused` will not remove that fn
is_file_translated bool // true, when the file it resides in is `[translated]` is_file_translated bool // true, when the file it resides in is `[translated]`
receiver StructField // TODO this is not a struct field receiver StructField // TODO: this is not a struct field
receiver_pos token.Pos // `(u User)` in `fn (u User) name()` position receiver_pos token.Pos // `(u User)` in `fn (u User) name()` position
is_method bool is_method bool
is_static_type_method bool // true for `fn Foo.bar() {}` is_static_type_method bool // true for `fn Foo.bar() {}`
@ -651,14 +651,15 @@ pub mut:
receiver_type Type // != 0, when .is_method == true receiver_type Type // != 0, when .is_method == true
name string name string
params []Param params []Param
source_fn voidptr // set in the checker, while processing fn declarations // TODO get rid of voidptr source_fn voidptr // set in the checker, while processing fn declarations // TODO: get rid of voidptr
usages int usages int
generic_names []string generic_names []string
dep_names []string // globals or consts dependent names dep_names []string // globals or consts dependent names
attrs []Attr // all fn attributes attrs []Attr // all fn attributes
is_conditional bool // true for `[if abc]fn(){}` is_conditional bool // true for `[if abc]fn(){}`
ctdefine_idx int // the index of the attribute, containing the compile time define [if mytag] ctdefine_idx int // the index of the attribute, containing the compile time define [if mytag]
from_embeded_type Type // for interface only, fn from the embedded interface from_embedded_type Type // for interface only, fn from the embedded interface
from_embeded_type Type @[deprecated: 'use from_embedded_type instead'; deprecated_after: '2024-03-31']
} }
fn (f &Fn) method_equals(o &Fn) bool { fn (f &Fn) method_equals(o &Fn) bool {
@ -710,8 +711,8 @@ pub fn (f &Fn) new_method_with_receiver_type(new_type_ Type) Fn {
new_method.params[i].typ = new_type new_method.params[i].typ = new_type
} }
} }
new_method.from_embeded_type = if f.from_embeded_type != 0 { new_method.from_embedded_type = if f.from_embedded_type != 0 {
f.from_embeded_type f.from_embedded_type
} else { } else {
f.params[0].typ f.params[0].typ
} }

View file

@ -51,7 +51,7 @@ pub mut:
} }
// used by vls to avoid leaks // used by vls to avoid leaks
// TODO remove manual memory management // TODO: remove manual memory management
@[unsafe] @[unsafe]
pub fn (mut t Table) free() { pub fn (mut t Table) free() {
unsafe { unsafe {
@ -531,7 +531,7 @@ pub fn (t &Table) find_field(s &TypeSymbol, name string) !StructField {
return field return field
} }
// mut info := ts.info as SumType // mut info := ts.info as SumType
// TODO a more detailed error so that it's easier to fix? // TODO: a more detailed error so that it's easier to fix?
return error('field `${name}` does not exist or have the same type in all sumtype variants') return error('field `${name}` does not exist or have the same type in all sumtype variants')
} }
else {} else {}

View file

@ -1150,7 +1150,7 @@ pub fn (t &Table) type_size(typ Type) (int, int) {
size = info.size * elem_size size = info.size * elem_size
align = elem_align align = elem_align
} }
// TODO hardcoded: // TODO: hardcoded:
.map { .map {
size = if t.pointer_size == 8 { 120 } else { 80 } size = if t.pointer_size == 8 { 120 } else { 80 }
align = t.pointer_size align = t.pointer_size
@ -1338,7 +1338,7 @@ pub fn (t &Table) type_to_str_using_aliases(typ Type, import_aliases map[string]
} }
} }
.chan { .chan {
// TODO currently the `chan` struct in builtin is not considered a struct but a chan // TODO: currently the `chan` struct in builtin is not considered a struct but a chan
if sym.mod != 'builtin' && sym.name != 'chan' { if sym.mod != 'builtin' && sym.name != 'chan' {
info := sym.info as Chan info := sym.info as Chan
mut elem_type := info.elem_type mut elem_type := info.elem_type
@ -1523,7 +1523,7 @@ pub fn (t &Table) fn_signature_using_aliases(func &Fn, import_aliases map[string
mut sb := strings.new_builder(20) mut sb := strings.new_builder(20)
if !opts.skip_receiver { if !opts.skip_receiver {
sb.write_string('fn ') sb.write_string('fn ')
// TODO write receiver // TODO: write receiver
} }
if !opts.type_only { if !opts.type_only {
sb.write_string(func.name) sb.write_string(func.name)

View file

@ -169,7 +169,7 @@ pub fn (mut b Builder) parse_imports() {
if b.pref.is_vsh { if b.pref.is_vsh {
done_imports << 'os' done_imports << 'os'
} }
// TODO (joe): decide if this is correct solution. // TODO: (joe): decide if this is correct solution.
// in the case of building a module, the actual module files // in the case of building a module, the actual module files
// are passed via cmd line, so they have already been parsed // are passed via cmd line, so they have already been parsed
// by this stage. note that if one files from a module was // by this stage. note that if one files from a module was
@ -315,7 +315,7 @@ pub fn (b &Builder) import_graph() &depgraph.DepGraph {
if p.mod.name !in builtins { if p.mod.name !in builtins {
deps << 'builtin' deps << 'builtin'
if b.pref.backend == .c { if b.pref.backend == .c {
// TODO JavaScript backend doesn't handle os for now // TODO: JavaScript backend doesn't handle os for now
// os import libraries so we exclude anything which could cause a loop // os import libraries so we exclude anything which could cause a loop
// git grep import vlib/os | cut -f2 -d: | cut -f2 -d" " | sort -u // git grep import vlib/os | cut -f2 -d: | cut -f2 -d" " | sort -u
// dl, os, os.cmdline, os.filelock, os.notify, strings, strings.textscanner, term.termios, time // dl, os, os.cmdline, os.filelock, os.notify, strings, strings.textscanner, term.termios, time

View file

@ -794,7 +794,7 @@ fn (mut b Builder) cc_linux_cross() {
ldlld = 'ld.lld.exe' ldlld = 'ld.lld.exe'
} }
linker_cmd := '${b.quote_compiler_name(ldlld)} ' + linker_args.join(' ') linker_cmd := '${b.quote_compiler_name(ldlld)} ' + linker_args.join(' ')
// s = s.replace('SYSROOT', sysroot) // TODO $ inter bug // s = s.replace('SYSROOT', sysroot) // TODO: $ inter bug
// s = s.replace('-o hi', '-o ' + c.pref.out_name) // s = s.replace('-o hi', '-o ' + c.pref.out_name)
if b.pref.show_cc { if b.pref.show_cc {
println(linker_cmd) println(linker_cmd)

View file

@ -263,7 +263,7 @@ pub fn (v Builder) get_builtin_files() []string {
builtin_files << v.v_files_from_dir(v.pref.bare_builtin_dir) builtin_files << v.v_files_from_dir(v.pref.bare_builtin_dir)
} }
if v.pref.backend == .c { if v.pref.backend == .c {
// TODO JavaScript backend doesn't handle os for now // TODO: JavaScript backend doesn't handle os for now
if v.pref.is_vsh && os.exists(os.join_path(location, 'os')) { if v.pref.is_vsh && os.exists(os.join_path(location, 'os')) {
builtin_files << v.v_files_from_dir(os.join_path(location, 'os')) builtin_files << v.v_files_from_dir(os.join_path(location, 'os'))
} }

View file

@ -1,6 +1,6 @@
module builder module builder
// TODO move this to msvc_default.v // TODO: move this to msvc_default.v
struct MsvcResult { struct MsvcResult {
full_cl_exe_path string full_cl_exe_path string
exe_path string exe_path string

View file

@ -25,7 +25,7 @@ fn find_windows_kit_internal(key RegKey, versions []string) !string {
$if windows { $if windows {
unsafe { unsafe {
for version in versions { for version in versions {
required_bytes := u32(0) // TODO mut required_bytes := u32(0) // TODO: mut
result := C.RegQueryValueEx(key, version.to_wide(), 0, 0, 0, &required_bytes) result := C.RegQueryValueEx(key, version.to_wide(), 0, 0, 0, &required_bytes)
length := required_bytes / 2 length := required_bytes / 2
if result != 0 { if result != 0 {

View file

@ -5,11 +5,11 @@ module checker
import v.ast import v.ast
import v.pref import v.pref
// TODO 600 line function // TODO: 600 line function
fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) { fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
prev_inside_assign := c.inside_assign prev_inside_assign := c.inside_assign
c.inside_assign = true c.inside_assign = true
c.expected_type = ast.none_type // TODO a hack to make `x := if ... work` c.expected_type = ast.none_type // TODO: a hack to make `x := if ... work`
defer { defer {
c.expected_type = ast.void_type c.expected_type = ast.void_type
c.inside_assign = prev_inside_assign c.inside_assign = prev_inside_assign
@ -489,8 +489,8 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
continue continue
} }
if c.pref.translated || c.file.is_translated { if c.pref.translated || c.file.is_translated {
// TODO fix this in C2V instead, for example cast enums to int before using `|` on them. // TODO: fix this in C2V instead, for example cast enums to int before using `|` on them.
// TODO replace all c.pref.translated checks with `$if !translated` for performance // TODO: replace all c.pref.translated checks with `$if !translated` for performance
continue continue
} }
if left_type_unwrapped == 0 { if left_type_unwrapped == 0 {

Some files were not shown because too many files have changed in this diff Show more