Commit Graph

6319 Commits (4152c704f351adbf43b9e256367be455478e75fe)

Author SHA1 Message Date
Delyan Angelov 17062dc5c8
v.pref: support `-obf` in addition to `-obfuscate`, as described in `v help build` 2021-02-02 12:24:34 +02:00
Lukas Neubert 5aaeac79fa
ci: fix compilation (#8511) 2021-02-02 12:06:54 +02:00
Delyan Angelov d57a9c419d
examples: add net_udp_server_and_client.v 2021-02-02 10:36:56 +02:00
Alexander Medvednikov 2c4674eb42 cgen: obfuscate functions 2021-02-02 09:14:41 +01:00
yuyi 5ec6f7a781
ftp: fix error in dir() (#8504) 2021-02-02 08:22:52 +01:00
yuyi 9a2820fa7b
checker: fix pass fixed array of function as argument (#8502) 2021-02-02 03:58:54 +01:00
Ruofan XU a0a33f7ff1
checker: fix map of function as argument and direct call of function in map (#8494) 2021-02-02 03:58:32 +01:00
Louis Schmieder 969f19daf4
orm: fix null strings (#8497) 2021-02-01 21:44:09 +01:00
Ruofan XU 51f2eb81f4
checker/cgen: fix mut array of fn as argument (#8469) 2021-02-01 20:10:24 +01:00
Lukas Neubert cf1084105c
fmt: allow single line ternary if as function argument (#8486) 2021-02-01 20:08:42 +01:00
Nick Treleaven 79e9084f7b
checker: allow `Struct{...expr}` where `expr` is another struct type (#8495) 2021-02-01 20:08:25 +01:00
Uwe Krüger 17746561f2
cgen: put `shared` arrays and maps always on heap (#8496) 2021-02-01 20:07:01 +01:00
yuyi 4d268d1436
cgen: minor cleanup of gen_fn_decl (#8474) 2021-02-01 20:06:34 +01:00
Delyan Angelov fab7b9d9d9
checker: fix `x := match enumexpr { .case2 { fn1 } .case2 { fn2} }`, where fn1 and fn2 have compatible signature 2021-02-01 21:01:58 +02:00
BigBlack e3c2604338
cgen: fixed array slice in function, add docs (#8481) 2021-02-01 19:11:17 +02:00
Lucas Hernán Tarche 7813ecbb75
gg: add draw_convex_poly/2 and draw_empty_poly/2 methods (#8487) 2021-02-01 18:18:23 +02:00
yuyi 1e07173234
cgen: minor cleanup of array_init (#8477) 2021-02-01 15:56:55 +01:00
Nick Treleaven c537578481
checker: ensure `expr` is an lvalue with `Struct{...expr` (#8489) 2021-02-01 15:18:03 +01:00
Lukas Neubert d660f2cc6f
fmt: insert newline after last HashStmt (#8482) 2021-02-01 14:50:41 +01:00
yuyi 53a5aad855
cgen: fix fixed array of function (#8490) 2021-02-01 14:50:10 +01:00
Lukas Neubert 8755f40430
fmt: keep comments after imports (#8483) 2021-02-01 14:45:08 +01:00
Uwe Krüger 44ec9e3ebc
checker/cgen: put `shared` struct always on heap (#8492) 2021-02-01 14:39:36 +01:00
Delyan Angelov 5b9a7bf6b3
cgen: support `#flag -DWIN32_FULL`, when you do NOT want WIN32_FULL 2021-02-01 14:40:51 +02:00
Lukas Neubert 43676330ba
fmt: keep braces around @ escaped fields in string interpolation (#8488) 2021-02-01 11:04:57 +02:00
Enzo 778b83a132
gen: fix multiple blank param with interface (#8480) 2021-01-31 19:44:55 +02:00
spaceface effa3188dd
cgen: fix type casts to interfaces (#8476) 2021-01-31 19:24:33 +02:00
Larpon d25825df57
all: support compile time `$env('ENV_VAR')` (#8456) 2021-01-31 19:22:42 +02:00
Enzo 2945040a67
gen: fix function with multiple blank params (#8475) 2021-01-31 16:37:26 +02:00
Nick Treleaven f992099726
checker: check s.$method(arg) argument is []string (#8455) 2021-01-31 15:28:23 +01:00
Alexander Medvednikov 9638013203 gg: fix macos C function definitions 2021-01-31 13:57:06 +01:00
Ruofan XU ae60ea4ed5
tests: add regression tests for typeof map and array of fns (#8458) 2021-01-31 12:20:15 +02:00
Seven Du 09c65163b4
cgen: add a destructor caller for the generated _vcleanup, when using -shared (#8464) 2021-01-31 12:10:49 +02:00
Delyan Angelov 5746ac4dd4
vfmt: remove tracing println for match branches 2021-01-31 11:05:49 +02:00
Delyan Angelov 978359a6fc
tests: fix some warnings in preparation for `-W test-self` 2021-01-31 11:05:17 +02:00
Delyan Angelov e066e83041
stbi: add proper declarations for C.stbi_load etc. 2021-01-31 10:23:43 +02:00
yuyi 2963425995
cgen: fix fn_with_mut_args (fix #7139) (#8446) 2021-01-31 02:45:45 +01:00
Nick Treleaven 9c2bd24b4f
tests: add test for s.$method() with T.methods (#8451) 2021-01-30 18:35:41 +01:00
BigBlack c5e7956eb5
checker: fix generic_mutable_arrays in functions (#8445) 2021-01-30 18:35:03 +01:00
Nick Treleaven 64d12cdc8d
checker: check number of C function arguments for some cases (#8444) 2021-01-30 18:33:36 +01:00
Daniel Däschle 2cadb3e4d8
gen: panic with correct type names (#8355) 2021-01-30 18:54:05 +02:00
Nick Treleaven 849bc6c3d8
tests: fix weird CI failure with error details (#8449) 2021-01-30 18:53:39 +02:00
Uwe Krüger 9c82eec529
checker: support nested propagation cases `f(g() ?)` (#8447) 2021-01-30 16:53:31 +01:00
Nick Treleaven 43c3a3b080
checker: fix compile-time call with string identifier expression (#8415) 2021-01-30 15:24:16 +01:00
Uwe Krüger 058f3ba013
sync: rename `m_lock() -> @lock()`, `r_lock() -> @rlock()`, ... (#8443) 2021-01-30 15:23:55 +01:00
Subhomoy Haldar 7e3b3a9efc
rand: update byte() (#8442) 2021-01-30 14:19:14 +01:00
div72 8c70920695
all: add offsetof (#8380) 2021-01-30 12:57:09 +01:00
Nick Treleaven c0685eeefc
parser: add warning for s.$field.name without brackets (#8411) 2021-01-30 12:56:10 +01:00
yuyi 97cb7687a2
cgen: minor cleanup of consts (#8441) 2021-01-30 13:35:25 +02:00
Enzo ced7649bf8
gen: fix `for ... in array` (#8428) 2021-01-30 12:27:11 +01:00
Lukas Neubert a044441224
fmt: keep {} in string interpolation for chained CallExprs (#8422) 2021-01-30 11:58:19 +01:00
Lukas Neubert 2774db077d
fmt: keep user choice for newlines in match branches (#8418) 2021-01-30 11:57:57 +01:00
yuyi 77b3d40f46
checker: fix `map = {}` (#8435) 2021-01-30 11:55:10 +01:00
Uwe Krüger 5e9b528a9d
checker/cgen: support `return` from nested `or` (#8430) 2021-01-30 12:46:36 +02:00
yuyi 5af16f38fc
cgen: correct minor typo (#8438) 2021-01-30 12:39:44 +02:00
Julia Bogdan Filipchuk d26ac0f6cb
vfmt: add ability to use vfmt as a filter from stdin to stdout (#8432) 2021-01-30 12:38:54 +02:00
Delyan Angelov 7f5d654c3a
all: cleanup redundant `.ends_with(_test.v)` calls 2021-01-30 11:08:52 +02:00
Uwe Krüger 6477748e88
sync/waitgroup: use value mutex and semaphore; remove sync.Waiter (#8431) 2021-01-30 11:08:43 +02:00
zakuro 391d62bca5
fmt: remove duplicated imports (#8433) 2021-01-30 11:04:36 +02:00
Delyan Angelov 760b4c37b9
all: support _test.vv files (to test _test.v errors/checks too) 2021-01-30 10:42:18 +02:00
Delyan Angelov 5564a2c1da
tests: fix filter_in_map_test.v (it did not have a `test_` function in it) 2021-01-30 10:29:48 +02:00
Delyan Angelov 948f63b507
checker,builder: rename `details:` to `Details:` 2021-01-30 10:20:09 +02:00
Delyan Angelov 30e0c478d7
checker: add error for _test.v file without test_ functions 2021-01-30 10:19:29 +02:00
Lukas Neubert 974cac2037
fmt: relocate two methods; minor cleanup (#8423) 2021-01-29 23:15:26 +02:00
Swastik Baranwal e03ece2a4b
checker: check the fn decl for anon fns too (#7529) 2021-01-29 23:11:05 +02:00
Uwe Krüger 4a955d9c54
sync: don't force `Mutex` and `Semaphore` to be reference (#8331) 2021-01-29 20:52:14 +02:00
Lukas Neubert 93acc929f7
fmt: keep lines of comments inside an array (#8420) 2021-01-29 20:19:14 +02:00
zakuro 2a32dac40d
checker: fix panic when calling generic function with too few args (#8416) 2021-01-29 20:14:22 +02:00
Delyan Angelov 8398e2f448
ci: fix -usecache for programs using thirdparty C libs 2021-01-29 19:44:33 +02:00
Delyan Angelov 9f31829e0c ci: fix failing clipboard_test.v on macos 2021-01-29 18:59:44 +02:00
Delyan Angelov 2326a3a1e1
builder: small cleanup, use .dump_c_options in Builder.cc_linux_cross/0 too 2021-01-29 18:30:40 +02:00
Delyan Angelov 4d180171ba
builder: implement `-dump-c-flags flags.txt` 2021-01-29 18:05:14 +02:00
Delyan Angelov 49b01549da
v.vcache: improve tracing of vcache usage 2021-01-29 18:05:13 +02:00
yuyi 26c06a56b7
checker: fix array_insert_or_prepend_short_struct_init (#8397) 2021-01-29 14:53:14 +01:00
yuyi 56c4a36cd4
cgen: fix match_in_if_expression (#8407) 2021-01-29 14:51:17 +01:00
Swastik Baranwal c4758c21c6
cgen: println(none) => `<none>` (#8404) 2021-01-29 14:50:48 +01:00
Louis Schmieder 4a6642b79e
vweb: fix vweb upload (#8392) 2021-01-29 14:48:52 +01:00
zakuro f5242890b8
fmt: keep multiline selective import (#8412) 2021-01-29 14:48:28 +01:00
yuyi ddcbc4440b
cgen: fix array_sort_by_references (fix #8390) (#8403) 2021-01-29 12:20:28 +02:00
Lukas Neubert e47c13903b
fmt: keep newlines between toplevel stmts (#8383) 2021-01-29 12:17:59 +02:00
Larpon 85c5df23cf
gg: add window_size() function (#8409) 2021-01-29 12:11:03 +02:00
Subhomoy Haldar c5a18812e2
rand: move constants from rand.util to a new module rand.constants (#8408) 2021-01-29 11:57:30 +02:00
Nick Treleaven d012f2713b
checker: improve errors with compile-time field access (#8373) 2021-01-29 00:45:00 +01:00
spaceface 4aee997689
checker: make implementing an interface with another interface an error (#8398) 2021-01-29 00:41:59 +01:00
Uwe Krüger adb646a1d2
sync: update benchmark results for Windows (#8399) 2021-01-29 00:41:46 +01:00
Alexander Medvednikov 608a4ccccd fmt: fix a bug with an empty module in consts 2021-01-29 00:26:57 +01:00
yuyi 1be7cc14d3
checker: check duplicate of a const name (#8396) 2021-01-28 18:34:55 +01:00
yuyi 684d2e6dbf
checker: merge ambiguous_function_call tests (#8388) 2021-01-28 15:53:54 +02:00
Delyan Angelov 4fcd8d8a98
scanner: fix `' "$var", "$another"'` where `r"`, was treated as start of a raw string 2021-01-28 15:38:42 +02:00
Delyan Angelov 079fbffaf5
scanner: implement s.trace/2 2021-01-28 15:21:19 +02:00
Uwe Krüger 0afe36e153
checker: fix receiver pos for single letter type error message (#8393) 2021-01-28 15:20:07 +02:00
Delyan Angelov 1a29719f16 fontstash: fix snek on big sur, with -d use_truetype 2021-01-28 12:26:48 +02:00
Lukas Neubert 75d85403a6
fmt: better ternary concat wrapping (#8379) 2021-01-28 11:23:48 +01:00
Alexander Medvednikov d86cb67eda checker: add a test for the single letter receiver 2021-01-28 11:13:51 +01:00
Alexander Medvednikov 68dab101d9 checker: fix one letter receiver panic 2021-01-28 11:05:37 +01:00
Alexander Medvednikov 36e75e5208 Revert "parser: fix panic when single letter receiver parsed (#8381)"
This reverts commit 93b0d8ca64.
2021-01-28 10:59:04 +01:00
Daniel Däschle 93b0d8ca64
parser: fix panic when single letter receiver parsed (#8381) 2021-01-28 10:56:43 +01:00
Tim Basel 5fc7eadd8b
cgen: fix short struct init with `mut` (#8384) 2021-01-28 10:05:09 +02:00
Subhomoy Haldar 5a1f3cd394
math.fractions: fix minor typo (#8386) 2021-01-28 10:02:41 +02:00
Delyan Angelov dceb63b9df
cgen: fix implicit the optional return value to have .ok = true, in anon `fn()?{}` 2021-01-28 02:26:02 +02:00
Delyan Angelov 242d7d0fc0
tools: improve error diagnostic for `v up` and `v self`. Make `v self` more robust. 2021-01-27 23:58:13 +02:00
zakuro 8162396783
checker: deny multi-value in a singe-value context (#8328) 2021-01-27 23:10:51 +02:00
shadowninja55 f4baa3f39c
gg: add draw_square, draw_empty_square, and set_pixel (#8375) 2021-01-27 22:39:11 +02:00
shadowninja55 fccd4f98d5
fixed offset (#8376) 2021-01-27 19:39:53 +02:00
yuyi d1ab22d45f
checker: fix array append short struct init (#8362) 2021-01-27 13:55:53 +01:00
Enzo 2b30c48770
checker: fix ctdefine check in non-main modules (#8332) 2021-01-27 13:54:33 +01:00
StunxFS cb885d30b4
scanner: fix typo (#8345) 2021-01-27 13:53:41 +01:00
Swastik Baranwal 17921f4171
checker: add checks for optional selector_expr (#8330) 2021-01-27 13:53:20 +01:00
Nick Treleaven 58a76344cb
checker: avoid SelectorExpr filter on Ident unless it's a generic type name (#8357) 2021-01-27 13:52:52 +01:00
spaceface e233911a7b
term.ui: native Windows console implementation (#8359) 2021-01-27 13:52:39 +01:00
Lukas Neubert 2ada7b730e
sqlite: create_table(): rename rows param to columns (#8361) 2021-01-27 13:52:27 +01:00
yuyi 7a5722c885
parser: check assign_stmt of undefined variable (#8366) 2021-01-27 13:52:10 +01:00
Delyan Angelov 2d86c50d49
ci: fix autobahn integration tests job 2021-01-26 20:12:12 +02:00
Delyan Angelov dd96852515
ci: fix compilation of term.ui examples on windows 2021-01-26 19:26:05 +02:00
Delyan Angelov 4e2b908f21
ci: fix `os` compilation on windows 2021-01-26 17:41:27 +02:00
Delyan Angelov e5a84719ca
all: require calling `optfn() ?` / `optfn() or {...}` for `fn optfn() ? {}` 2021-01-26 16:43:17 +02:00
Subhomoy Haldar 97103f680a
rand: separate rand.util and rand.seed submodules (#8353) 2021-01-26 15:55:09 +02:00
spaceface 5f2b2df546
checker: don't disallow defining methods on interfaces (#8335) 2021-01-26 11:56:17 +01:00
zakuro 3959ba5751
checker: make a calling no-body function a checker error (#8265) 2021-01-26 11:19:48 +01:00
Lukas Neubert 2007dbc7b5
fmt: put the opening brace on a new line again for infix (#8336) 2021-01-26 11:19:32 +01:00
Lukas Neubert 3790bd67e3
fmt: minor cleanup of sql_expr (#8340) 2021-01-26 10:36:46 +01:00
zakuro 22847d1ec3
fmt: assert (a == b) -> assert a == b (#8351) 2021-01-26 10:36:21 +01:00
Daniel Däschle 7bb9c0e7b3
checker: fix multi generic args (#8347) 2021-01-26 09:37:48 +02:00
Major Taylor 69c37402d4
backtrace: fix tcc backtrace windows compilation error (#8348) 2021-01-26 08:26:54 +02:00
Lukas Neubert c6f98afaba
fmt: minor cleanup of return_stmt (#8341) 2021-01-25 23:22:14 +01:00
Delyan Angelov 4d0dab826b
ci: fix vlib/dl/example/use_test.v in windows-tcc 2021-01-25 21:19:15 +02:00
Delyan Angelov dbaccd4272
vfmt: shorten `main.const_name` to just `const_name` 2021-01-25 20:57:33 +02:00
Delyan Angelov ea11488339
tests: make test more tolerant to windows low precision timer default interval 2021-01-25 20:04:29 +02:00
Delyan Angelov e0ed224a8d
Revert "net: prevent udp_test.v from running on windows without -d network"
This reverts commit 3526bc3d19.
2021-01-25 19:08:45 +02:00
Delyan Angelov 3526bc3d19
net: prevent udp_test.v from running on windows without -d network 2021-01-25 19:02:19 +02:00
spaceface daff085033
checker: fix treating C structs with capitalized fields as embeds (#8343) 2021-01-25 18:47:14 +02:00
Delyan Angelov cb04e6dccc
tests: move is_nodejs_working() to jsgen_test.v 2021-01-25 18:46:28 +02:00
yuyi 3199b982a9
cgen: minor cleanup of comp_for in comptime.v (#8337) 2021-01-25 17:08:48 +01:00
Daniel Däschle 006a11454f
cgen: fix generic type $else $if (#8339) 2021-01-25 17:08:02 +01:00
Swastik Baranwal 21ba0470af
builtin: fix truncating of EOL on windows terminal (#8338) 2021-01-25 17:51:36 +02:00
Delyan Angelov a5b10b5539
parser: improve the error message for unexpected keywords 2021-01-25 15:29:07 +02:00
yuyi 444d49da75
cgen: minor cleanup of gen_assert_stmt (#8334) 2021-01-25 15:28:34 +02:00
Nick Treleaven 02d8ede94d
cgen: fix `$if T !is` (#8311) 2021-01-25 14:25:52 +01:00
Lukas Neubert b2f2f387dc
fmt: cleanup and expand tests for ternary if (#8333) 2021-01-25 14:22:08 +01:00
yuyi 1c9950c84a
cgen: fix map_complex_high_order_fixed_array (#8329) 2021-01-25 14:40:53 +02:00
Delyan Angelov 965ae9cb91
ci: fix formatting in .md files too 2021-01-25 13:20:18 +02:00
Delyan Angelov 728344ff65
ci: fix `v test-cleancode` 2021-01-25 12:55:01 +02:00
Delyan Angelov 94fd3ff431
checker: remove the 'in module main cannot be declared public' error/warning 2021-01-25 12:55:00 +02:00
Delyan Angelov d3d301d8ff
gen: use externally_visible too for VV_EXPORTED_SYMBOL when ARM is defined 2021-01-25 12:40:28 +02:00
Adelar da Silva Queiróz 334554ffb9
strconv: fix typo (#8318) 2021-01-24 23:18:40 +01:00
yuyi d3327ba50f
cgen: fix for_mut_val_in_map_fixed_array (#8314) 2021-01-24 23:18:11 +01:00
Alexander Medvednikov 3dae3f786d gg: Context.resize() 2021-01-24 22:27:27 +01:00
spaceface 4be45e8d02
checker: add mutability checks for interface fields; add tests (#8312) 2021-01-24 22:11:17 +01:00
Uwe Krüger 815104e5d0
parser: parse `-1` and `-13.3` as number literals (#8321) 2021-01-24 22:09:51 +01:00
Lukas Neubert 997f56a3dc
fmt: better newline handling in block comments (#8325) 2021-01-24 22:08:24 +01:00
Daniel Däschle 750738aa12
cgen: fix optional sum types (#8319) 2021-01-24 20:56:44 +01:00