1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

8637 Commits

Author SHA1 Message Date
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