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

9619 Commits

Author SHA1 Message Date
yuyi
92cafd8851
checker: check invalid 'mut' keyword in infix expr (#13742) 2022-03-15 14:50:17 +03:00
yuyi
1d83ab6be1
parser: check using invalid keyword with none ident (#13743) 2022-03-15 12:58:03 +02:00
playX
78b1cbefff
builtin.wasm_bare: fix malloc invocation (#13740) 2022-03-15 12:55:39 +02:00
Nick Treleaven
34dd4f34ab
checker: fix cgen error on sliced references (#13736) 2022-03-14 19:52:37 +02:00
yuyi
ea3c0166c0
ast: fix error for typeof aggregate (#13735) 2022-03-14 18:42:47 +02:00
yuyi
dbb18e3656
parser: fix error for match branch with array expression (#13733) 2022-03-14 16:19:05 +02:00
pancake
a1d0db792e
native: initial support for typeof() expressions (#13730) 2022-03-14 15:15:06 +02:00
kylepritchard
a8f6574471
math: allow i64 in digits function and add count_digits function (#13729) 2022-03-14 10:41:01 +02:00
playX
c8b0f51c13
builtin.wasm_bare: use walloc as malloc/free implementation (#13731) 2022-03-14 09:20:20 +02:00
yuyi
f7feb634d2
checker: fix error for if mut with immutable variable (#13728) 2022-03-13 16:33:50 +02:00
Mihai Galos
9495aacf3e
datatypes.fsm: add a fsm_graph.v tool (#13723) 2022-03-13 11:40:03 +02:00
Adam Oates
424ef0b2b8
stbi: fixed panic when trying to load JPG (#13724) 2022-03-13 09:57:34 +02:00
yuyi
27f9bc9ba0
checker: check error for match mut with immutable variable (fix #9704 #8976) (#13725) 2022-03-13 09:53:29 +02:00
Delyan Angelov
83762fa4a4
native: align the disassembly/comment column in the -v -b native output 2022-03-12 11:09:09 +02:00
Subhomoy Haldar
40504e8600
rand: further bridge gap b/w rand module and PRNG interface (#13719) 2022-03-12 09:41:12 +02:00
Delyan Angelov
a3e9409196
strconv: fix a double free bug in v_sprintf/remove_tail_zeros_old, reduce leaks 2022-03-11 19:32:08 +02:00
yuyi
795fe5844c
strconv: fix strconv.v_printf() (#13716) 2022-03-11 17:00:57 +02:00
yuyi
10ab758aa7
ast: minor cleanup in pref_arch_to_table_language() (#13714) 2022-03-11 14:56:48 +02:00
Delyan Angelov
8dc4b1d9a3
builtin: use malloc_noscan more (for map metas and in []byte.hex()) 2022-03-11 11:26:22 +02:00
yuyi
1993bf2a12
parser: cleanup map syntax (#13713) 2022-03-11 12:15:52 +03:00
yuyi
c1c3ae2a18
parser: minor cleanup in fn_args() (#13711) 2022-03-11 10:42:03 +02:00
yuyi
3f351036a2
parser: fix error for fn with type only argument (fix #13704) (#13709) 2022-03-10 22:52:06 +02:00
yuyi
dd06698ee3
ast: rename TypeSymbol.is_public to TypeSymbol.is_pub (#13710) 2022-03-10 22:18:57 +02:00
Delyan Angelov
f3388df577
ci: fix dump_expression.vv when v is actually vprod (-‸ლ) 2022-03-10 18:13:00 +02:00
Delyan Angelov
e8c8f0e7c0
v.ast: fix dump(os.real_path(Makefile)) printing main.os.real_path 2022-03-10 11:24:46 +02:00
Nick Treleaven
4bea35b028
vlib/arrays: fix copy to not use memcpy for array, map, string (#13703) 2022-03-10 01:30:51 +03:00
JalonSolov
de2fc87995
os: handle trailing backslash on windows path when quoting (#13705) 2022-03-10 01:29:37 +03:00
Nick Treleaven
7231a3f135
vlib: add mut for the first parameter of builtin.copy, arrays.copy and crypto (#13702) 2022-03-09 20:26:00 +02:00
yuyi
4c33003f86
checker: check error for infix compare optional (#13701) 2022-03-09 20:20:21 +02:00
Nick Treleaven
54de04a916
arrays: improve fold/reduce docs (#13700) 2022-03-09 20:04:49 +02:00
yuyi
6c7243f2f7
checker: remove redundant 'c.expected_type = ast.void_type' (#13687) 2022-03-09 12:33:23 +02:00
Mihai Galos
d5b087de10
vlib: add a datatypes.fsm module (#13668) 2022-03-09 12:14:54 +02:00
pancake
3f1e232c9b
native: support comparing two idents and avoid printing idents (#13686) 2022-03-08 19:52:30 +02:00
Delyan Angelov
10474f35f6
net.http: clarify error message in Request.ssl_do 2022-03-08 18:17:34 +02:00
yuyi
3fe8204062
checker: fix if expr with enum value (#13685) 2022-03-08 11:55:17 +02:00
Delyan Angelov
f6aba9a3fe
util: make check_module_is_installed more robust to ~/.vmodules paths with spaces 2022-03-08 11:33:03 +02:00
yuyi
cea3149369
checker: fix match expr with enum type value (#13683) 2022-03-08 09:50:17 +02:00
Nick Treleaven
17fcc788f2
arrays: add generic copy fn (#13677) 2022-03-08 09:44:04 +02:00
Delyan Angelov
beb1b8ce1b
tools: add v scan file.v 2022-03-07 18:25:38 +02:00
pancake
b20c911d3e
native: generate relocatable ELFs and support relative strings (#13671) 2022-03-07 18:24:01 +02:00
yuyi
e6270b05dc
checker: check unsigned integer compared with negative value (#13670) 2022-03-07 10:26:40 +02:00
Alexander Medvednikov
36ec47cd20 all: replace "NB:" with "Note:" (docs/comments) 2022-03-06 20:01:22 +03:00
Delyan Angelov
f74b65b63f
docs: change term.input to term.ui in vlib/term/README.md 2022-03-06 15:50:22 +02:00
yuyi
c8e33ad219
cgen: fix error for array of reference auto_str (#13665) 2022-03-06 12:15:31 +02:00
Delyan Angelov
b0f651bf81
sync: enable tcc compilation of sync programs on Amazon Linux 2 (and other Red Hat distros like CentOS) by default (#13664) 2022-03-05 19:13:47 +02:00
yuyi
6380b9eb15
cgen: minor cleanup of struct.v (#13661) 2022-03-05 17:19:20 +02:00
yuyi
22fda7c3dd
cgen: fix error for time struct init with update (#13660) 2022-03-05 13:28:48 +02:00
yuyi
8136157f87
checker: fix error for 'or expr with nested match expr' (#13658) 2022-03-05 13:06:08 +02:00
Ned
0e5ae7126f
x/json2: fix decoder errors (#13655)
* x/json2: fix decoder errors, refactoring

* x/json2: add error-catching tests

* x/json2: add missing docs

* x/json2: fmt
2022-03-05 13:02:43 +02:00
kahsa
3ef437e679
sokol: reorder and add missing funcs (#13652) 2022-03-04 14:39:38 +03:00
Ned
437fa02f27
x.json2: add customized JSON output capability via Encoder (#13654) 2022-03-04 14:39:23 +03:00
Hunam
74d5106e8f
cli: print cli errors in red where possible (#13647) 2022-03-04 12:28:11 +02:00
yuyi
f70e5bd69b
parser: check assign expr with undefined variable (#13653) 2022-03-04 10:33:14 +02:00
ChAoS_UnItY
63b41e67fa
v.parser: change body_start_pos to function declaration's lcbr, resolve #13642 (#13646) 2022-03-03 19:51:27 +02:00
Delyan Angelov
4331d6dea0
v.builder: only add /DEBUG:FULL when -cflags does NOT contain custom /DEBUG options (#13643) 2022-03-03 16:47:41 +02:00
yuyi
a98eebde7f
checker: add a notice for potentially incorrect smartcasts (#13644) 2022-03-03 16:36:40 +02:00
yuyi
ac1b31dbba
checker: fix error for array of interface init in for_in (#13636) 2022-03-03 12:32:55 +02:00
Delyan Angelov
3364f2aadf
cgen: use ADDR for sumtype conversion instead of HEAP (fix regression after 7f8f571) 2022-03-03 11:44:24 +02:00
yuyi
288b13b51d
all: cleanup smartcasts in the compiler (#13639) 2022-03-03 10:48:31 +02:00
Delyan Angelov
4e7db5bab0
v.builder: streamline get_os_cflags/0, use pref.os_from_string to centralise string -> v.pref.OS conversion 2022-03-03 10:43:50 +02:00
ChAoS_UnItY
6a3d34ae11
checker: fix #13626, when unwrapped type is fixed array, and selector expr is 'len' (#13627) 2022-03-02 20:46:18 +02:00
yuyi
36e80266e6
ast: fix error for 'for smartcast' - part 2 (#13635) 2022-03-02 16:01:20 +02:00
yuyi
ffe6ff3cc8
cgen: fix error for print smartcast variable (#13634) 2022-03-02 12:32:54 +02:00
yuyi
22017ff8f4
parser: fix error for 'for smartcast' - part 1 (#13629) 2022-03-02 12:18:03 +02:00
yuyi
7f8f571ed2
cgen: fix error for optional cast to interface (#13623) 2022-03-01 19:21:55 +02:00
kahsa
6d57315aca
net: fix html dom debug print (#13625) 2022-03-01 19:20:40 +02:00
Ikko Ashimine
aa633dab41
utf8: fix typo in utf8_util.v (#13624) 2022-03-01 19:06:48 +02:00
Delyan Angelov
fd91811fe2
v.util: add set_source_for_path/2 to enable external tools to use util.formatted_error on pathless sources 2022-03-01 18:55:25 +02:00
yuyi
996bd41ce8
checker: simplify for smartcast in for_stmt() (#13619) 2022-03-01 12:31:48 +02:00
Joe Conigliaro
3b6e122d9d
all: comptime_call - update tmpl scope vars with caller scope vars after their properties got updated in checker 2022-03-01 02:13:29 +11:00
yuyi
0028e557f9
checker: cleanup smartcast in checker.v (#13618) 2022-02-28 17:06:37 +02:00
yuyi
9a2df0df0e
cgen: fix fn mut argument of interface type (#13616) 2022-02-28 13:31:04 +02:00
yuyi
013589e9fe
parser: minor cleanup in global_decl() (#13617) 2022-02-28 13:30:17 +02:00
Subhomoy Haldar
a0d9e6e1c2
rand: extend PRNG interface, add buffering support (#13608) 2022-02-28 13:17:54 +02:00
yuyi
efeb3e04da
ast: add table.is_sumtype_or_in_variant() (#13615) 2022-02-28 11:38:20 +03:00
yuyi
81c787ef91
checker: fix match expr with assign sumtype variable (#13614) 2022-02-28 11:37:59 +03:00
yuyi
bc16c61f6f
parser: check using 'mut' on fn_decl return type (#13610) 2022-02-27 14:23:43 +02:00
yuyi
0fb1eaef04
parser: check the redefinition of built-in IError (#13606) 2022-02-26 09:52:40 +02:00
yuyi
0d9792bdf2
ast: cleanup in find_method_with_generic_parent() (#13600) 2022-02-26 02:11:56 +03:00
Larpon
d80f5165dd
fmt: keep trailing comments after fn header decl (#13596) 2022-02-25 16:36:48 +03:00
yuyi
83ea97b1a3
parser: fix optional expr with array value (#13599) 2022-02-25 15:54:12 +03:00
Larpon
73f931b52e
fmt: improve single line const comment placement (#13595) 2022-02-25 14:46:12 +02:00
Bastian Buck
fa645516c3
crypto: implement Output Feedback (OFB) Mode for AES and DES (#13583) 2022-02-24 14:38:21 +02:00
Bastian Buck
0d07a64230
crypto: implement Counter (CTR) Mode for AES and DES (#13582) 2022-02-24 12:06:33 +02:00
yuyi
d30ad344e8
checker: check error for array of sumtype appendding (#13593) 2022-02-24 11:07:03 +02:00
yuyi
a28249c119
ast: fix for in iterator of generic struct (fix #13579) (#13585) 2022-02-24 10:48:52 +02:00
Subhomoy Haldar
114a341f5f
rand: simplify rand.PRNG, move to optional types for error handling (#13570) 2022-02-23 12:36:14 +02:00
Bastian Buck
5c0b7b0d05
crypto: implement Cipher Feedback (CFB) Mode for AES and DES (#13566) 2022-02-23 11:55:16 +03:00
yuyi
b5e7cef1b1
ast: define 'const invalid_type_idx = -1' (#13573) 2022-02-23 11:54:43 +03:00
yuyi
c3ec738126
checker: check struct field reference type mismatch (#13575) 2022-02-23 11:53:22 +03:00
Delyan Angelov
d2e8302d21
ci: show failing compilation output in draw_fns_api_test.v (make diagnostic easier) 2022-02-22 16:53:06 +02:00
yuyi
6486fffc5a
checker: cleanup map = {} processing (#13563) 2022-02-22 16:04:54 +02:00
Vincenzo Palazzo
6a876d4170
datatypes: small fix for the BST node constructor (#13569) 2022-02-22 15:41:30 +02:00
Larpon
1032cf5c04
checker: only cast as ast.Var if not unresolved, fixes #13561 (#13562) 2022-02-22 15:23:15 +02:00
Delyan Angelov
33d379d530
ci: vfmt vlib/net/socket.v 2022-02-22 15:21:20 +02:00
gcxfd
ee1de06678
net: extract a common Socket struct, reuse it by embedding in TcpSocket & UdpSocket (#13559) 2022-02-22 10:34:38 +02:00
Vincenzo Palazzo
7bd8503170
datatypes: add a binary search tree implementation (#13453) 2022-02-22 10:28:01 +02:00
Delyan Angelov
4a765bc33b
cgen: support -d trace_gen_source_line_info 2022-02-21 23:04:10 +02:00
Delyan Angelov
f2e5bb447e
os: remove dead code 2022-02-21 22:57:24 +02:00
yuyi
07e9ed1a1d
cgen: fix interface embedding method call (#13553) 2022-02-21 17:49:38 +02:00