mirror of
https://github.com/vlang/v.git
synced 2025-08-03 09:47:15 -04:00
all: fix typos (#21089)
This commit is contained in:
parent
9ad84ddc21
commit
f77bb32044
16
CHANGELOG.md
16
CHANGELOG.md
@ -146,7 +146,7 @@
|
||||
- io: add a `string_reader` submodule (#20893)
|
||||
- toml: return an error from toml.parse_file(), when the passed file path does not exist (#20912)
|
||||
- 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: minor performance improvement, update benchmark recommendations (#20954)
|
||||
- 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
|
||||
- x.vweb: add error, when static directory does not exist (#20455)
|
||||
- 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)
|
||||
- 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)
|
||||
@ -182,7 +182,7 @@
|
||||
- x.vweb: add cors middleware (#20713)
|
||||
- x.vweb: add new sessions module (#20642)
|
||||
- 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)
|
||||
- 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)
|
||||
@ -464,7 +464,7 @@
|
||||
- Fix arrays alias built-in methods call(fix #19896) (#19910)
|
||||
- Fix generic array initialization (fix #19903) (#19916)
|
||||
- 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 auto str for interface struct member which implements str method (#19970)
|
||||
- Fix generics call with interface arg (fix #19976) (#20002)
|
||||
@ -559,7 +559,7 @@
|
||||
- Fix fn call with option call argument in autofree mode (#19515)
|
||||
- Bring back pascal case check for 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)
|
||||
- Allow size of fixed array to be integral casts (#19663)
|
||||
- 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)
|
||||
|
||||
#### 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: support `-no-builtin` (generate executables < 1KB Linux with `v -no-builtin -b native examples/hello_world.v`)
|
||||
@ -654,7 +654,7 @@
|
||||
|
||||
#### vfmt
|
||||
- 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)
|
||||
- Respect range index expressions in match branches (#19684)
|
||||
- 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.
|
||||
- Warning instead of error for unnecessary brackets in if/match.
|
||||
- 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.
|
||||
- Disallow multiple return values in const declarations.
|
||||
- Fix contains() with array of interfaces.
|
||||
|
@ -95,7 +95,7 @@
|
||||
- Disallow type matching with primitive vars.
|
||||
- Warning instead of error for unnecessary brackets in if/match.
|
||||
- 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.
|
||||
- Disallow multiple return values in const declarations.
|
||||
- Fix contains() with array of interfaces.
|
||||
|
@ -525,7 +525,7 @@ fn auto_complete_request(args []string) []string {
|
||||
add_sep := if part == '~' { os.path_separator } else { '' }
|
||||
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 == '..' {
|
||||
// 'v <command>(.*/$|.|..)<tab>' -> output full directory list
|
||||
ls_path = '.' + os.path_separator + part
|
||||
|
@ -32,7 +32,7 @@ mut:
|
||||
symbol_name string
|
||||
platform doc.Platform
|
||||
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_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
|
||||
|
@ -712,7 +712,7 @@ fn (mut app App) handle_tap() {
|
||||
} else if avgy < (m * 9 / 10) + ypad {
|
||||
app.new_game()
|
||||
} 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 {
|
||||
|
@ -59,7 +59,7 @@ pub fn load_texture(file_name string) (gfx.Image, gfx.Sampler) {
|
||||
buffer := read_bytes_from_file(file_name)
|
||||
stbi.set_flip_vertically_on_load(true)
|
||||
img := stbi.load_from_memory(buffer.data, buffer.len) or {
|
||||
eprintln('Texure file: [${file_name}] ERROR!')
|
||||
eprintln('Texture file: [${file_name}] ERROR!')
|
||||
exit(0)
|
||||
}
|
||||
sg_img, sg_smp := create_texture(int(img.width), int(img.height), img.data)
|
||||
|
@ -30,13 +30,13 @@ pub fn read_bytes_from_file(file_path string) []u8 {
|
||||
$if android {
|
||||
path = 'models/' + file_path
|
||||
buffer = os.read_apk_asset(path) or {
|
||||
eprintln('Texure file: [${path}] NOT FOUND!')
|
||||
eprintln('Texture file: [${path}] NOT FOUND!')
|
||||
exit(0)
|
||||
}
|
||||
} $else {
|
||||
path = os.resource_abs_path('assets/models/' + file_path)
|
||||
buffer = os.read_bytes(path) or {
|
||||
eprintln('Texure file: [${path}] NOT FOUND!')
|
||||
eprintln('Texture file: [${path}] NOT FOUND!')
|
||||
exit(0)
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ fn (mut a App) event(e &ui.Event) {
|
||||
if a.mode != .game {
|
||||
return
|
||||
}
|
||||
// TODO mouse movement for real Pong sharks
|
||||
// TODO: mouse movement for real Pong sharks
|
||||
// a.game.move_player(player_one, 0, -1)
|
||||
}
|
||||
.key_down {
|
||||
@ -344,7 +344,7 @@ fn (mut g Game) quit() {
|
||||
}
|
||||
|
||||
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
|
||||
x, y := int(px), int(py)
|
||||
match digit {
|
||||
@ -457,7 +457,7 @@ fn (mut g Game) free() {
|
||||
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) {
|
||||
app.init()
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ fn (mut g Game) get_tetro() {
|
||||
// g.tetro = g.tetros_cache[idx..idx + tetro_size].clone()
|
||||
}
|
||||
|
||||
// TODO mut
|
||||
// TODO: mut
|
||||
fn (mut g Game) drop_tetro() {
|
||||
for i in 0 .. tetro_size {
|
||||
tetro := g.tetro[i]
|
||||
|
@ -221,7 +221,7 @@ fn (mut app App) read_bytes(path string) bool {
|
||||
pub fn read_bytes_from_file(file_path string) []u8 {
|
||||
mut buffer := []u8{}
|
||||
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)
|
||||
}
|
||||
return buffer
|
||||
|
@ -69,7 +69,7 @@ pub fn (app &App) create_todo(mut ctx Context, name string) vweb.Result {
|
||||
// insert the todo into our database
|
||||
sql app.db {
|
||||
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
|
||||
|
||||
@ -127,7 +127,7 @@ pub fn (app &App) delete_todo(mut ctx Context, id int) vweb.Result {
|
||||
|
||||
fn main() {
|
||||
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{
|
||||
db: sqlite.connect('todo.db')!
|
||||
}
|
||||
|
2
thirdparty/fontstash/fontstash.h
vendored
2
thirdparty/fontstash/fontstash.h
vendored
@ -102,7 +102,7 @@ typedef struct FONStextIter FONStextIter;
|
||||
|
||||
typedef struct FONScontext FONScontext;
|
||||
|
||||
// Contructor and destructor.
|
||||
// Constructor and destructor.
|
||||
FONS_DEF FONScontext* fonsCreateInternal(FONSparams* params);
|
||||
FONS_DEF void fonsDeleteInternal(FONScontext* s);
|
||||
|
||||
|
2
thirdparty/libatomic_ops/atomic_ops.h
vendored
2
thirdparty/libatomic_ops/atomic_ops.h
vendored
@ -270,7 +270,7 @@
|
||||
# include <machine/sys/inline.h>
|
||||
# define AO_compiler_barrier() _Asm_sched_fence()
|
||||
# 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. */
|
||||
static volatile int AO_barrier_dummy;
|
||||
# define AO_compiler_barrier() (void)(AO_barrier_dummy = AO_barrier_dummy)
|
||||
|
2
thirdparty/libgc/gc.c
vendored
2
thirdparty/libgc/gc.c
vendored
@ -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);
|
||||
# endif
|
||||
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 */
|
||||
/* sequence, which often depends on SA_SIGINFO. */
|
||||
|
||||
|
2
thirdparty/sokol/sokol_gfx.h
vendored
2
thirdparty/sokol/sokol_gfx.h
vendored
@ -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_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
|
||||
// fully contained inside the framebuffer, but this doesn't make any sense, and also
|
||||
// isn't required by the backend APIs)
|
||||
|
@ -85,7 +85,7 @@ pub fn merge[T](a []T, b []T) []T {
|
||||
mut ia := 0
|
||||
mut ib := 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 {
|
||||
if a[ia] <= b[ib] {
|
||||
m[j] = a[ia]
|
||||
|
@ -156,7 +156,7 @@ fn new_array_from_c_array(len int, cap int, elm_size int, c_array voidptr) array
|
||||
len: len
|
||||
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)) }
|
||||
return arr
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ fn new_array_from_c_array_noscan(len int, cap int, elm_size int, c_array voidptr
|
||||
len: len
|
||||
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)) }
|
||||
return arr
|
||||
}
|
||||
|
@ -925,7 +925,7 @@ fn test_i64_sort() {
|
||||
fn test_sort_index_expr() {
|
||||
mut f := [[i64(50), 48], [i64(15)], [i64(1)], [i64(79)], [i64(38)],
|
||||
[i64(0)], [i64(27)]]
|
||||
// TODO This currently gives "indexing pointer" error without unsafe
|
||||
// TODO: This currently gives "indexing pointer" error without unsafe
|
||||
unsafe {
|
||||
f.sort(a[0] < b[0])
|
||||
}
|
||||
|
@ -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`
|
||||
struct ExceptionRecord {
|
||||
pub:
|
||||
|
@ -59,7 +59,7 @@ fn C.fputs(str &char, stream &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.fopen(filename &char, mode &char) &C.FILE
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by an MIT license that can be found in the LICENSE file.
|
||||
module builtin
|
||||
|
||||
// TODO implement compile time conditional include
|
||||
// TODO: implement compile time conditional include
|
||||
// [if !nofloat]
|
||||
import strconv
|
||||
|
||||
|
@ -918,7 +918,7 @@ fn test_i64_sort() {
|
||||
fn test_sort_index_expr() {
|
||||
mut f := [[i64(50), 48], [i64(15)], [i64(1)], [i64(79)], [i64(38)],
|
||||
[i64(0)], [i64(27)]]
|
||||
// TODO This currently gives "indexing pointer" error without unsafe
|
||||
// TODO: This currently gives "indexing pointer" error without unsafe
|
||||
unsafe {
|
||||
f.sort(a[0] < b[0])
|
||||
}
|
||||
|
@ -670,7 +670,7 @@ fn test_repeat() {
|
||||
assert s2.repeat(5) == s2
|
||||
assert s2.repeat(1) == s2
|
||||
assert s2.repeat(0) == s2
|
||||
// TODO Add test for negative values
|
||||
// TODO: Add test for negative values
|
||||
}
|
||||
|
||||
fn test_starts_with() {
|
||||
|
@ -40,7 +40,7 @@ fn map_hash_int_8(pkey voidptr) u64 {
|
||||
|
||||
// Move all zeros to the end of the array and resize array
|
||||
fn (mut d DenseArray) zeros_to_end() {
|
||||
// TODO alloca?
|
||||
// TODO: alloca?
|
||||
mut tmp_value := unsafe { malloc(d.value_bytes) }
|
||||
mut tmp_key := unsafe { malloc(d.key_bytes) }
|
||||
mut count := 0
|
||||
|
@ -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 {
|
||||
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 pval := &u8(values)
|
||||
for _ in 0 .. n {
|
||||
|
@ -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 {
|
||||
mut out := new_map_noscan_key(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 pval := &u8(values)
|
||||
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 {
|
||||
mut out := new_map_noscan_value(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 pval := &u8(values)
|
||||
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 {
|
||||
mut out := new_map_noscan_key_value(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 pval := &u8(values)
|
||||
for _ in 0 .. n {
|
||||
|
@ -354,7 +354,7 @@ pub fn (s string) replace(rep string, with string) string {
|
||||
if !s.contains(rep) {
|
||||
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
|
||||
mut idxs := []int{cap: s.len / rep.len}
|
||||
defer {
|
||||
@ -515,7 +515,7 @@ pub fn (s string) replace_char(rep u8, with u8, repeat int) string {
|
||||
if s.len == 0 {
|
||||
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()
|
||||
mut idxs := []int{cap: s.len}
|
||||
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.
|
||||
@[inline]
|
||||
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`.
|
||||
@ -1402,7 +1402,7 @@ pub fn (s string) count(substr string) int {
|
||||
i += substr.len
|
||||
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`.
|
||||
@ -1497,7 +1497,7 @@ pub fn (s string) ends_with(p string) bool {
|
||||
}
|
||||
|
||||
// to_lower returns the string in all lowercase characters.
|
||||
// TODO only works with ASCII
|
||||
// TODO: only works with ASCII
|
||||
@[direct_array_access]
|
||||
pub fn (s string) to_lower() string {
|
||||
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 'abcd'.all_before('.') == 'abcd'
|
||||
pub fn (s string) all_before(sub string) string {
|
||||
// TODO remove dup method
|
||||
// TODO: remove dup method
|
||||
pos := s.index_(sub)
|
||||
if pos == -1 {
|
||||
return s.clone()
|
||||
|
@ -1111,7 +1111,7 @@ fn test_repeat() {
|
||||
assert s2.repeat(5) == s2
|
||||
assert s2.repeat(1) == s2
|
||||
assert s2.repeat(0) == s2
|
||||
// TODO Add test for negative values
|
||||
// TODO: Add test for negative values
|
||||
}
|
||||
|
||||
fn test_starts_with() {
|
||||
|
@ -13,7 +13,7 @@ pub struct Clipboard {
|
||||
pb voidptr
|
||||
last_cb_serial i64
|
||||
mut:
|
||||
foo int // TODO remove, for mut hack
|
||||
foo int // TODO: remove, for mut hack
|
||||
}
|
||||
|
||||
fn C.darwin_new_pasteboard() voidptr
|
||||
|
@ -60,7 +60,7 @@ pub struct Clipboard {
|
||||
retry_delay int
|
||||
mut:
|
||||
hwnd voidptr
|
||||
foo int // TODO remove
|
||||
foo int // TODO: remove
|
||||
}
|
||||
|
||||
fn (cb &Clipboard) get_clipboard_lock() bool {
|
||||
|
@ -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.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
|
||||
|
||||
@ -207,7 +207,7 @@ pub fn (cb &Clipboard) check_availability() bool {
|
||||
pub fn (mut cb Clipboard) free() {
|
||||
C.XDestroyWindow(cb.display, cb.window)
|
||||
cb.window = Window(0)
|
||||
// FIX ME: program hangs when closing display
|
||||
// FIXME: program hangs when closing display
|
||||
// XCloseDisplay(cb.display)
|
||||
}
|
||||
|
||||
|
@ -409,7 +409,7 @@ pub fn compress(data []u8, params CompressParams) ![]u8 {
|
||||
}
|
||||
check_zstd(cctx.set_parameter(.zstd_c_compression_level, params.compression_level))!
|
||||
$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_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))!
|
||||
$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_checksum_flag, if params.checksum_flag { 1 } else { 0 }))!
|
||||
|
@ -60,7 +60,7 @@ pub fn (ctx &TodoContext) str() string {
|
||||
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
|
||||
// surrounding function has not yet been extended to accept a Context
|
||||
// parameter).
|
||||
|
@ -4,7 +4,7 @@ module hmac
|
||||
|
||||
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 npad = []u8{len: 256, init: 0}
|
||||
|
@ -4,7 +4,7 @@ module datatypes
|
||||
|
||||
@[heap]
|
||||
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 = empty_cb // hash function, input [T] , output u32
|
||||
table_size int // every entry is one-bit, packed into `table`
|
||||
|
@ -99,8 +99,8 @@ fn test_remove_from_bst_one() {
|
||||
assert bst.in_order_traversal() == [1, 10, 20]
|
||||
}
|
||||
|
||||
// Another test n the remove BST, this remove an intermidia node
|
||||
// that it is a triky operation.
|
||||
// Another test n the remove BST, this remove an intermediate node
|
||||
// that it is a tricky operation.
|
||||
fn test_remove_from_bst_two() {
|
||||
mut bst := BSTree[int]{}
|
||||
assert bst.insert(10)
|
||||
|
@ -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.
|
||||
//
|
||||
//
|
||||
@ -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
|
||||
// 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 {
|
||||
leftbits := (smallbits << idx) & left_bits(1 << idx)
|
||||
leastbit := least_bit(leftbits)
|
||||
|
@ -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.
|
||||
// Otherwise it returns data + a final \n addded.
|
||||
// Otherwise it returns data + a final \n added.
|
||||
fn fix_nl(data string) string {
|
||||
if data.len == 0 || data[data.len - 1] == `\n` {
|
||||
return data
|
||||
|
@ -321,7 +321,7 @@ fn test_multiple_arguments() {
|
||||
'-c',
|
||||
'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] &&
|
||||
// fp.string_multi('some-flag', `b`, '') == ['a', 'c', 'b'] &&
|
||||
// fp.float_multi('some-flag', `c`, '') == [1.23, 2.34, 3.45]
|
||||
|
@ -234,7 +234,7 @@ pub fn (s &Context) vert_metrics(ascender &f32, descender &f32, lineh &f32) {
|
||||
C.fonsVertMetrics(s, ascender, descender, lineh)
|
||||
}
|
||||
|
||||
// text_iter_init initalizes the text iterator `iter`.
|
||||
// text_iter_init initializes the text iterator `iter`.
|
||||
@[inline]
|
||||
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)
|
||||
|
@ -1,6 +1,6 @@
|
||||
module fontstash
|
||||
|
||||
// Contructor and destructor.
|
||||
// Constructor and destructor.
|
||||
fn C.fonsCreateInternal(params &C.FONSparams) &C.FONScontext
|
||||
fn C.fonsDeleteInternal(s &C.FONScontext)
|
||||
|
||||
|
@ -729,7 +729,7 @@ pub fn screen_size() Size {
|
||||
height: int(C.GetSystemMetrics(C.SM_CYSCREEN))
|
||||
}
|
||||
}
|
||||
// TODO linux, etc
|
||||
// TODO: linux, etc
|
||||
return Size{}
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ gg__Image darwin_create_image(string path_) {
|
||||
res.path = path_;
|
||||
res.ok = true;
|
||||
// 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);
|
||||
return res;
|
||||
}
|
||||
|
@ -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
|
||||
// `width` x `height` dimension.
|
||||
//
|
||||
// TODO copypasta
|
||||
// TODO: copypasta
|
||||
pub fn (mut ctx Context) create_image_with_size(file string, width int, height int) Image {
|
||||
if !gfx.is_valid() {
|
||||
// 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`.
|
||||
//
|
||||
// TODO remove this
|
||||
// TODO: remove this
|
||||
fn create_image(file string) Image {
|
||||
if !os.exists(file) {
|
||||
println('gg.create_image(): file not found: ${file}')
|
||||
|
@ -191,7 +191,7 @@ pub fn (x Vec4) sum() f32 {
|
||||
/*********************************************************************
|
||||
* Operators
|
||||
*********************************************************************/
|
||||
// + returns `a` + `b` (corresponding elements are addded)
|
||||
// + returns `a` + `b` (corresponding elements are added)
|
||||
@[inline]
|
||||
pub fn (a Vec4) + (b Vec4) 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]
|
||||
pub fn (x Vec4) mul_vec4(y Vec4) Vec4 {
|
||||
return Vec4{
|
||||
|
@ -176,7 +176,7 @@ pub fn (ctx &Context) draw_text2(p DrawTextParams) {
|
||||
bold: p.bold
|
||||
mono: p.mono
|
||||
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`.
|
||||
@ -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')
|
||||
return
|
||||
}
|
||||
// text := text_.trim_space() // TODO remove/optimize
|
||||
// text := text_.trim_space() // TODO: remove/optimize
|
||||
// mut text := text_
|
||||
// if text.contains('\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])
|
||||
if s.ends_with(' ') {
|
||||
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)
|
||||
// println('TW "$s" = $res')
|
||||
|
@ -9,7 +9,7 @@
|
||||
// currently the C version performs slightly better
|
||||
// because it uses 128 bit int when available and
|
||||
// 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:
|
||||
// `v run cmd/tools/bench/wyhash.v`
|
||||
// try running with and without the `-prod` flag
|
||||
|
@ -27,7 +27,7 @@ mut:
|
||||
salary f32
|
||||
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).
|
||||
// TODO document @[raw]
|
||||
// TODO: document @[raw]
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -324,7 +324,7 @@ fn test_nested_type() {
|
||||
assert data2.users[key].last_name == user.last_name
|
||||
assert data2.users[key].is_registered == user.is_registered
|
||||
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 k2, v2 in v {
|
||||
|
@ -153,7 +153,7 @@ pub fn delete(url string) !Response {
|
||||
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.
|
||||
@[noinline]
|
||||
pub fn fetch(config FetchConfig) !Response {
|
||||
|
@ -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')!
|
||||
|
||||
$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,
|
||||
// path))!
|
||||
// client.shutdown()!
|
||||
|
@ -218,7 +218,7 @@ fn (req &Request) http_do(host string, method Method, path string) !Response {
|
||||
mut client := net.dial_tcp(host)!
|
||||
client.set_read_timeout(req.read_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())!
|
||||
$if trace_http_request ? {
|
||||
eprintln('> ${s}')
|
||||
|
@ -345,7 +345,7 @@ pub fn (mut s SSLConn) write_ptr(bytes &u8, len int) !int {
|
||||
$if trace_ssl ? {
|
||||
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 ? {
|
||||
eprintln('${@METHOD} ---> res: could not write SSL, err_res: ${err_res}')
|
||||
|
@ -92,7 +92,7 @@ fn handshake(mut con net.TcpConn, host string, username string, password string)
|
||||
} else if address.contains_only(':1234567890abcdf') {
|
||||
// v << addr_type_ipv6
|
||||
// v << parse_ipv4(address)!
|
||||
// todo support ipv6
|
||||
// TODO: support ipv6
|
||||
} else { // domain
|
||||
if address.len > 255 {
|
||||
return error('${address} is too long')
|
||||
|
@ -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) ! {
|
||||
// TODO reenable when this `in` operation works again
|
||||
// TODO: reenable when this `in` operation works again
|
||||
// if opt !in opts_can_set {
|
||||
// return err_option_not_settable
|
||||
// }
|
||||
|
@ -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) ! {
|
||||
// TODO reenable when this `in` operation works again
|
||||
// TODO: reenable when this `in` operation works again
|
||||
// if opt !in opts_can_set {
|
||||
// return err_option_not_settable
|
||||
// }
|
||||
|
@ -191,7 +191,7 @@ pub fn (c &StreamConn) write_timeout() time.Duration {
|
||||
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) {
|
||||
c.write_timeout = t
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ fn unescape(s_ string, mode EncodingMode) !string {
|
||||
}
|
||||
}
|
||||
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 {
|
||||
return error(error_msg('unescape: invalid escape sequence', ''))
|
||||
@ -751,7 +751,7 @@ pub fn (u URL) str() string {
|
||||
// path reference.
|
||||
i := path.index_u8(`:`)
|
||||
if i > -1 {
|
||||
// TODO remove this when autofree handles tmp
|
||||
// TODO: remove this when autofree handles tmp
|
||||
// expressions like this
|
||||
if i > -1 && path[..i].index_u8(`/`) == -1 {
|
||||
buf.write_string('./')
|
||||
|
@ -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))
|
||||
if written == 0 && s.len != 0 {
|
||||
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`
|
||||
pub fn (mut f File) write_raw[T](t &T) ! {
|
||||
|
@ -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
|
||||
// appears in that stream and an EOF occurs before the buffer is full.
|
||||
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}
|
||||
bw[9] = 0xff
|
||||
bw[12] = 10 // newline
|
||||
@ -179,7 +179,7 @@ fn test_read_eof_last_read_full_buffer_fill() {
|
||||
}
|
||||
|
||||
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))
|
||||
mut f := os.open_file(tfile, 'w')!
|
||||
f.write_struct(another_point)!
|
||||
@ -234,7 +234,7 @@ fn test_read_struct_at() {
|
||||
}
|
||||
|
||||
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))
|
||||
mut f := os.open_file(tfile, 'w')!
|
||||
f.write_raw(another_point)!
|
||||
|
@ -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.
|
||||
// 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 {
|
||||
attr := lstat(path) or { Stat{} }
|
||||
fm := attr.get_mode()
|
||||
|
@ -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})',
|
||||
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.
|
||||
mut buf := [1024]u8{}
|
||||
mut count := 0
|
||||
@ -351,7 +351,7 @@ fn vpclose(f voidptr) int {
|
||||
// system works like `exec`, but only returns a return code.
|
||||
pub fn system(cmd string) int {
|
||||
// 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')
|
||||
// }
|
||||
mut ret := 0
|
||||
|
@ -173,7 +173,7 @@ pub fn sigint_to_signal_name(si int) string {
|
||||
$if linux {
|
||||
// From `man 7 signal` on linux:
|
||||
match si {
|
||||
// TODO dependent on platform
|
||||
// TODO: dependent on platform
|
||||
// works only on x86/ARM/most others
|
||||
10 { // , 30, 16
|
||||
return 'SIGUSR1'
|
||||
@ -780,7 +780,7 @@ pub fn temp_dir() string {
|
||||
mut path := getenv('TMPDIR')
|
||||
$if windows {
|
||||
if path == '' {
|
||||
// TODO see Qt's implementation?
|
||||
// TODO: see Qt's implementation?
|
||||
// https://doc.qt.io/qt-5/qdir.html#tempPath
|
||||
// https://github.com/qt/qtbase/blob/e164d61ca8263fc4b46fdd916e1ea77c7dd2b735/src/corelib/io/qfilesystemengine_win.cpp#L1275
|
||||
path = getenv('TEMP')
|
||||
@ -798,7 +798,7 @@ pub fn temp_dir() string {
|
||||
return '/tmp'
|
||||
}
|
||||
$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 == '' {
|
||||
path = cache_dir()
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -316,7 +316,7 @@ pub fn (mut rng PRNG) f64_in_range(min f64, max f64) !f64 {
|
||||
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 .
|
||||
// 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
|
||||
@ -661,7 +661,7 @@ const english_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
const hex_chars = 'abcdef0123456789'
|
||||
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 .
|
||||
// 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by an MIT license
|
||||
// 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
|
||||
// based on the work of https://github.com/AmokHuginnsson/replxx
|
||||
//
|
||||
|
@ -27,7 +27,7 @@ enum Action {
|
||||
delete_line
|
||||
move_cursor_left
|
||||
move_cursor_right
|
||||
move_cursor_begining
|
||||
move_cursor_start
|
||||
move_cursor_end
|
||||
move_cursor_word_left
|
||||
move_cursor_word_right
|
||||
@ -206,7 +206,7 @@ fn (mut r Readline) analyse(c int) Action {
|
||||
return .delete_word_left
|
||||
} // CTRL + W
|
||||
1 {
|
||||
return .move_cursor_begining
|
||||
return .move_cursor_start
|
||||
} // ^A
|
||||
5 {
|
||||
return .move_cursor_end
|
||||
@ -235,7 +235,7 @@ fn (r Readline) analyse_control() Action {
|
||||
`D` { return .move_cursor_left }
|
||||
`B` { return .history_next }
|
||||
`A` { return .history_previous }
|
||||
`H` { return .move_cursor_begining }
|
||||
`H` { return .move_cursor_start }
|
||||
`F` { return .move_cursor_end }
|
||||
`1` { return r.analyse_extended_control() }
|
||||
`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() }
|
||||
.move_cursor_left { r.move_cursor_left() }
|
||||
.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_word_left { r.move_cursor_word_left() }
|
||||
.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.
|
||||
fn (mut r Readline) move_cursor_begining() {
|
||||
// move_cursor_start moves the cursor to the beginning of the current line.
|
||||
fn (mut r Readline) move_cursor_start() {
|
||||
r.cursor = 0
|
||||
r.refresh_line()
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by an MIT license
|
||||
// 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
|
||||
// based on the work of https://github.com/AmokHuginnsson/replxx
|
||||
//
|
||||
|
@ -50,7 +50,7 @@ pub fn from(input string) !Version {
|
||||
|
||||
// build returns a `Version` structure with given `major`, `minor` and `patch` versions.
|
||||
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, '', ''}
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ $if emscripten ? {
|
||||
// for simplicity, all header includes are here because import order matters and we dont have any way
|
||||
// to ensure import order with V yet
|
||||
#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
|
||||
#flag linux -DSOKOL_NO_ENTRY
|
||||
#flag darwin -DSOKOL_NO_ENTRY
|
||||
@ -68,7 +68,7 @@ $if emscripten ? {
|
||||
#flag freebsd -DSOKOL_NO_ENTRY
|
||||
#flag openbsd -DSOKOL_NO_ENTRY
|
||||
#flag solaris -DSOKOL_NO_ENTRY
|
||||
// TODO end
|
||||
// TODO: end
|
||||
|
||||
#flag linux -ldl
|
||||
|
||||
|
@ -186,7 +186,7 @@ pub fn 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]
|
||||
pub fn quit() {
|
||||
C.sapp_quit()
|
||||
|
@ -65,7 +65,7 @@ fn C.sapp_request_quit()
|
||||
// cancel a pending quit (when SAPP_EVENTTYPE_QUIT_REQUESTED has been received)
|
||||
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()
|
||||
|
||||
// call from inside event callback to consume the current event (don't forward to platform)
|
||||
|
@ -117,7 +117,7 @@ enum ParserState {
|
||||
}
|
||||
|
||||
// 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]
|
||||
fn parser(s string) (ParserState, PrepNumber) {
|
||||
mut digx := 0
|
||||
|
@ -54,7 +54,7 @@ fn test_atof() {
|
||||
}
|
||||
|
||||
// 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 {
|
||||
b := src_num[c].strlong()
|
||||
value := strconv.atof64(x) or { panic(err) }
|
||||
|
@ -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]
|
||||
pub fn remove_tail_zeros(s string) string {
|
||||
unsafe {
|
||||
|
@ -22,7 +22,7 @@ enum Char_parse_state {
|
||||
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.
|
||||
// Note, that this function is unsafe.
|
||||
// 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) })
|
||||
}
|
||||
|
||||
// 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.
|
||||
// Note, that this function is unsafe.
|
||||
// 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")
|
||||
match ch1 {
|
||||
// h for 16 bit int
|
||||
// hh fot 8 bit int
|
||||
// hh for 8 bit int
|
||||
`h` {
|
||||
if ch2 == `h` {
|
||||
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)
|
||||
match ch1 {
|
||||
// h for 16 bit unsigned int
|
||||
// hh fot 8 bit unsigned int
|
||||
// hh for 8 bit unsigned int
|
||||
`h` {
|
||||
if ch2 == `h` {
|
||||
d1 = u64(unsafe { *(&u8(pt[p_index])) })
|
||||
|
@ -44,7 +44,7 @@ fn do_rec_f64(ch chan f64, sumch chan f64) {
|
||||
fn test_select() {
|
||||
ch1 := chan int{cap: 3}
|
||||
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}
|
||||
chf2 := chan f64{}
|
||||
chsum1 := chan i64{}
|
||||
|
@ -63,7 +63,7 @@ fn test_try_lock_rwmutex() {
|
||||
assert try_fail_writing2 == false
|
||||
|
||||
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
|
||||
try_success_writing3 := mx.try_wlock()
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by an MIT license
|
||||
// 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
|
||||
// based on the work of https://github.com/AmokHuginnsson/replxx
|
||||
//
|
||||
|
@ -264,7 +264,7 @@ pub fn (t Time) md() string {
|
||||
return t.get_fmt_date_str(.space, .mmmd)
|
||||
}
|
||||
|
||||
// TODO test, improve performance
|
||||
// TODO: test, improve performance
|
||||
// appends ordinal suffix to a number
|
||||
fn ordinal_suffix(n int) string {
|
||||
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}')
|
||||
}
|
||||
'N' {
|
||||
// TODO integrate BC
|
||||
// TODO: integrate BC
|
||||
sb.write_string('AD')
|
||||
}
|
||||
'NN' {
|
||||
// TODO integrate Before Christ
|
||||
// TODO: integrate Before Christ
|
||||
sb.write_string('Anno Domini')
|
||||
}
|
||||
'Z' {
|
||||
@ -498,7 +498,7 @@ pub fn (t Time) custom_format(s string) string {
|
||||
}
|
||||
}
|
||||
'ZZ' {
|
||||
// TODO update if minute differs?
|
||||
// TODO: update if minute differs?
|
||||
mut hours := offset() / seconds_per_hour
|
||||
if hours >= 0 {
|
||||
sb.write_string('+${hours:02}00')
|
||||
@ -508,7 +508,7 @@ pub fn (t Time) custom_format(s string) string {
|
||||
}
|
||||
}
|
||||
'ZZZ' {
|
||||
// TODO update if minute differs?
|
||||
// TODO: update if minute differs?
|
||||
mut hours := offset() / seconds_per_hour
|
||||
if hours >= 0 {
|
||||
sb.write_string('+${hours:02}:00')
|
||||
|
@ -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").
|
||||
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
|
||||
return t.format_ss()
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ pub fn (a Any) string() string {
|
||||
pub fn (a Any) to_toml() string {
|
||||
match a {
|
||||
map[string]Any {
|
||||
// TODO more format control?
|
||||
// TODO: more format control?
|
||||
return a.to_inline_toml()
|
||||
}
|
||||
[]Any {
|
||||
|
@ -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.')
|
||||
}
|
||||
// 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)) {
|
||||
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.')
|
||||
}
|
||||
sequence = sequence[..hex_digits_len]
|
||||
// TODO not enforced in BurnSushi testsuite??
|
||||
// TODO: not enforced in BurnSushi testsuite??
|
||||
// if !sequence.is_upper() {
|
||||
// return error('Unicode escape sequence `$esc_unicode` is not in all uppercase.')
|
||||
//}
|
||||
|
@ -74,7 +74,7 @@ fn (d Decoder) decode_number(mut n ast.Number) ! {
|
||||
pub fn decode_quoted_escapes(mut q ast.Quoted) ! {
|
||||
// Setup a scanner in stack memory for easier navigation.
|
||||
mut eat_whitespace := false
|
||||
// TODO use string builder
|
||||
// TODO: use string builder
|
||||
mut decoded_s := ''
|
||||
// See https://toml.io/en/v1.0.0#string for more info on string types.
|
||||
is_basic := q.quote == `\"`
|
||||
|
@ -271,7 +271,7 @@ fn (p Parser) build_abs_dotted_key(key DottedKey) DottedKey {
|
||||
}
|
||||
|
||||
// todo_msvc_astring2dkey worksaround a MSVC compile error.
|
||||
// TODO remove.
|
||||
// TODO: remove.
|
||||
fn todo_msvc_astring2dkey(s []string) DottedKey {
|
||||
return s
|
||||
}
|
||||
@ -1489,7 +1489,7 @@ pub fn (mut p Parser) time() !ast.Time {
|
||||
lit += p.tok.lit
|
||||
p.check(.number)!
|
||||
lit += p.tok.lit
|
||||
// TODO does TOML even have optional seconds?
|
||||
// TODO: does TOML even have optional seconds?
|
||||
// if p.peek_tok.kind == .colon {
|
||||
p.check(.colon)!
|
||||
lit += p.tok.lit
|
||||
|
@ -285,7 +285,7 @@ fn to_alexcrichton(value ast.Value, array_type int) string {
|
||||
return '{ "type": "float", "value": "${val}" }'
|
||||
}
|
||||
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) {
|
||||
return '{ "type": "integer", "value": "-9223372036854775808" }'
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ const invalid_exceptions = [
|
||||
]
|
||||
const valid_value_exceptions = []string{}
|
||||
// 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 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}" }'
|
||||
}
|
||||
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) {
|
||||
return '{ "type": "integer", "value": "-9223372036854775808" }'
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ fn to_iarna(value ast.Value, skip_value_map bool) string {
|
||||
return '{ "type": "float", "value": "${val}" }'
|
||||
}
|
||||
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 skip_value_map {
|
||||
return '-9223372036854775808'
|
||||
|
@ -30,7 +30,7 @@ fn test_parse() {
|
||||
// assert false
|
||||
|
||||
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.dc').string() == 'eqdc10'
|
||||
|
||||
|
@ -486,7 +486,7 @@ pub fn ast_to_any(value ast.Value) Any {
|
||||
}
|
||||
|
||||
return toml.null
|
||||
// TODO decide this
|
||||
// TODO: decide this
|
||||
// panic(@MOD + '.' + @STRUCT + '.' + @FN + ' can\'t convert "$value"')
|
||||
// return Any('')
|
||||
}
|
||||
|
@ -550,7 +550,7 @@ pub:
|
||||
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_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
|
||||
is_method bool
|
||||
is_static_type_method bool // true for `fn Foo.bar() {}`
|
||||
@ -647,18 +647,19 @@ pub:
|
||||
pos token.Pos
|
||||
return_type_pos token.Pos
|
||||
pub mut:
|
||||
return_type Type
|
||||
receiver_type Type // != 0, when .is_method == true
|
||||
name string
|
||||
params []Param
|
||||
source_fn voidptr // set in the checker, while processing fn declarations // TODO get rid of voidptr
|
||||
usages int
|
||||
generic_names []string
|
||||
dep_names []string // globals or consts dependent names
|
||||
attrs []Attr // all fn attributes
|
||||
is_conditional bool // true for `[if abc]fn(){}`
|
||||
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
|
||||
return_type Type
|
||||
receiver_type Type // != 0, when .is_method == true
|
||||
name string
|
||||
params []Param
|
||||
source_fn voidptr // set in the checker, while processing fn declarations // TODO: get rid of voidptr
|
||||
usages int
|
||||
generic_names []string
|
||||
dep_names []string // globals or consts dependent names
|
||||
attrs []Attr // all fn attributes
|
||||
is_conditional bool // true for `[if abc]fn(){}`
|
||||
ctdefine_idx int // the index of the attribute, containing the compile time define [if mytag]
|
||||
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 {
|
||||
@ -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.from_embeded_type = if f.from_embeded_type != 0 {
|
||||
f.from_embeded_type
|
||||
new_method.from_embedded_type = if f.from_embedded_type != 0 {
|
||||
f.from_embedded_type
|
||||
} else {
|
||||
f.params[0].typ
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ pub mut:
|
||||
}
|
||||
|
||||
// used by vls to avoid leaks
|
||||
// TODO remove manual memory management
|
||||
// TODO: remove manual memory management
|
||||
@[unsafe]
|
||||
pub fn (mut t Table) free() {
|
||||
unsafe {
|
||||
@ -531,7 +531,7 @@ pub fn (t &Table) find_field(s &TypeSymbol, name string) !StructField {
|
||||
return field
|
||||
}
|
||||
// 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')
|
||||
}
|
||||
else {}
|
||||
|
@ -1150,7 +1150,7 @@ pub fn (t &Table) type_size(typ Type) (int, int) {
|
||||
size = info.size * elem_size
|
||||
align = elem_align
|
||||
}
|
||||
// TODO hardcoded:
|
||||
// TODO: hardcoded:
|
||||
.map {
|
||||
size = if t.pointer_size == 8 { 120 } else { 80 }
|
||||
align = t.pointer_size
|
||||
@ -1338,7 +1338,7 @@ pub fn (t &Table) type_to_str_using_aliases(typ Type, import_aliases map[string]
|
||||
}
|
||||
}
|
||||
.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' {
|
||||
info := sym.info as Chan
|
||||
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)
|
||||
if !opts.skip_receiver {
|
||||
sb.write_string('fn ')
|
||||
// TODO write receiver
|
||||
// TODO: write receiver
|
||||
}
|
||||
if !opts.type_only {
|
||||
sb.write_string(func.name)
|
||||
|
@ -169,7 +169,7 @@ pub fn (mut b Builder) parse_imports() {
|
||||
if b.pref.is_vsh {
|
||||
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
|
||||
// are passed via cmd line, so they have already been parsed
|
||||
// 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 {
|
||||
deps << 'builtin'
|
||||
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
|
||||
// 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
|
||||
|
@ -794,7 +794,7 @@ fn (mut b Builder) cc_linux_cross() {
|
||||
ldlld = 'ld.lld.exe'
|
||||
}
|
||||
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)
|
||||
if b.pref.show_cc {
|
||||
println(linker_cmd)
|
||||
|
@ -263,7 +263,7 @@ pub fn (v Builder) get_builtin_files() []string {
|
||||
builtin_files << v.v_files_from_dir(v.pref.bare_builtin_dir)
|
||||
}
|
||||
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')) {
|
||||
builtin_files << v.v_files_from_dir(os.join_path(location, 'os'))
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
module builder
|
||||
|
||||
// TODO move this to msvc_default.v
|
||||
// TODO: move this to msvc_default.v
|
||||
struct MsvcResult {
|
||||
full_cl_exe_path string
|
||||
exe_path string
|
||||
|
@ -25,7 +25,7 @@ fn find_windows_kit_internal(key RegKey, versions []string) !string {
|
||||
$if windows {
|
||||
unsafe {
|
||||
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)
|
||||
length := required_bytes / 2
|
||||
if result != 0 {
|
||||
|
@ -5,11 +5,11 @@ module checker
|
||||
import v.ast
|
||||
import v.pref
|
||||
|
||||
// TODO 600 line function
|
||||
// TODO: 600 line function
|
||||
fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
|
||||
prev_inside_assign := c.inside_assign
|
||||
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 {
|
||||
c.expected_type = ast.void_type
|
||||
c.inside_assign = prev_inside_assign
|
||||
@ -489,8 +489,8 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
|
||||
continue
|
||||
}
|
||||
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 replace all c.pref.translated checks with `$if !translated` for performance
|
||||
// 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
|
||||
continue
|
||||
}
|
||||
if left_type_unwrapped == 0 {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user