Commit Graph

8870 Commits (b0bc11216877cd28c485ee7757b09fec7bf20492)

Author SHA1 Message Date
yuyi 943a807d30
parser: implement generics method with auto multi generic types (#12312) 2021-10-27 15:41:13 +03:00
Larpon d53bb54c0a
toml: implement checks for UTF-8 validity (#12313) 2021-10-27 15:28:46 +03:00
Wertzui123 ea6d2d53db
parser: disallow `for mut in range` (fix #12234) (#12277) 2021-10-27 14:55:36 +03:00
Larpon 6eaacd3391
toml: improve checker documentation (#12315) 2021-10-27 14:31:29 +03:00
Lucas Jenß d7fd4a563b
parser: remove commented out debug statement (#12316) 2021-10-27 14:30:22 +03:00
Larpon 1b9eef74aa
toml: improve inline-table parsing (#12307) 2021-10-26 17:00:41 +03:00
Larpon c526752419
toml: remove unused enum (#12304) 2021-10-26 16:58:58 +03:00
Larpon 9a3967bd7d
toml: improve comment support (#12305) 2021-10-26 16:58:05 +03:00
Larpon 52df19ef61
toml: check for invalid placement of underscores around exponent (#12303) 2021-10-26 13:49:25 +03:00
Andreas Schoeller f14dabc6bd
math.big: add a new greatest-common-divisor-algo for big.Integer, also add a benchmark for it (#12261) 2021-10-26 11:10:13 +03:00
yuyi f62b2dcfa7
table: fix generic method with multi generic types (#12297) 2021-10-26 11:00:27 +03:00
Miccah 655b5c563a
net.http: use `[params]` for Config structs (#12299) 2021-10-26 10:45:27 +03:00
Delyan Angelov 06796a6119
ci,toml: add the new float/trailing-us-exp.toml to the ignored skip list for now 2021-10-26 10:42:40 +03:00
yuyi ac99007cab
table: fix generic sumtype instantiations (#12288) 2021-10-25 15:22:41 +03:00
kahsa 77a1e3dedb
gg: improve system_font_path on linux (#12290) 2021-10-25 15:16:29 +03:00
Bakul Shah cc2847f6ff
builtin: fix compilation with `-gc boehm` on some FreeBSD versions (#12289) 2021-10-25 10:24:08 +03:00
Delyan Angelov 45c1c1ab41
ci: fix import_symbol_private_err.vv and its .out file (time.since is no longer private) 2021-10-24 22:06:32 +03:00
Delyan Angelov 49ebba535e
time: implement `pub fn since(t Time) Duration` 2021-10-24 21:36:28 +03:00
Delyan Angelov bb71089b70
os: make the os_test.v functions more robust on windows (normalise the returned paths before comparing them) 2021-10-24 19:54:00 +03:00
Delyan Angelov e99b699ac6
os: make os.mkdir_all more robust (honor / on windows too), add a test for it 2021-10-24 19:16:46 +03:00
Delyan Angelov f34daf9ff4
os: add os.walk_with_context/3 and a test for it 2021-10-24 19:12:14 +03:00
Delyan Angelov e34046a0e1
os: remove `pub` from impl_walk_ext 2021-10-24 18:48:54 +03:00
Delyan Angelov d1c4b470bc
os: make os.ls('') return an error, make os.walk_ext more memory efficient on deep hierarchies, add tests for os.walk_ext 2021-10-24 18:44:13 +03:00
Delyan Angelov d9c6c9a7df
http: cleanup download_file, remove unimplemented download_file_with_progress 2021-10-24 17:19:44 +03:00
playX 2eae4cf63e
js: fix optional error propagation (#12283) 2021-10-24 15:56:44 +03:00
Delyan Angelov c340906280
cgen: cleanup vinit_string_literals, _vcleanup and reload_so declarations 2021-10-24 15:29:42 +03:00
zakuro 242b99340d
vfmt: fix bug where duplicated comma is placed before comment in array init (#12281) 2021-10-24 12:05:34 +03:00
penguindark 47a2301139
regex: add OR error, if sourounded by char classes, and a test (#12278) 2021-10-24 11:54:51 +03:00
Delyan Angelov e45cd02029
mysql: always use `#include <mysql.h>`, rely on pkgconfig to get the correct include folder 2021-10-23 21:22:10 +03:00
Delyan Angelov 008d15dcb5
builder,pref: add support for `-no-builtin` (useful for writing Linux kernel modules) 2021-10-23 12:53:53 +03:00
Delyan Angelov aa22751d26
vlib: remove unused `glm` module (#12274) 2021-10-22 22:23:14 +03:00
playX 864d6eae6b
js: codegen & vlib fixes, replace the Game of Life CLI example (#12272) 2021-10-22 22:03:19 +03:00
Larpon 8a4756819a
toml: disallow unclosed arrays (#12273) 2021-10-22 20:30:29 +03:00
Larpon 8273c0582b
toml: check for illegal characters, fix all related skipped tests (#12270) 2021-10-22 19:57:32 +03:00
Larpon eb364f0301
toml: check for exponents starting with an underscore (#12271) 2021-10-22 19:56:43 +03:00
Delyan Angelov eed94c727c
os: move C struct declarations in their own _default.c.v files (#12268) 2021-10-22 17:08:08 +03:00
Delyan Angelov 0401b5ece0
mysql: fix compilation with libmariadb-dev, but no libmysqlclient-dev installed 2021-10-22 16:44:08 +03:00
Larpon 76ff708cf8
toml: squash recently fixed invalid tests (#12266) 2021-10-22 13:38:36 +03:00
Larpon cc2ef4188d
toml: support parsing (+/-)nan and (+/-)inf (#12256) 2021-10-22 08:16:47 +03:00
ChAoS_UnItY 5b69593766
cgen,js: fix missing break in switch case, generated by match with range branches (#12260) 2021-10-21 22:30:05 +03:00
czkz da7dad07a3
builder: fix sigint handling for `v run` (#12246) 2021-10-21 16:40:32 +03:00
Larpon 909ed76b8f
toml: check binary, octal and hexadecimals literals (#12255) 2021-10-21 16:37:38 +03:00
a-iga 1ba839dc3b
openssl: change `read_into` to `read` (#12251) 2021-10-21 14:13:04 +03:00
Larpon a84b1a53ec
toml: fix bin, oct and hex capital identifier check (#12254) 2021-10-21 14:12:17 +03:00
czkz 5607224be6
docs: improve os.ProcessState markdown rendering (#12245) 2021-10-21 11:19:01 +03:00
yuyi ff02c19827
table, builder, checker: cleanup unwrap_generic (#12241) 2021-10-21 05:48:02 +03:00
playX 57c79770b3
js: port more methods (os, builtin) (#12238) 2021-10-20 16:02:21 +03:00
Lance Fredrickson 7c1fff3495
builder: pass `-std=gnu99` to the C backend under linux (#12236) 2021-10-20 14:26:25 +03:00
05st 3e52d54586
cgen: fix match expr when evaluating to sumtype (#12237) 2021-10-20 11:52:11 +03:00
Delyan Angelov ef0eaeee08
ci: fix broken js tests 2021-10-19 20:05:27 +03:00
ChAoS_UnItY ab350d52ec
cgen: support RangeExpr while emitting enum switch case (#12226) 2021-10-19 17:02:22 +03:00
Alexander Medvednikov 45534b512b time: move pure V function from time.c.v 2021-10-19 16:03:45 +03:00
Delyan Angelov f2cda1a529
parser: update p.inside_or_expr consistently (fix `v fmt -w vls/analyzer/symbol_registration.v`) 2021-10-19 13:36:10 +03:00
yuyi 6aca360507
parser: fix checking unexpected name (#12233) 2021-10-19 12:27:59 +03:00
playX c1aa782a6c
js,checker: fix some modules build for `v -b js self`, fix `or block` check in ast.CallExpr (#12231) 2021-10-19 12:11:54 +03:00
xiao xigua 108644d260
vweb: add `file` method to vweb.Context, make the existing `json` method generic (#12211) 2021-10-18 18:25:06 +03:00
Delyan Angelov b23984a211
builder: only print the thirdparty object rebuilding line with '-v' 2021-10-18 13:28:09 +03:00
ChAoS_UnItY 53c2e262f1
cgen & jsgen: generate when possible a `switch` from `match x {` (#12216) 2021-10-18 10:59:52 +03:00
playX a3de67de28
js: support WASM interoperability using `wasm_import`/`wasm_export` fn tags (#12212) 2021-10-18 10:56:21 +03:00
lydiandy 2070839722
io: pub the RandomReader interface (#12222) 2021-10-18 10:51:36 +03:00
Delyan Angelov 5dd3864617
markused: fix `v -skip-unused cmd/tools/vpm.v` regression after 98b2bdb 2021-10-18 08:43:56 +03:00
Delyan Angelov 735c961682
autofree: add skipped string_plus_string_plus.v sample 2021-10-17 19:46:35 +03:00
Delyan Angelov 6e4bda3741
strconv: fix string builder leaks in format_dec_old, format_es_old, format_fl_old, v_sprintf 2021-10-17 19:46:34 +03:00
Delyan Angelov 1313dcf601
gg: fix leak in draw_image_with_config 2021-10-17 19:46:34 +03:00
lydiandy 98b2bdb410
io: cleanup ReaderWriter interface (#12218) 2021-10-17 19:39:51 +03:00
czkz 3a073329ff
builder: use os.new_process() instead of os.system() in v run (#12214) 2021-10-17 19:01:34 +03:00
yuyi a006090b08
ast: minor cleanup of register_type_symbol (#12213) 2021-10-17 15:50:42 +03:00
czkz 29f068997b
math: add fn clamp (#12205) 2021-10-17 06:42:40 +03:00
05st fd3a10ab43
checker: fix mut check bypass with for in loops (#12208) 2021-10-17 06:41:39 +03:00
Alexander Medvednikov e6b7ab8b9d net.http: authority header 2021-10-17 06:40:19 +03:00
Delyan Angelov dee4ffbc99
builder: make -usecache rebuild cached, but changed modules, and their dependants (#12193) 2021-10-15 12:22:59 +03:00
yuyi c108e01917
checker: fix generic fn return types with generic struct (#12186) 2021-10-15 11:50:10 +03:00
yuyi 27cd21e459
cgen: fix infix ops, for cross assignments of types with overloaded operators (#12192) 2021-10-15 11:32:58 +03:00
playX 814b4ebb4c
term: get_terminal_size() for js_node, term.clear() for all js backends (#12189) 2021-10-15 10:10:40 +03:00
playX d3887c1568
time: fix sys_mono_now for the JS backend (#12187) 2021-10-15 09:22:15 +03:00
czkz c29a5cdedb
term: fix readme typo (#12180) 2021-10-15 06:08:31 +03:00
ChAoS_UnItY 4d1307f29b
all: index accessor in array init expression (#12181) 2021-10-15 03:57:49 +03:00
yuyi c9b2f878b3
parser, checker: optimize checking generic struct type mismatch (#12179) 2021-10-15 00:11:31 +03:00
Ulises Jeremias Cornejo Fandos 4490d5ed29
context: cleanup the tests and the documentation (#12175) 2021-10-14 13:32:42 +03:00
Delyan Angelov 4c2cb1b6df
vdoc: prevent leaking to the docs the `pure_v_but_overriden_by_` prefix 2021-10-14 11:47:50 +03:00
yuyi 05885059bd
cgen: remove the extra generated parentheses of single in_expr (fix #12158) (#12168) 2021-10-14 11:38:16 +03:00
ChAoS_UnItY 6f629d1a6a
transformer: eliminate unreachable branches & redundant branch expressions in MatchExpr (#12174) 2021-10-14 02:15:52 +03:00
nyx-litenite 5b9553d5c4
orm: fix last_id() call in mysql (#12173) 2021-10-13 21:24:07 +03:00
Larpon 5bfa3d5530
sokol: add screenshot function to OpenGL based backends (#12169) 2021-10-13 21:22:58 +03:00
yuyi 97e999768a
checker: fix generic fn return array of generic struct (#12170) 2021-10-13 21:21:32 +03:00
playX d373eba79b
js: implement more functions for JS backend (#12167) 2021-10-13 09:40:14 +03:00
pancake ade5774313
native: fix return `a+b` infix construction (#12161) 2021-10-12 19:38:17 +03:00
Delyan Angelov 6c728cf389
js: add draft support for -skip-unused (hello_world.v works) 2021-10-12 19:34:37 +03:00
pancake 1d2b56d71d
native: fix example exit((1,2)->(a,b)return a+b) (#12154) 2021-10-12 18:51:28 +03:00
pancake 347ebe5fd3
native: append .exe, when using the native backend on windows (#12159) 2021-10-12 18:49:42 +03:00
pancake a0a0ae85eb
native: add support for pe64 when -os windows is used (#12149) 2021-10-12 10:43:40 +03:00
playX 22962dd2d2
js: change codegen for match statement, speedup string.split_into_lines (#12157) 2021-10-12 09:52:16 +03:00
Alexander Medvednikov cfc56b24fb vweb: fix [post] route matching 2021-10-12 08:18:04 +03:00
Alexander Medvednikov da58ba0d5c vweb: populate action method params with form values 2021-10-12 07:10:12 +03:00
Anton Zavodchikov 4d7bb95c2f
vweb: add a `vweb_global` attribute (#12064) 2021-10-12 06:35:36 +03:00
pancake 5eba02ea94
native: fix stackframe bug on return statements (#12153) 2021-10-12 06:03:44 +03:00
penguindark 0fafefc078
regex: bug fix on find groups indexes (#12152) 2021-10-12 06:03:23 +03:00
Delyan Angelov 3c8be0db72
tests: reduce maxn in builder_test.js.v to just 1000 for now (runs in under 200ms, vs ~240s before that) 2021-10-11 19:57:35 +03:00
Delyan Angelov 9fabf9f20c
checker: check for `x := Abc { f: fn () ? {} }` mismatch, when `f` is `fn ()` 2021-10-11 19:20:41 +03:00
Alexander Ivanov 0386f2bbea
checker: add an interface check for mutability, fixes #1081, fixes #7038 (#11963) 2021-10-11 15:41:31 +03:00
ChAoS_UnItY d0c961ebc0
transformer: eliminate unreachable branches in IfExpr and fold more expressions and statements (#12135)
* v: fix using constant as length in fixed array

* format test file

* v/trasnformer: discard unreachable if branches

* transform more expressions and statements

* replace IfExpr with EmptyExpr when all branches were eliminated

* fix typo

* fix gens

* only allows branch elimination on if expression statement

* fix native gen

* fix handling of multi branch ifs in the native backend, also allow for `if true {}`

Co-authored-by: KyleLin921021 <43753315+KyleLin921021@users.noreply.github.com>
Co-authored-by: Delyan Angelov <delian66@gmail.com>
2021-10-11 14:29:17 +03:00
Ulises Jeremias Cornejo Fandos 35b301f73c
math: add some benchmark tests (#12142) 2021-10-11 14:20:07 +03:00
05st 3e02cfd528
cgen: fix `in` op usage on array of sumtypes without cast (#12141) 2021-10-11 14:17:04 +03:00
Delyan Angelov ceb24bc32e
tests: show the number of parallel jobs used while testing 2021-10-11 13:10:55 +03:00
yuyi 1831eccd5e
checker: check generic struct using in non-generic fn (#12136) 2021-10-11 02:46:44 +03:00
05st e69df54a36
cgen: fix multi-return in if/match exprs (#12139) 2021-10-11 02:45:01 +03:00
Ulises Jeremias Cornejo Fandos 0f7dfb984a
math: remove the C backend for f64 functions (#12121) 2021-10-10 11:21:48 +03:00
yuyi 83bc9b35b1
ast: fix checking generic fn call with fntype arg mismatch (#12132) 2021-10-10 11:14:19 +03:00
Yeuda By 8d5931c96c
orm: fix a typo (#12131) 2021-10-10 03:47:35 +03:00
ChAoS_UnItY 3647fc6633
parser: perform constant folding before checking size of fixed array (#12126) 2021-10-10 01:55:25 +03:00
yuyi 093cab6f56
checker: check generics struct init that types mismatch (fix #12115) (#12120) 2021-10-09 15:03:37 +03:00
pancake 7a6491b9b0
native: initial implementation of C.syscall (#12098) 2021-10-09 15:01:30 +03:00
Delyan Angelov d14b5d0c11
ci: reduce flakyness of vlib/v/pref/options_test.v on ubuntu 2021-10-09 12:58:21 +03:00
playX e267106220
math: implement logarithm function in pure V (#12111) 2021-10-09 11:17:09 +03:00
Delyan Angelov 23e679475c
time: sanity check parsed date/times 2021-10-09 11:05:49 +03:00
yuyi 3c7c11e55b
cgen: fix sumtype with none type (fix #12101) (#12102) 2021-10-09 03:32:37 +03:00
05st 43931be451
math: sqrti, powi, factoriali (#12072) 2021-10-08 22:07:44 +03:00
05st cd5b304cbf
cgen: add interface case for gen_struct_equality_fn (#12094) 2021-10-08 19:04:24 +03:00
playX a8ace2c41c
math: implement `pow` in pure V (#12105) 2021-10-08 17:44:55 +03:00
Delyan Angelov 60add6cc28
ci: fix failing tests 2021-10-07 19:22:08 +03:00
Alexander Medvednikov c356e347f5 pref: do not allow -prod with v run 2021-10-07 16:13:58 +03:00
playX 33a1006cc5
js: comptime&assert improvements, more `byte` and `strings.Builder` methods ported (#12096) 2021-10-07 15:55:47 +03:00
Larpon 42359d8915
toml: fix error return in value parsing (#12097) 2021-10-07 15:51:18 +03:00
Larpon 09cc0c7247
gg: use sgl.begin_points for pixels + improve pixels example (#12085) 2021-10-07 10:46:57 +03:00
Larpon 53aa4eba0d
sokol: add sg_isvalid wrapper to gfx (#12081) 2021-10-07 10:41:57 +03:00
Larpon f454d30318
gg: use sgl.begin_triangles when drawing triangles (#12083) 2021-10-07 03:45:23 +03:00
Larpon 42c088896a
gg: mute font print on Linux, use flag debug_font instead (#12082) 2021-10-07 03:45:02 +03:00
pancake 32259af2c9
v.parser: improve error message when no arch is set 'asm{}' (#12093) 2021-10-07 03:44:27 +03:00
Delyan Angelov e53682320c
v.gen.c: fix compiling `go f(x)` for `x` of the same struct in different .v files with parallel cgen 2021-10-06 22:12:21 +03:00
yuyi 0d53705776
v.checker: check fn returning void type (fix #12076) (#12078) 2021-10-06 21:04:33 +03:00
yuyi 963233687e
v.fmt: fix fmt of 'fn(mut a &int)' (#12075) 2021-10-06 20:51:38 +03:00
yuyi f1742a6f62
v.ast: change 'type.to_ptr()' to 'type.ref()' (#12086) 2021-10-06 20:49:39 +03:00
Wertzui123 77c18f4435
cgen: fix alphabetic order of ast statement generation (#12080) 2021-10-06 14:32:42 +03:00
playX b2945e916f
js: add initial support for runes (#12077) 2021-10-06 10:43:49 +03:00
Delyan Angelov 115493781b
tests: make the output of coutput_test.v more accurate/easily reproducible in case of failures 2021-10-06 10:15:18 +03:00
Delyan Angelov 5bc8b4dadb
os: implement support for VOPEN_URI_CMD env override for os.open_uri 2021-10-06 06:33:04 +03:00
Delyan Angelov 2526aca75f
tests: fix typo in coutput_test.v (thanks Jalon) 2021-10-06 00:33:01 +03:00
Delyan Angelov efa1092199
v.gen.c: add coutput tests for the `[console]` codegen to prevent future regressions 2021-10-06 00:14:16 +03:00
Delyan Angelov aa8915bdf6
v.gen.c: fix `[console]` handling for `sokol` programs on windows with parallel cgen 2021-10-05 23:57:14 +03:00
Delyan Angelov 6d2c1f7e2c
v.gen.c: enable again parallel cgen for `-g`, make `-g` more robust 2021-10-05 21:51:49 +03:00
crthpl 7cf9c198fe
asm: add segment addressing and fix [10] (#12068) 2021-10-05 18:57:15 +03:00
Delyan Angelov 514443a019
ci: comment out a failing assert in the tests for `os.notify` 2021-10-05 16:01:54 +03:00
Delyan Angelov eef8017281
ci: reduce flakyness of notify_test.v, by re-trying it 3 times 2021-10-05 15:50:38 +03:00
Delyan Angelov ccb5f1d563
tests: support `// vtest vflags: -prod` in `coutput_test.v`.
Use it, to add a `-prod` test for `$embed_file()`,
to prevent future codegen regressions.
2021-10-05 15:44:12 +03:00
Delyan Angelov e23d61d99e
v.pref: disable the parallel cgen when `-g` is given for now (the line numbers/paths are wrong) 2021-10-05 15:08:28 +03:00
Delyan Angelov 92f2e5bad2
v.gen.c: fix compilation with `-prod`, for files using `$embed_file()` (regression after parallel cgen in 85b58b0) 2021-10-05 15:06:17 +03:00
Delyan Angelov b4d1429ef0
tests: rename `as_cast_literal.v` to `as_cast_literal_test.v` 2021-10-05 11:57:57 +03:00
yuyi 7bc3e67e24
fmt: fix import with symbols (fix #12065) (#12069) 2021-10-05 11:44:48 +03:00
05st 7555b337b9
cgen: fix expr_as_cast for int/float literals (#12067) 2021-10-05 09:53:05 +03:00
playX 8d1ba52d0c
js: fix string.bytes codegen, readline, add tests for `strings` (#12060) 2021-10-04 18:28:30 +03:00
yuyi e94e08475d
cgen: format shared structs (#12062) 2021-10-04 18:27:38 +03:00
yuyi 03269f9854
cgen: fix error of reference struct str() (#12061) 2021-10-04 09:58:50 +03:00
Larpon a8c2c419cd
builtin: improve malloc panic messages (#12054) 2021-10-03 20:27:46 +03:00
Delyan Angelov bfb8116623
ci: let process_test.v repeatedly fail 3 times, before consider it failed 2021-10-03 20:26:38 +03:00
yuyi 82e6d6e51d
cgen: fix threads array wait without go calls (fix #12009) (#12050) 2021-10-03 18:24:44 +03:00
Larpon b62520af9e
os: fix rare crash in read_file. Fix #12052 (#12053) 2021-10-03 18:24:06 +03:00
Anton Zavodchikov 895daf297f
vweb: router refactor (#12041) 2021-10-03 16:26:44 +03:00
Ekopalypse 9be16eba63
v.gen.c: add tests to ensure the same calling convention is used on exported functions for -m32/-m64 (#11977) 2021-10-03 15:47:08 +03:00
spaceface 9b6e07e2a6
cgen: support `index` and `in` for sumtype/interface arrays (#12051) 2021-10-03 15:44:13 +03:00
yuyi 10caf4a84a
cgen: cleanup generated thread wait code (#12048) 2021-10-03 10:52:29 +03:00
playX 9145cd66ec
js: add more tests to builtin/js and implement more builtin functions (#12049) 2021-10-03 10:08:21 +03:00
05st 129c81f34d
cgen: implement eq operator for interfaces (#12047) 2021-10-03 09:04:05 +03:00
05st f282e64fe3
arrays: add binary_search, lower_bound, and upper_bound array operations (#12045) 2021-10-03 08:14:39 +03:00
Nicolas Sauzede 117091452b
os: workaround `_ = C.pipe(&pipeset[0])` gcc warning `warning: ignoring return value of pipe declared with attribute warn_unused_result` (#12046) 2021-10-03 08:09:08 +03:00
05st 86a5e72c74
v.checker: fix return type checking being skipped for mutable method receivers (#12043) 2021-10-02 23:26:46 +03:00
Delyan Angelov 02e4aa0f0e
v.checker: fix panic for `a, b, c = fn_returning_several_maps()` 2021-10-02 18:40:35 +03:00
Delyan Angelov 0916806350
ci: do not use htonll and ntohll on windows, use the portable versions instead. 2021-10-02 18:21:16 +03:00
Delyan Angelov 9a4dbc25ca
ci: fix failing conv_test.v on windows 2021-10-02 15:51:48 +03:00
Anton Zavodchikov 4c8094d0d9
net.http: make public errors and parse_form (#12038) 2021-10-02 15:28:35 +03:00
Anton Zavodchikov 600880660a
net.http: add a deprecated attribute for un/escape functions (#12037) 2021-10-02 15:19:32 +03:00
Delyan Angelov c86935309e
v.gen.c: fix compilation of `if c_struct_1 != c_struct_2 {` 2021-10-02 15:12:18 +03:00
05st cc4af235f3
cgen: fix if-expression code generation if it evaluates to propagating optional / or block (#12032) 2021-10-02 14:30:04 +03:00
Delyan Angelov d1d4877348
net.conv: add a test for the nth16/nth32/nth64/htn16/htn32/htn64 functions 2021-10-02 13:26:09 +03:00
playX 82f187e5e0
js: fix `rand` build, properly use key values on map, add `rand.string` (#12020) 2021-10-01 21:23:49 +03:00
05st 60ecbec8ea
cgen: fix closure code gen with if statement in definition (#12028) 2021-10-01 16:52:34 +03:00
Alexander Ivanov cb149bfa00
checker: show errors for index calls to values which are not functions, fixes #11539 (#12024) 2021-10-01 15:17:02 +03:00
zakuro ce0867f40c
vfmt: fix removal of selective imported type used in map (#12030) 2021-10-01 15:14:21 +03:00
Delyan Angelov 41de0c3c6a
ci: fix `v -cc gcc -cstrict examples/pico/pico.v` 2021-10-01 13:49:38 +03:00
Delyan Angelov 6f7c3a7cdf
ci: do `brew install openssl` on the macos job, reduce flakyness of tcp_test.v 2021-10-01 13:13:05 +03:00
Delyan Angelov 2bdba5ed73
net: fix declarations of C.htonl/C.htons/C.ntohl/C.ntohs in aasocket.c.v 2021-10-01 12:57:47 +03:00
Delyan Angelov 149517ced4
v.builder,v.gen: time Builder.front_stages.parse_files, Builder.resolve_deps, Gen.sort_structs 2021-09-30 20:49:19 +03:00
Alexander Medvednikov 4a6d161c08 orm: postgres fixes 2021-09-30 20:00:27 +03:00
Larpon 8705db5844
toml: fix scanner escape collecting in literal strings (#12022) 2021-09-30 16:04:21 +03:00
Alexander Medvednikov d4b3c65c45 cgen: a minor optimization; checker: a c2v fix 2021-09-30 12:51:53 +03:00
Wertzui123 e3d379a1eb
builtin: add byte.repeat() and rune.repeat() (#12007) 2021-09-30 09:32:20 +03:00
Louis Schmieder f9ceb12e22
checker: fix orm cast check (#12018) 2021-09-30 00:43:08 +03:00
Larpon e3d3727c0c
toml: fix 7 escape tests (#12017) 2021-09-29 19:28:09 +03:00
Alexander Medvednikov c2f535fee1 ci: run the gitly web server test 2021-09-29 19:26:49 +03:00
playX 4333a53f28
js: support running `.js.v` tests in `v test-self`, fixes for array methods & codegen (#12011) 2021-09-29 15:33:14 +03:00
Larpon 4ff061927b
toml: easier scanner configuration (#12016) 2021-09-29 14:53:06 +03:00
yuyi f2c710d306
cgen: fix fn mut args with interface type (#12012) 2021-09-29 13:54:23 +03:00
yuyi 8789cc422c
v.ast: fix fmt of 'bytestr' to '&byte' (#12014) 2021-09-29 13:53:46 +03:00
Larpon d39fec3479
toml: fix unbalanced quoted tests (#12006) 2021-09-29 10:19:49 +03:00
Delyan Angelov 24c1d552d7
ci: vfmt vlib/v/gen/c/cgen.v 2021-09-29 08:58:27 +03:00
André Diego Piske 8dde9d4a7b
cgen: fixes for ... in with index (#11995) 2021-09-28 19:35:07 +03:00
yuyi 5d3795e876
cgen: fix the C codegen error for '_ = map[key]' (fix #11999) (#12000) 2021-09-28 18:45:50 +03:00
Larpon bc4aad5fb4
toml: add quote details to ast.Quoted (#11997) 2021-09-28 17:40:03 +03:00
Delyan Angelov 87fe15e39f
ci: fix typo 2021-09-28 15:30:05 +03:00
Delyan Angelov 3467ab1551
ci: fix the `g++` build and the `alpine-musl` task 2021-09-28 15:29:00 +03:00
Delyan Angelov d07a96ede8
v.gen.c: fix `v examples/hello_world.v` on FreeBSD 2021-09-28 12:00:34 +03:00
Delyan Angelov 8f4fe61381 v.pref: only show the `disabling parallel cgen` message when -no-parallel was not given and -prealloc was 2021-09-28 11:52:27 +03:00
Delyan Angelov 97eb0fc74f ci: workaround linking on macos (missing sem_timedwait) 2021-09-28 11:27:47 +03:00
Delyan Angelov 9e2607db57
sync: rename sync_macos.c.v to sync_darwin.c.v 2021-09-28 11:12:03 +03:00
Delyan Angelov 6b40ead54d
fix `./v -cc g++ run examples/concurrency/concurrency_http.v` 2021-09-28 10:35:02 +03:00
crthpl 85b58b03a3
cgen: parallelize (#10844) 2021-09-28 10:28:04 +03:00
Ken a17b943e87
builtin: add method `byte()` for string (#11998) 2021-09-28 10:08:10 +03:00
Ulises Jeremias Cornejo Fandos c151e075e1
context: update ValueContext to handle Any value and more Key types, use closures (#11993) 2021-09-27 17:52:20 +03:00
yuyi d6a4bce2ef
checker: fix generic array.map with generic callback fn (#11991) 2021-09-27 17:50:15 +03:00
Larpon 2ee873d6ca
toml: fix invalid bad-multiline test (#11996) 2021-09-27 17:42:20 +03:00
Wertzui123 07d65b2aab
builtin: move byte methods from rune.v to int.v (#11987) 2021-09-26 22:34:25 +03:00
czkz 6967a47e07
net.openssl: fix typos in comments (#11988) 2021-09-26 22:33:10 +03:00
Delyan Angelov 6a2ef733de
v.parser: add a generated `.all(.flag1|.flag2)` method to `[flag]` enums
Unlike `.has(.flag1|.flag2)`, which is true, for any of `.flag1` or `.flag2`,
the new method `.all()` tests whether *all flags* are set at the same time.
2021-09-26 21:40:44 +03:00
Rémi 09dfc3f301
arrays: add a generic `arrays.concat(os.args,'abc','xyz')` function (#11985) 2021-09-26 19:41:50 +03:00
yuyi 4c01627e00
cgen: cleanup stmt_path_pos processing (#11983) 2021-09-26 15:51:18 +03:00
yuyi d93737dd34
cgen: fix assign map get to blank (fix #11508) (#11982) 2021-09-26 13:07:51 +03:00
Louis Schmieder 6391f3d2da
orm: fix other int types (#11981) 2021-09-26 11:17:56 +03:00
yuyi e09860731f
cgen: fix if expr with complex nested array call (#11979) 2021-09-26 07:35:48 +03:00
Larpon da47638f42
toml: correct documentation (#11976) 2021-09-26 07:34:47 +03:00
playX 863dd0b23e
js: array improvements (#11952) 2021-09-26 07:33:53 +03:00
penguindark f3757a7cd1
strconv: float memory leak fix (#11980) 2021-09-26 07:33:35 +03:00
yuyi d329e1decd
cgen: fix if expr with nested array calls (fix #11953) (#11973) 2021-09-25 20:38:33 +03:00
Larpon 13b2aa701c
toml: rename ast.Node -> ast.Value (#11974) 2021-09-25 20:31:02 +03:00
Anton Zavodchikov 80c15607da
json: assert encoded struct with a sumtype (#11970) 2021-09-25 20:29:52 +03:00
Larpon 970768288d
gg: expose sapp_desc.swap_interval via gg.Config (#11975) 2021-09-25 15:06:56 +03:00
Miccah 956fdffd96
net.http: allow custom headers in post_multipart_form (#11971) 2021-09-25 10:09:49 +03:00
Larpon 5541ec8670
vlib: add toml module + tests (#11964) 2021-09-24 21:13:52 +03:00
Ruofan XU 834cf40ab2
cgen, fmt, scanner: fix and use nested lambda in scanner (#11967) 2021-09-24 18:21:22 +03:00
Ekopalypse 400ab7876b
ast: fix fixed array typedef generation issue (#11962) 2021-09-24 17:01:42 +03:00
Anton Zavodchikov c75271fcb7
cgen: json sumtype inlining (#11961) 2021-09-24 16:49:00 +03:00
yuyi 430677a0c0
cgen: format generated C code of nested array call (#11955) 2021-09-23 19:56:12 +03:00
Delyan Angelov ad58fe8249
ci: mark cancel_test.v with `vtest retry: 3` 2021-09-23 14:55:10 +03:00
zakuro b354f9ae9a
cgen: fix c error of if-expression when debug mode (#11950) 2021-09-23 14:52:32 +03:00
Delyan Angelov 4a0d00fb30
io.util: simplify random number generation in util.v 2021-09-23 14:20:39 +03:00
Delyan Angelov afc3531945
ci: work around a failing g++ compilation (order of methods in an interface dispatching table matters for C++ compilers) 2021-09-23 14:08:50 +03:00
Delyan Angelov ece5fa183c
fast.v: freebsd fixes 2021-09-23 13:48:41 +03:00
Delyan Angelov 930b95f76c
v.gen.c: fix uninitialised value usages regression after e5fb4e4 2021-09-23 12:24:03 +03:00
Delyan Angelov 8837712f2b
rand: fix leaks with -autofree 2021-09-23 12:24:03 +03:00
Delyan Angelov 79e33d92f1
v.markused: remove `hash.init()` function (map fn usages are detected more precisely) 2021-09-23 12:24:02 +03:00
trollkarlen b52f79e137
log: add temporary get_level() (#11946) 2021-09-23 12:05:11 +03:00
Alexander Ivanov 4d0f835548
checker: fix detection of invalid insertions, fixes #3600 (#11945) 2021-09-23 11:59:43 +03:00
Alexander Medvednikov 27f5c35bde autofree: test returning optionals 2021-09-23 09:18:01 +03:00
yuyi b8935551f1
cgen: fix nested array call (#11948) 2021-09-23 08:50:37 +03:00
Alexander Medvednikov 7b60367512 autofree: free reference types with -experimental for now 2021-09-23 04:35:09 +03:00
Ruofan XU 52b53f17b2
scanner: clean up scanning of `>` (#11943) 2021-09-23 02:24:23 +03:00
Delyan Angelov bf2569a9a8
all: support `mut volatile x := 123` declarations (#11940) 2021-09-22 13:06:30 +03:00
yuyi 76e360ce86
cgen: format the generated C code for array map/filter/all/any methods (#11936) 2021-09-22 09:24:36 +03:00
yuyi e5fb4e4845
cgen: fix if expr with array call (fix #11557) (#11569) 2021-09-22 02:21:18 +03:00
Alexander Ivanov b9720f5d9e
cgen: fix struct init with multiple branches, fixes #11564 (#11570) 2021-09-22 00:46:07 +03:00
yuyi 2f3925a0cf
fmt: format vlib/v/token/token.v (#11568) 2021-09-21 23:29:53 +03:00
yuyi de4c0c237b
cgen: fix if infix expr with array.all/any() (#11567) 2021-09-21 16:20:41 +03:00