Commit Graph

9935 Commits (0669e5952b55015395c48ecdfad7eecfa8d11e63)

Author SHA1 Message Date
Miccah 799d7b843c
net: properly convert IP address C strings to V strings () 2021-12-02 11:18:14 +02:00
Larpon 9cf7af0c75
toml: add better float validation () 2021-12-02 11:16:55 +02:00
Ulises Jeremias Cornejo Fandos f7926ec9a4
vlib/context: add onecontext as submodule () 2021-12-02 11:15:07 +02:00
yuyi 2144471ce1
cgen: fix generic fn with anon fn in body () 2021-12-02 10:53:42 +02:00
yuyi 988779846f
checker: fix map init with enum keys () 2021-12-01 18:11:50 +02:00
Larpon 8494e387ec
strconv: fix format.md example snippets () 2021-12-01 17:23:35 +02:00
Delyan Angelov d7bc2a88f7
builtin: add a non allocating rune.length_in_bytes() method and tests for it 2021-12-01 16:35:13 +02:00
Larpon b3aedff3f8
toml: convert yaml value checks in iarna test suite () 2021-12-01 14:43:15 +02:00
pancake 6f297cdfaa
js: add missing start_digraph() for the js backend () 2021-12-01 14:05:18 +02:00
Delyan Angelov f5d283721e
checker: add more `string(x)` checks, with more detailed replacement suggestions 2021-12-01 11:28:00 +02:00
Delyan Angelov 79cb303a6c
sync: improve compatibility with -Wimpure-v 2021-12-01 11:24:51 +02:00
Delyan Angelov 47aa2b1f93
all: fix casting of `string(MyString('abc'))` and `byte(MyByte(123))`; improve TypeSymbol handling () 2021-12-01 09:50:53 +02:00
penguindark 519ca90cfa
regex: added default support for long queries () 2021-12-01 08:38:50 +02:00
Taillook f86710dcc7
crypto.bcrypt: add doc comments for public bcrypt functions () 2021-11-30 19:41:59 +02:00
Larpon 6f193c4300
toml: remove obsolete comment from checker () 2021-11-30 19:40:31 +02:00
yuyi 547f326f33
cgen: cleanup auto_str_methods () 2021-11-30 19:39:55 +02:00
Larpon 758ba76d2b
toml: update testdata/.gitignore () 2021-11-30 16:01:20 +02:00
Larpon 5c8e626912
toml: add `alexcrichton/toml-rs` test suite to CI () 2021-11-30 15:08:30 +02:00
yuyi d1b0ce9e0c
cgen: fix error of the interface str method (fix ) () 2021-11-30 15:03:44 +02:00
Larpon 7d9028db56
toml: add more checks for table redeclarations () 2021-11-30 15:01:00 +02:00
Larpon f50f409ad7
toml: simplify bool keys in scanner and parser () 2021-11-30 14:26:47 +02:00
pancake 1b691e7612
native: implement for-c and for-in range loops () 2021-11-30 11:49:30 +02:00
Anton Zavodchikov 05db3533d3
picoev: use `net` C definitions () 2021-11-30 11:15:59 +02:00
pancake 8ac7739db8
parser: forbid empty match statements 'match cond.op {else {}}' () 2021-11-30 09:32:48 +02:00
Delyan Angelov 6749979534
builder: fix the uhm `fine` module lookup bug (part 1) 2021-11-29 22:54:52 +02:00
Taillook bbc47562b3
crypto.blowfish: add doc comments for the public API () 2021-11-29 22:19:52 +02:00
Larpon 14424100e8
toml: comply with BurntSushi @eb989e5 () 2021-11-29 22:15:22 +02:00
Leo Developer 0f59d88ba6
v.embedfile: make path public () 2021-11-29 16:32:42 +02:00
playX ddec89f9ee
js,vfmt: fix formatting for JS types; add fetch API () 2021-11-29 15:32:29 +02:00
yuyi 9825c7e06c
ast: fix generic sumtype of alias generic struct () 2021-11-29 15:12:00 +02:00
Larpon 65e9503556
toml: check for immutable tables () 2021-11-29 15:10:23 +02:00
Alexander Medvednikov c14c324125 pref: .o build mode 2021-11-29 05:00:25 +03:00
Delyan Angelov 6d97b0a407
checker: improve checking of a << b, when a and b are numbers () 2021-11-29 03:48:49 +03:00
ChAoS_UnItY fe37da31a8
v.transformer: fix string always escaped by transformer () 2021-11-28 23:53:30 +02:00
yuyi 6d6a23a1c9
checker: remove redundant code of find field with embed () 2021-11-28 21:31:19 +02:00
Delyan Angelov 87029e5707
encoding.base64: vfmt base64.c.v 2021-11-28 20:37:08 +02:00
Delyan Angelov 31fe02de8c
builtin,crypto: fix problems detected by -fsanitize=address,undefined and -fsanitize=memory 2021-11-28 20:35:18 +02:00
Delyan Angelov b4c52b72cf
builtin: change the `-d debug_malloc` byte pattern to `M` so it is easier to spot with a plain text terminal. 2021-11-28 19:23:11 +02:00
Leo Developer 9c88317ca6
checker: add a warning if start value is higher than end value () 2021-11-28 18:46:52 +02:00
Delyan Angelov 5786dd84e6
tests: add a new `import_x_json2.v` skipped valgrind test 2021-11-28 18:36:05 +02:00
Delyan Angelov 1913de0187
x.json2: fix compilation with -autofree 2021-11-28 18:32:04 +02:00
Delyan Angelov 969e0dce20
szip: cleanup after tests 2021-11-28 15:30:26 +02:00
Delyan Angelov dc610a9a80
ci,crypto: fix -cstrict compilation 2021-11-28 15:30:13 +02:00
Larpon 0fc47b50a2
toml: fix date-time and time ms test inconsistency () 2021-11-28 12:42:32 +02:00
Taillook 783aba4552
vlib/crypto/bcrypt: Add bcrypt () 2021-11-28 12:40:50 +02:00
Leo Developer f72d001db5
cgen: fix $embed_file not finding embedded file when using -prod () 2021-11-28 12:32:05 +02:00
Larpon 1d8ece7ac0
toml: fix, test and optimize `nan` and `inf` values () 2021-11-27 21:26:28 +02:00
Larpon 22043f2df1
toml: fix float checker bug for `-0.01` () 2021-11-27 21:03:26 +02:00
Larpon d52b62a4f4
toml: improve parsing of bare keys to include `-` and `_` () 2021-11-27 15:46:05 +02:00
Delyan Angelov 8315e82188
checker: improve naming for `.stmts()` and `c.stmts_ending_with_expression()`, add a better explanation for their purpose 2021-11-27 08:09:36 +02:00
Delyan Angelov deaeffc4db
checker: add a check for unused `x << y` expressions (where x != array) () 2021-11-27 07:38:35 +02:00
Joe Conigliaro 12585e88e1
checker: remove obsolete/slow const ordering code. close 2021-11-27 05:36:27 +11:00
Larpon 4383cf7de5
toml: add `iarna/toml-spec-tests` to CI tests () 2021-11-26 19:15:01 +02:00
pancake 89bab98833
native: implement a working hello world compilation for w64 () 2021-11-26 19:03:15 +02:00
Larpon 04b030b7ab
toml: add 1MB file parsing test to CI () 2021-11-26 18:11:14 +03:00
Larpon 253e38d9d7
toml: support implicit array of tables key change () 2021-11-26 15:06:28 +02:00
Delyan Angelov 6299a73e90
builder: prepare for `v -b native -os windows run file.v` 2021-11-26 12:05:58 +02:00
Sandro Martini 85633fe546
tests: test more edge cases for interfaces () 2021-11-26 11:10:03 +02:00
yuyi cf274f262c
checker, cgen: fix fn type call of match expr () 2021-11-26 09:52:20 +02:00
Larpon a59eabc4ab
toml: clean up and improve spaced and dotted key parsing () 2021-11-25 16:51:54 +02:00
playX f584e70cf2
js: add fixes for generic structures and functions; add promise API; refactor modules () 2021-11-25 16:49:53 +02:00
yuyi ac3910b8c2
checker: merge comptime_const_eval.v and noreturn.v into checker.v () 2021-11-25 12:41:26 +02:00
Larpon 9a2c563735
toml: add conversion of ast inf and nan to Any () 2021-11-25 12:33:54 +02:00
Larpon 11d70624af
toml: streamline value() api () 2021-11-24 20:39:22 +02:00
Larpon f825306cff
toml: workaround () 2021-11-24 20:36:15 +02:00
playX b0bc112168
jsdom, examples: add more WebGL APIs; add interactive 3D cube example running on VJS () 2021-11-24 20:31:39 +02:00
Larpon ff95cf18d4
toml: expand short date time milliseconds in decoder () 2021-11-24 14:49:23 +02:00
yuyi 6f46fc2170
checker, cgen: fix for_in_mut iterator val () 2021-11-24 14:43:37 +02:00
yuyi 43a1d2cfea
ast: cleanup table.v () 2021-11-24 09:56:56 +02:00
pancake 70ff00efbb
bootstrapping: fix building V on OpenBSD () 2021-11-24 09:46:46 +02:00
Delyan Angelov 8e0de2036d
net: use `vmemset(&hints, 0, int(sizeof(hints)))`, instead of zeroing the fields 1 by 1 2021-11-24 09:34:48 +02:00
yuyi e42db5bee2
ast: fix vtl compile error of generic array type cname () 2021-11-23 20:11:51 +02:00
Larpon 1be6aed16e
toml: support checking and decoding quoted keys () 2021-11-23 16:59:07 +02:00
Larpon 0779b5fd8e
toml: fix implicit array allocation () 2021-11-23 16:51:24 +02:00
Larpon 49cd1b3d59
toml: make value of `+nan`/`-nan` decode to `nan` () 2021-11-23 16:23:16 +02:00
playX 12ffe04212
jsdom, builtin/js: WebGL W.I.P; Added support for casting V arrays to typed arrays ()
* builtin/js: TypedArray support

* jsdom: WebGL W.I.P
2021-11-23 14:51:59 +02:00
Larpon e9efed02f0
toml: fix decoding most large number values () 2021-11-23 13:23:16 +02:00
Larpon 3f0e532660
toml: fix unicode and escape value decoding () 2021-11-23 11:02:43 +02:00
yuyi 13a2d547b4
checker: fix vtl compile error () 2021-11-23 10:55:15 +02:00
zakuro 93bdff5589
fmt: remove unnecessary paren in assert stmt () 2021-11-23 07:30:54 +02:00
yuyi fbe2b5cb58
checker: check argument type error of the generics fn declaration () 2021-11-22 22:39:20 +02:00
Delyan Angelov d431145a39
v.util,tools: use os.join_path_single 2021-11-22 21:42:55 +02:00
Delyan Angelov bd9564e38b
ci: fix failing ttf_test.v after making `char` unavailable for variable names 2021-11-22 18:28:25 +02:00
yuyi f37eb6a932
checker: check invalid fn parameter name () 2021-11-22 16:51:58 +02:00
Delyan Angelov 6914763493
vc: reduce further the average vc commit diff size 2021-11-22 16:46:28 +02:00
Delyan Angelov 5e8288528a
ci: fix `v -b js vlib/builtin/js/array_test.js.v` 2021-11-22 15:11:33 +02:00
Delyan Angelov 6a252ed015
os: implement a JS version of os.join_path_single too 2021-11-22 15:03:05 +02:00
Delyan Angelov 7a0dc60d04
os: re-add the leak in os.join_path (the `os.join_path(x, ...arr)` case should be handled by V). Add a memleak free os.join_path_single version. 2021-11-22 14:40:55 +02:00
Delyan Angelov 5e1782bf9c
tests: add more common patterns of os function usage in the -autofree test import_os_and_use_its_constants.v 2021-11-22 13:37:06 +02:00
Delyan Angelov c3b8e5e181 ci: fix compilation on FreeBSD 2021-11-22 09:32:13 +00:00
Delyan Angelov 84aa05f8fb
ci: fix macos build 2021-11-22 11:07:26 +02:00
Delyan Angelov fe48380e85
os: cleanup; ci: fix a segfault in the tcc32 job when calling pref.vexe_path() -> os.real_path(os.executable()) 2021-11-22 10:32:10 +02:00
Delyan Angelov e77a11001e
os: make init_os_args_wide (windows), more simillar to the current init_os_args (unix) 2021-11-21 23:04:30 +02:00
Delyan Angelov c7bd74e0f8
ci: fix build, remove `[manualfree]` from os.vmodules_paths for now 2021-11-21 22:34:38 +02:00
Delyan Angelov 1aaac13a60
cgen: make `os` less special, fix an -autofree leak on just `import os`
* Improve documentation of v.util.Surrounder

* Remove `os` from the list of "no auto free" `builtin` mods

* Fix -autofree freeing of `const x = []string{}`.

* Add a valgrind regression test.

* Implement os.getenv_opt in vlib/os/environment.js.v too.
2021-11-21 21:50:10 +02:00
Delyan Angelov 117c99d938
v.util: add Surrounder.builder_write_befores and Surrounder.builder_write_afters methods for writing to an existing strings.Builder 2021-11-21 20:56:47 +02:00
kahsa 480f3876ee
gg: fix system_font_path () 2021-11-21 19:12:15 +02:00
playX 243e66a106
js,jsdom: Canvas & context API; Added TypeSymbol.is_js_compatible & temporary hacks for JS ifaces () 2021-11-20 21:28:11 +02:00
Delyan Angelov 258d0d6df7
cgen: make `dump(x)` use a single write call, fix memleaks for autogenerated .str() methods of nested structs () 2021-11-20 20:55:19 +02:00
Larpon f1dd0e3355
toml: add value decoding () 2021-11-20 19:48:44 +02:00
Larpon 4b9e8e243c
toml: support arrays in value key query syntax () 2021-11-20 19:45:17 +02:00
Ned 82010e729d
checker: fix "unregistered" variadic interface call arguments () 2021-11-20 18:15:20 +02:00
Delyan Angelov 90ba856107
cgen: fix `dump(x)` with `fn (x &Type) str() string {` 2021-11-20 13:12:03 +02:00
Delyan Angelov 24ffc1ffb2
os: fix os.rmdir_all for folders with recursive symlinks 2021-11-20 10:28:12 +02:00
Larpon 1bbc73384c
toml: fix memory corruption when returning new date/time types () 2021-11-19 20:35:11 +02:00
Larpon a894a6cf36
toml: fix parsing of alphanumeric keys () 2021-11-19 20:34:21 +02:00
yuyi eec8788333
checker: fix generics fn infer nested generic fn () 2021-11-19 20:31:55 +02:00
Delyan Angelov b576181a66
cgen: fix `const x := opt() or {}` side effect interference when the consts are in different files in the same module too 2021-11-19 19:02:33 +02:00
Delyan Angelov e275220f05
cgen: fix `const x := opt() or {}` side effect interference with parallel cgen 2021-11-19 18:15:06 +02:00
Delyan Angelov 762a7fde2a
os: add os.getenv_opt/1 2021-11-19 17:47:45 +02:00
yuyi c2eb909c9b
cgen: fix multiple matches in one expr () 2021-11-19 13:52:28 +02:00
pancake 80a4ff9900
native: handle some more statements and dont echo warnings () 2021-11-19 13:50:44 +02:00
Delyan Angelov fa995ca537
checker: add an error for `x.method({})` calls, when method expects a struct 2021-11-19 13:30:45 +02:00
pancake 9eac656e55
native: support passing a directory, instead of just a .v file () 2021-11-19 10:30:46 +02:00
Larpon 76cf11e6b5
toml: add Any.default_to() method () 2021-11-19 10:26:45 +02:00
pancake b367ed9ba3
native: support defining functions in any order () 2021-11-19 10:25:42 +02:00
yuyi d498c365c2
checker: cleanup infer_fn_generic_types() () 2021-11-19 10:24:03 +02:00
Delyan Angelov 24ba660367
bitfield,flag: document the remaining functions 2021-11-18 20:15:26 +02:00
Larpon 96554fad71
toml: improve number conversion () 2021-11-18 19:46:19 +02:00
Delyan Angelov 3caeadfa0d
cgen,vfmt: support `[weak]` tags for functions and globals 2021-11-18 18:32:39 +02:00
Larpon 7fba3e65e9
toml: support empty tables () 2021-11-18 15:39:44 +02:00
Larpon 24ea15c8f0
toml: remove fixed value tests from skip list () 2021-11-18 13:57:14 +02:00
kahsa 0ec02e3247
sqlite: add enum result code () 2021-11-18 13:56:15 +02:00
Larpon 7ec70d5477
toml: small refactor, move all json functionality to submodule () 2021-11-18 13:27:59 +02:00
Alexander Medvednikov 5bf28c5287 cgen: handle c2v fn casts 2021-11-18 11:58:00 +03:00
playX 1edb3e559e
js,jsdom: make JS structs plain objects; add more DOM API support for jsdom () 2021-11-18 10:09:53 +02:00
Larpon 409321327b
toml: don't use time.Time for time representation () 2021-11-18 07:44:24 +02:00
zakuro b5e410e408
fmt: format explicit map init with parameter () 2021-11-18 08:34:30 +03:00
Don Park ae54cd78f5
json2: encode ascii chars < 0x20 in json () 2021-11-18 08:34:00 +03:00
zakuro 26fbf1885d
checker: report error for test functions that have parameters () 2021-11-18 08:33:28 +03:00
Larpon 3b612899bf
toml: eat first nl if present in multiline strings () 2021-11-17 23:48:29 +02:00
Larpon 81455acd29
toml: simplify Doc.to_any() method () 2021-11-17 20:58:06 +02:00
Larpon 2f5fae06ee
toml: fix a few string value tests () 2021-11-17 20:54:48 +02:00
Delyan Angelov 2733319879
term: fix a leak in _test.v files in the default test runner without -autofree 2021-11-17 20:39:08 +02:00
Larpon dbf469e000
toml: move to_burntsushi functionality () 2021-11-17 17:25:50 +02:00
Larpon 7cdc906683
toml: fix scanning of short unicode escapes () 2021-11-17 17:24:40 +02:00
yuyi 3e1fb22a04
checker: format checker.v () 2021-11-17 15:57:17 +02:00
yuyi 1370516f53
checker: check struct field using 'any' type () 2021-11-17 11:42:05 +02:00
playX 2eb02ff5a7
jsdom, js: start refactoring jsdom; improve JS interfaces; add two attributes for them () 2021-11-17 11:41:33 +02:00
Delyan Angelov 6ac109a7c3
builtin: add a `[has_globals]` tag for all the .v files, with global declarations in them 2021-11-17 10:29:06 +02:00
Larpon bd9ac598f7
toml: add support for validation of structure and values () 2021-11-17 08:30:40 +02:00
yuyi 5a89c0a480
ast: change CompFor to ComptimeFor () 2021-11-17 08:29:43 +02:00
yuyi 927df948ae
cgen: fix generic struct free() () 2021-11-17 08:18:46 +03:00
Khalyomede 11ce26b3f6
sqlite: make constants public () 2021-11-17 05:45:50 +03:00
Alexander Medvednikov 49a36515dc checker, cgen: c2v fixes 2021-11-16 20:56:50 +03:00
yuyi 2984751a57
checker: fix the argument mismatch of fn call () 2021-11-16 17:19:02 +02:00
Delyan Angelov 3fab0a5d05
cgen: fix codegen for `for k,v in map_of_pointers {` 2021-11-16 17:03:58 +02:00
Delyan Angelov 045579fd8a
parser: use the `[has_globals]` module attribute, remove the parser `global_enabled_mods whitelist` (part 2) 2021-11-16 11:44:36 +02:00
Delyan Angelov f0f5f97e9f
parser: support a `[has_globals]` module attribute, to eliminate a parser whitelist (part 1) 2021-11-16 11:34:26 +02:00
kahsa 3f37ab2ef2
gg: fix system_font_path on Linux () 2021-11-16 12:14:35 +03:00
yuyi bede0587ad
cgen: fix string interliteral of the comptime selector () 2021-11-16 08:45:47 +02:00
yuyi 9565adf597
checker: check invalid map variable name () 2021-11-16 08:42:49 +02:00
Larpon 2f75ce0d4c
toml: use `json2` to encode output from .to_json() () 2021-11-16 08:41:37 +02:00
Larpon 7b9cca7524
toml: add convenience convertion of Doc to map[string]toml.Any () 2021-11-15 19:00:09 +02:00
yuyi c28041cecc
all: cleanup/rename all `comp_` names to be `comptime_` () 2021-11-15 15:47:29 +02:00
Charles WANG 1d003228cb
tests: update generics_method_str_overload_test.v to return a generic type, instead of `Gen<G>`. () 2021-11-15 15:36:54 +02:00
Larpon cbdb270d2f
toml: upgrade the module to 100% BurntSushi test suite parsing compatibility () 2021-11-15 15:36:14 +02:00
Larpon 78662c800c
toml: fix parsing formatting on Windows with crlf line endings () 2021-11-15 15:35:30 +02:00
playX a8a1e9381f
strconv,js: f64_to_str works on JS backend now; Fix BigInt usage in infix expressions () 2021-11-15 14:13:44 +02:00
Delyan Angelov 1d2b16dde2
js: support `[if userflag?]` fn tags 2021-11-15 13:23:27 +02:00
zakuro 5e75c89b71
checker: allow noreturn in if expr () 2021-11-15 10:29:58 +02:00
yuyi d8479f107f
cgen: fix typeof comptime selector (fix ) () 2021-11-15 10:23:49 +02:00
playX e3d98b1b28
js,strconv: port some functions to JS backend, improve `rune.str()` () 2021-11-14 21:06:58 +02:00
yuyi 460f4523aa
checker: check array pop immutable () 2021-11-14 21:00:22 +02:00
yuyi fb997eb5fe
cgen: fix comptime for in field selector () 2021-11-14 20:58:22 +02:00
Delyan Angelov 61b99e1915
vfmt: handle comments right after interface fields 2021-11-13 13:42:17 +02:00
Larpon 9c508237bd
toml: support for `[a."b.c"]` quoted keys () 2021-11-13 11:17:35 +02:00
playX 6c32c544e1
js,parser: allow declaring methods on JS interfaces for easier FFI () 2021-11-13 11:08:17 +02:00
yuyi 3bb1c3f930
checker, cgen: fix for in iterator of generic struct () 2021-11-12 14:29:01 +02:00
Delyan Angelov 50a608aab3
os: remove unnecessary heap allocation from os.execute 2021-11-12 11:45:37 +02:00
Delyan Angelov c6b8b0bb0a
ci: make test_execute in os_test.v more robust 2021-11-12 11:24:37 +02:00
Delyan Angelov fcecf527ec
ci: fix failing os_test.v on the CI 2021-11-12 10:27:35 +02:00
Delyan Angelov 20d63de136
os: fix os.execute for command output that contains 0 bytes 2021-11-12 09:39:15 +02:00
Larpon 4b42dcad8e
toml: support complex array-tables-array constructs () 2021-11-11 18:30:34 +02:00
Delyan Angelov 9cb378bb6b
examples: reduce the memory usage of the clock example, without -autofree & -gc boehm 2021-11-11 17:39:02 +02:00
Larpon c8cb1bf6b4
toml: check for single-key reassignment in inline tables () 2021-11-11 14:57:11 +02:00
Larpon 35f00c9f91
toml: check for text after comma in arrays () 2021-11-11 14:55:51 +02:00
yuyi 6f55439930
tests: supplement tests for different types of generic parameters () 2021-11-11 14:45:55 +02:00
playX a4c57ba56e
js: support JS interfaces () 2021-11-11 14:36:32 +02:00
Larpon 015cfdb49f
toml: add excerpt to value parse errors () 2021-11-11 07:29:38 +02:00
Larpon dbd5acd5ba
toml: small start -> end word use change () 2021-11-11 07:28:46 +02:00
Larpon 69fa87ad24
toml: add date and time checks () 2021-11-11 07:27:41 +02:00
zakuro 823a3ab838
fmt: fix removal of selective imported types used as type parameter () 2021-11-11 07:15:30 +02:00
yuyi 72a7d5a559
checker: minor cleanup in method_call () 2021-11-11 07:12:59 +02:00
Delyan Angelov 8a971c3bf7
ci,vweb: fix hard coded data in vweb_test.v 2021-11-10 18:41:25 +02:00
Delyan Angelov 3c6356ba36
ci: fix request_test.v (add missing \r to hardcoded post data) 2021-11-10 18:16:15 +02:00
Delyan Angelov 466ced2876
net.http: fix multipart/form-data file upload handling 2021-11-10 17:31:41 +02:00
Larpon 66e53279c2
toml: check for more wrong line ending cases () 2021-11-10 15:03:51 +02:00
yuyi d5e767f389
checker, cgen: fix alias of map keys() () 2021-11-10 13:04:59 +02:00
playX 194b3647e2
js,checker: allow casting JS primitives to V primitives and vice-versa () 2021-11-10 11:37:16 +02:00
Delyan Angelov 6c244d3065
cgen: improve diagnostic for a v compiler panic in dicordv 2021-11-10 08:12:12 +02:00
yuyi 8f4180ea09
parser: check generic parameters error of generic struct declaration () 2021-11-09 09:25:57 +02:00
Delyan Angelov 3f841edec1
v.util: make get_vtmp_folder() return `/tmp/v_{uid}` by default (see https://github.com/vlang/v/discussions/11796) 2021-11-09 08:25:19 +02:00
yuyi 08667c5645
pref: allow running a .vsh script with just `v build.vsh gcc`, instead of `v run build.vsh gcc` () 2021-11-08 15:18:11 +02:00
yuyi 758c18a906
cgen: fix for in mut val in array.index() () 2021-11-08 11:12:10 +02:00
yuyi 1211029926
cgen: avoid generating typedef generic array type () 2021-11-07 21:24:30 +02:00
yuyi c8ff9e39b5
checker: cleanup generic struct init () 2021-11-07 18:47:38 +02:00
Delyan Angelov bc98da9111
ast: speed up the frequently called methods .find_field, .find_method etc 2021-11-07 18:07:04 +02:00
yuyi 9ec1262734
ast: fix generic nested struct init () 2021-11-07 17:06:37 +02:00
Delyan Angelov 1c12186701
v.token,ast,scanner,parser: use a KeywordsMatcher lookup for builtin_type_names searches too 2021-11-07 16:39:40 +02:00
Delyan Angelov 80242c8041
builtin,ast: apply small performance improvements, suggested by `hotspot` 2021-11-07 13:30:44 +02:00
playX d8f971ffb5
jsdom: add Path2D API, All CanvasRenderingContext2D methods (except image methods) () 2021-11-07 10:06:28 +02:00
Delyan Angelov 852d85b3a9
gg: cleanup the minimal gg program more 2021-11-07 09:16:49 +02:00
Delyan Angelov 32b74dd348
gg: simplify the minimal gg application even more with `context.user_data = context` 2021-11-06 18:24:19 +02:00
Delyan Angelov 8be64ef80e
gg: improve font loading diagnostics with `-d debug_font` 2021-11-06 17:15:17 +02:00
playX 5f3dcde358
jsdom,builtin: add all methods for DOMMatrix; add conversion methods to convet from/to JS types () 2021-11-06 15:52:24 +02:00
Larpon d2d67e9f4d
toml: add new inline-table duplicate-key test to skip list () 2021-11-06 15:19:40 +02:00
Larpon 9b00564d98
toml: panic if access fails to a key that was checked () 2021-11-05 14:14:50 +02:00
Larpon 24cd619ff8
toml: fix parsing array of tables () 2021-11-05 12:08:40 +02:00
Larpon db65b65f3c
toml: disallow spacing between (array of tables) key syntax () 2021-11-05 11:29:25 +02:00
Larpon c3b389cde9
toml: rename sub_key -> dotted_key () 2021-11-05 11:28:54 +02:00
Alexander Medvednikov 7ea57bfa1e builtin: make map.keys() public 2021-11-04 19:09:37 +03:00
Alexander Medvednikov ace9444108 checker: more c2v fixes 2021-11-04 18:43:02 +03:00
Larpon 1999fb9a95
toml: remove some skipped tests related to recent formatting update () 2021-11-04 14:27:14 +02:00
Larpon fc7f4c5b1f
toml: disallow multiline keys () 2021-11-04 14:26:25 +02:00
yuyi 59e21c2068
cgen: fix array of threads wait (fix ) () 2021-11-04 14:24:58 +02:00
yuyi 73e25ccb3c
checker: check generic struct field fn args type mismatch () 2021-11-04 10:18:36 +02:00
Delyan Angelov a27833ed0d
all: support `volatile field Type` in struct declarations 2021-11-04 09:45:50 +02:00
Larpon 1a54817c81
toml: parse formatting () 2021-11-04 09:15:50 +02:00
playX 2b4154910c
jsdom, checker: add more methods for CanvasRenderingContext2D, fix interop check for JS methods () 2021-11-03 16:54:28 +02:00
Delyan Angelov c4e282a0c8
parser: check fn args in declarations too with `-Wimpure-v`
`v -Wimpure-v examples/2048/` now passes cleanly.
2021-11-03 16:20:24 +02:00
yuyi 4bafc5042b
checker: check generic struct field fn args error () 2021-11-03 10:20:39 +02:00
Larpon 45c938bdec
toml: streamline scanner.at() return type, fixes () 2021-11-03 10:18:09 +02:00
Larpon bd5e2db460
toml: add Parser.peek(n) method () 2021-11-03 10:15:40 +02:00
Larpon 99fd84dfe4
toml: fix hex values starting with a, e or E and comments ending with crlf () 2021-11-02 19:07:27 +02:00
yuyi 3fdbfca202
cgen: fix `for in` with mutable structs () 2021-11-02 18:40:13 +03:00
yuyi 639cbfa0d1
checker: fix generics with assign nested generic fn call () 2021-11-02 10:12:26 +02:00
yuyi 0952af606c
checker: fix comptime if T is interface () 2021-11-02 09:35:01 +02:00
crthpl 1d1793ec34
fmt: correctly format segment offsets () 2021-11-02 08:04:41 +02:00
yuyi dcf230ca24
checker: fix nested generic method call () 2021-11-01 15:41:54 +03:00
yuyi da65680acf
checker: fix comptime if expr of sync.threads () 2021-11-01 09:41:04 +02:00
Lucas Jenß 51f5841b6e
checker: do not deref non-pointer types in `fn_signature_using_aliases` () 2021-11-01 02:26:15 +03:00
Delyan Angelov 6937074e7a
strings,builder: reduce V cgen and parser memory consumption, fix strings.Builder leak () 2021-10-31 12:58:55 +02:00
Delyan Angelov 579d5ae649
builtin,checker: add array.flags. Allow changing it in `unsafe {}` blocks 2021-10-31 11:04:56 +02:00
Delyan Angelov a7d4236337
sync,strings,cgen: reduce memory consumption in cgen 2021-10-29 22:29:56 +03:00
Delyan Angelov 1785b184b9
readline: improve README.md with working examples 2021-10-29 17:36:17 +03:00
Delyan Angelov d1acca3e52
ci: fix `./v -cg -cstrict -o v cmd/v` job failures for clang 2021-10-29 17:21:53 +03:00
yuyi d5642b6134
cgen: fix error of nested match expr () 2021-10-29 17:14:49 +03:00
Delyan Angelov 71392111f8
ci: fix cross compilation of vc/v.c 2021-10-29 17:12:05 +03:00
Delyan Angelov 4c67c01e72
parser,util: improve libleak false positive detection rate 2021-10-29 16:42:55 +03:00
Delyan Angelov 3d800b12e8
scanner: small optimisation of the ident_name hot loop 2021-10-29 16:18:34 +03:00
Delyan Angelov b86c79329b
os, builtin: reduce leaks without -autofree 2021-10-29 15:49:30 +03:00
Lucas Jenß f801ef5e17
checker: disallow `mut` keyword in right-hand side of assignment () 2021-10-29 12:03:05 +03:00
playX a32dae335a
js: fix interfaces behaviour & disable struct deep copy for now () 2021-10-29 11:23:40 +03:00
Louis Schmieder d33f7d12f7
orm: fix time struct in sql stmt () 2021-10-28 22:31:41 +03:00
Larpon 5e4594a121
toml: isolate, fix and regress-test sumtype cast causing memory corruption () 2021-10-28 19:57:30 +03:00
playX fa02418a55
js: copy variables passed to closures () 2021-10-28 19:31:56 +03:00
yuyi 0e95e4d7b4
ast, cgen: fix generic method str() overload () 2021-10-28 19:03:17 +03:00
Delyan Angelov 475a2f9b43
ci: fix failing vlib/orm/orm_test.v 2021-10-28 17:33:18 +03:00
Delyan Angelov 4d0f6767b1
builtin: use malloc instead of calloc for `[]Type{cap: size}` 2021-10-28 17:18:03 +03:00
Delyan Angelov 2c3e44eb20
strings: use memdup_noscan in Builder.str() 2021-10-28 17:00:16 +03:00
Larpon a987440e2f
toml: add UTF header support, add BOM tests () 2021-10-28 16:38:49 +03:00
Delyan Angelov 99e71d0868
scanner: preallocate space for tokens to reduce the number of allocations in the hot loop 2021-10-28 16:23:24 +03:00
Larpon 5ecaa160a7
toml: fix paths in skipped tests for Windows compatibility () 2021-10-28 15:56:56 +03:00
Delyan Angelov 8014235e0e
scanner: speed up text_scan by using a specialised keywords matcher, instead of a generic V map of keywords 2021-10-28 15:41:13 +03:00
Delyan Angelov b1bb1d361a
ci: vfmt parser.v 2021-10-28 10:51:55 +03:00
Delyan Angelov 1b6cccaf6d
parser,checker: allow a goto label right after return 2021-10-28 10:40:31 +03:00
ChAoS_UnItY 8cd01e0eac
cgen: fix error caused by fixed size array init syntax with variable it () 2021-10-28 02:20:49 +03:00
playX cfecb62299
js: DOM API. Part 1 () 2021-10-27 23:18:09 +03:00
Delyan Angelov 0ff23eeb74
ci: fix failing assign_expr_channel_push.out 2021-10-27 22:54:41 +03:00
Delyan Angelov f79bc8619a
scanner: remove unused .line_ends field 2021-10-27 22:37:00 +03:00
Larpon bc3827ae15
toml: improve array parsing () 2021-10-27 20:26:33 +03:00
Lucas Jenß 43fbc68f1e
checker: disallow `<-` (channel push) on right-hand side of assignment (fix ) () 2021-10-27 17:53:50 +03:00
Delyan Angelov 159a9c3070
markused: fix `-skip-unused` on programs with generic methods (fix ) 2021-10-27 17:22:26 +03:00
Larpon 462d097bf5
toml: small clarification on utf8_max const () 2021-10-27 16:41:22 +03:00
yuyi 943a807d30
parser: implement generics method with auto multi generic types () 2021-10-27 15:41:13 +03:00
Larpon d53bb54c0a
toml: implement checks for UTF-8 validity () 2021-10-27 15:28:46 +03:00
Wertzui123 ea6d2d53db
parser: disallow `for mut in range` (fix ) () 2021-10-27 14:55:36 +03:00
Larpon 6eaacd3391
toml: improve checker documentation () 2021-10-27 14:31:29 +03:00
Lucas Jenß d7fd4a563b
parser: remove commented out debug statement () 2021-10-27 14:30:22 +03:00
Larpon 1b9eef74aa
toml: improve inline-table parsing () 2021-10-26 17:00:41 +03:00
Larpon c526752419
toml: remove unused enum () 2021-10-26 16:58:58 +03:00
Larpon 9a3967bd7d
toml: improve comment support () 2021-10-26 16:58:05 +03:00
Larpon 52df19ef61
toml: check for invalid placement of underscores around exponent () 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 () 2021-10-26 11:10:13 +03:00
yuyi f62b2dcfa7
table: fix generic method with multi generic types () 2021-10-26 11:00:27 +03:00
Miccah 655b5c563a
net.http: use `[params]` for Config structs () 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 () 2021-10-25 15:22:41 +03:00
kahsa 77a1e3dedb
gg: improve system_font_path on linux () 2021-10-25 15:16:29 +03:00
Bakul Shah cc2847f6ff
builtin: fix compilation with `-gc boehm` on some FreeBSD versions () 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 () 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 () 2021-10-24 12:05:34 +03:00
penguindark 47a2301139
regex: add OR error, if sourounded by char classes, and a test () 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 () 2021-10-22 22:23:14 +03:00
playX 864d6eae6b
js: codegen & vlib fixes, replace the Game of Life CLI example () 2021-10-22 22:03:19 +03:00
Larpon 8a4756819a
toml: disallow unclosed arrays () 2021-10-22 20:30:29 +03:00
Larpon 8273c0582b
toml: check for illegal characters, fix all related skipped tests () 2021-10-22 19:57:32 +03:00
Larpon eb364f0301
toml: check for exponents starting with an underscore () 2021-10-22 19:56:43 +03:00
Delyan Angelov eed94c727c
os: move C struct declarations in their own _default.c.v files () 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 () 2021-10-22 13:38:36 +03:00
Larpon cc2ef4188d
toml: support parsing (+/-)nan and (+/-)inf () 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 () 2021-10-21 22:30:05 +03:00
czkz da7dad07a3
builder: fix sigint handling for `v run` () 2021-10-21 16:40:32 +03:00
Larpon 909ed76b8f
toml: check binary, octal and hexadecimals literals () 2021-10-21 16:37:38 +03:00
a-iga 1ba839dc3b
openssl: change `read_into` to `read` () 2021-10-21 14:13:04 +03:00
Larpon a84b1a53ec
toml: fix bin, oct and hex capital identifier check () 2021-10-21 14:12:17 +03:00
czkz 5607224be6
docs: improve os.ProcessState markdown rendering () 2021-10-21 11:19:01 +03:00
yuyi ff02c19827
table, builder, checker: cleanup unwrap_generic () 2021-10-21 05:48:02 +03:00
playX 57c79770b3
js: port more methods (os, builtin) () 2021-10-20 16:02:21 +03:00
Lance Fredrickson 7c1fff3495
builder: pass `-std=gnu99` to the C backend under linux () 2021-10-20 14:26:25 +03:00
05st 3e52d54586
cgen: fix match expr when evaluating to sumtype () 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 () 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 () 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 () 2021-10-19 12:11:54 +03:00
xiao xigua 108644d260
vweb: add `file` method to vweb.Context, make the existing `json` method generic () 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 {` () 2021-10-18 10:59:52 +03:00
playX a3de67de28
js: support WASM interoperability using `wasm_import`/`wasm_export` fn tags () 2021-10-18 10:56:21 +03:00
lydiandy 2070839722
io: pub the RandomReader interface () 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 () 2021-10-17 19:39:51 +03:00
czkz 3a073329ff
builder: use os.new_process() instead of os.system() in v run () 2021-10-17 19:01:34 +03:00
yuyi a006090b08
ast: minor cleanup of register_type_symbol () 2021-10-17 15:50:42 +03:00
czkz 29f068997b
math: add fn clamp () 2021-10-17 06:42:40 +03:00
05st fd3a10ab43
checker: fix mut check bypass with for in loops () 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 () 2021-10-15 12:22:59 +03:00
yuyi c108e01917
checker: fix generic fn return types with generic struct () 2021-10-15 11:50:10 +03:00
yuyi 27cd21e459
cgen: fix infix ops, for cross assignments of types with overloaded operators () 2021-10-15 11:32:58 +03:00
playX 814b4ebb4c
term: get_terminal_size() for js_node, term.clear() for all js backends () 2021-10-15 10:10:40 +03:00
playX d3887c1568
time: fix sys_mono_now for the JS backend () 2021-10-15 09:22:15 +03:00
czkz c29a5cdedb
term: fix readme typo () 2021-10-15 06:08:31 +03:00
ChAoS_UnItY 4d1307f29b
all: index accessor in array init expression () 2021-10-15 03:57:49 +03:00
yuyi c9b2f878b3
parser, checker: optimize checking generic struct type mismatch () 2021-10-15 00:11:31 +03:00
Ulises Jeremias Cornejo Fandos 4490d5ed29
context: cleanup the tests and the documentation () 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 ) () 2021-10-14 11:38:16 +03:00
ChAoS_UnItY 6f629d1a6a
transformer: eliminate unreachable branches & redundant branch expressions in MatchExpr () 2021-10-14 02:15:52 +03:00
nyx-litenite 5b9553d5c4
orm: fix last_id() call in mysql () 2021-10-13 21:24:07 +03:00
Larpon 5bfa3d5530
sokol: add screenshot function to OpenGL based backends () 2021-10-13 21:22:58 +03:00
yuyi 97e999768a
checker: fix generic fn return array of generic struct () 2021-10-13 21:21:32 +03:00
playX d373eba79b
js: implement more functions for JS backend () 2021-10-13 09:40:14 +03:00
pancake ade5774313
native: fix return `a+b` infix construction () 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) () 2021-10-12 18:51:28 +03:00
pancake 347ebe5fd3
native: append .exe, when using the native backend on windows () 2021-10-12 18:49:42 +03:00
pancake a0a0ae85eb
native: add support for pe64 when -os windows is used () 2021-10-12 10:43:40 +03:00
playX 22962dd2d2
js: change codegen for match statement, speedup string.split_into_lines () 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 () 2021-10-12 06:35:36 +03:00
pancake 5eba02ea94
native: fix stackframe bug on return statements () 2021-10-12 06:03:44 +03:00
penguindark 0fafefc078
regex: bug fix on find groups indexes () 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 , fixes () 2021-10-11 15:41:31 +03:00
ChAoS_UnItY d0c961ebc0
transformer: eliminate unreachable branches in IfExpr and fold more expressions and statements ()
* 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 () 2021-10-11 14:20:07 +03:00
05st 3e02cfd528
cgen: fix `in` op usage on array of sumtypes without cast () 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 () 2021-10-11 02:46:44 +03:00
05st e69df54a36
cgen: fix multi-return in if/match exprs () 2021-10-11 02:45:01 +03:00
Ulises Jeremias Cornejo Fandos 0f7dfb984a
math: remove the C backend for f64 functions () 2021-10-10 11:21:48 +03:00
yuyi 83bc9b35b1
ast: fix checking generic fn call with fntype arg mismatch () 2021-10-10 11:14:19 +03:00
Yeuda By 8d5931c96c
orm: fix a typo () 2021-10-10 03:47:35 +03:00
ChAoS_UnItY 3647fc6633
parser: perform constant folding before checking size of fixed array () 2021-10-10 01:55:25 +03:00
yuyi 093cab6f56
checker: check generics struct init that types mismatch (fix ) () 2021-10-09 15:03:37 +03:00
pancake 7a6491b9b0
native: initial implementation of C.syscall () 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 () 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 ) () 2021-10-09 03:32:37 +03:00
05st 43931be451
math: sqrti, powi, factoriali () 2021-10-08 22:07:44 +03:00
05st cd5b304cbf
cgen: add interface case for gen_struct_equality_fn () 2021-10-08 19:04:24 +03:00
playX a8ace2c41c
math: implement `pow` in pure V () 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 () 2021-10-07 15:55:47 +03:00
Larpon 42359d8915
toml: fix error return in value parsing () 2021-10-07 15:51:18 +03:00
Larpon 09cc0c7247
gg: use sgl.begin_points for pixels + improve pixels example () 2021-10-07 10:46:57 +03:00
Larpon 53aa4eba0d
sokol: add sg_isvalid wrapper to gfx () 2021-10-07 10:41:57 +03:00
Larpon f454d30318
gg: use sgl.begin_triangles when drawing triangles () 2021-10-07 03:45:23 +03:00
Larpon 42c088896a
gg: mute font print on Linux, use flag debug_font instead () 2021-10-07 03:45:02 +03:00
pancake 32259af2c9
v.parser: improve error message when no arch is set 'asm{}' () 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 ) () 2021-10-06 21:04:33 +03:00
yuyi 963233687e
v.fmt: fix fmt of 'fn(mut a &int)' () 2021-10-06 20:51:38 +03:00
yuyi f1742a6f62
v.ast: change 'type.to_ptr()' to 'type.ref()' () 2021-10-06 20:49:39 +03:00
Wertzui123 77c18f4435
cgen: fix alphabetic order of ast statement generation () 2021-10-06 14:32:42 +03:00
playX b2945e916f
js: add initial support for runes () 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] () 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 ) () 2021-10-05 11:44:48 +03:00
05st 7555b337b9
cgen: fix expr_as_cast for int/float literals () 2021-10-05 09:53:05 +03:00
playX 8d1ba52d0c
js: fix string.bytes codegen, readline, add tests for `strings` () 2021-10-04 18:28:30 +03:00
yuyi e94e08475d
cgen: format shared structs () 2021-10-04 18:27:38 +03:00
yuyi 03269f9854
cgen: fix error of reference struct str() () 2021-10-04 09:58:50 +03:00
Larpon a8c2c419cd
builtin: improve malloc panic messages () 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 ) () 2021-10-03 18:24:44 +03:00
Larpon b62520af9e
os: fix rare crash in read_file. Fix () 2021-10-03 18:24:06 +03:00
Anton Zavodchikov 895daf297f
vweb: router refactor () 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 () 2021-10-03 15:47:08 +03:00
spaceface 9b6e07e2a6
cgen: support `index` and `in` for sumtype/interface arrays () 2021-10-03 15:44:13 +03:00
yuyi 10caf4a84a
cgen: cleanup generated thread wait code () 2021-10-03 10:52:29 +03:00
playX 9145cd66ec
js: add more tests to builtin/js and implement more builtin functions () 2021-10-03 10:08:21 +03:00
05st 129c81f34d
cgen: implement eq operator for interfaces () 2021-10-03 09:04:05 +03:00
05st f282e64fe3
arrays: add binary_search, lower_bound, and upper_bound array operations () 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` () 2021-10-03 08:09:08 +03:00
05st 86a5e72c74
v.checker: fix return type checking being skipped for mutable method receivers () 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 () 2021-10-02 15:28:35 +03:00
Anton Zavodchikov 600880660a
net.http: add a deprecated attribute for un/escape functions () 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 () 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` () 2021-10-01 21:23:49 +03:00
05st 60ecbec8ea
cgen: fix closure code gen with if statement in definition () 2021-10-01 16:52:34 +03:00
Alexander Ivanov cb149bfa00
checker: show errors for index calls to values which are not functions, fixes () 2021-10-01 15:17:02 +03:00
zakuro ce0867f40c
vfmt: fix removal of selective imported type used in map () 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 () 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() () 2021-09-30 09:32:20 +03:00
Louis Schmieder f9ceb12e22
checker: fix orm cast check () 2021-09-30 00:43:08 +03:00
Larpon e3d3727c0c
toml: fix 7 escape tests () 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 () 2021-09-29 15:33:14 +03:00
Larpon 4ff061927b
toml: easier scanner configuration () 2021-09-29 14:53:06 +03:00
yuyi f2c710d306
cgen: fix fn mut args with interface type () 2021-09-29 13:54:23 +03:00
yuyi 8789cc422c
v.ast: fix fmt of 'bytestr' to '&byte' () 2021-09-29 13:53:46 +03:00
Larpon d39fec3479
toml: fix unbalanced quoted tests () 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 () 2021-09-28 19:35:07 +03:00
yuyi 5d3795e876
cgen: fix the C codegen error for '_ = map[key]' (fix ) () 2021-09-28 18:45:50 +03:00
Larpon bc4aad5fb4
toml: add quote details to ast.Quoted () 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 () 2021-09-28 10:28:04 +03:00
Ken a17b943e87
builtin: add method `byte()` for string () 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 () 2021-09-27 17:52:20 +03:00
yuyi d6a4bce2ef
checker: fix generic array.map with generic callback fn () 2021-09-27 17:50:15 +03:00
Larpon 2ee873d6ca
toml: fix invalid bad-multiline test () 2021-09-27 17:42:20 +03:00
Wertzui123 07d65b2aab
builtin: move byte methods from rune.v to int.v () 2021-09-26 22:34:25 +03:00
czkz 6967a47e07
net.openssl: fix typos in comments () 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 () 2021-09-26 19:41:50 +03:00
yuyi 4c01627e00
cgen: cleanup stmt_path_pos processing () 2021-09-26 15:51:18 +03:00
yuyi d93737dd34
cgen: fix assign map get to blank (fix ) () 2021-09-26 13:07:51 +03:00
Louis Schmieder 6391f3d2da
orm: fix other int types () 2021-09-26 11:17:56 +03:00
yuyi e09860731f
cgen: fix if expr with complex nested array call () 2021-09-26 07:35:48 +03:00
Larpon da47638f42
toml: correct documentation () 2021-09-26 07:34:47 +03:00
playX 863dd0b23e
js: array improvements () 2021-09-26 07:33:53 +03:00
penguindark f3757a7cd1
strconv: float memory leak fix () 2021-09-26 07:33:35 +03:00
yuyi d329e1decd
cgen: fix if expr with nested array calls (fix ) () 2021-09-25 20:38:33 +03:00
Larpon 13b2aa701c
toml: rename ast.Node -> ast.Value () 2021-09-25 20:31:02 +03:00
Anton Zavodchikov 80c15607da
json: assert encoded struct with a sumtype () 2021-09-25 20:29:52 +03:00
Larpon 970768288d
gg: expose sapp_desc.swap_interval via gg.Config () 2021-09-25 15:06:56 +03:00
Miccah 956fdffd96
net.http: allow custom headers in post_multipart_form () 2021-09-25 10:09:49 +03:00
Larpon 5541ec8670
vlib: add toml module + tests () 2021-09-24 21:13:52 +03:00
Ruofan XU 834cf40ab2
cgen, fmt, scanner: fix and use nested lambda in scanner () 2021-09-24 18:21:22 +03:00
Ekopalypse 400ab7876b
ast: fix fixed array typedef generation issue () 2021-09-24 17:01:42 +03:00
Anton Zavodchikov c75271fcb7
cgen: json sumtype inlining () 2021-09-24 16:49:00 +03:00
yuyi 430677a0c0
cgen: format generated C code of nested array call () 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 () 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() () 2021-09-23 12:05:11 +03:00
Alexander Ivanov 4d0f835548
checker: fix detection of invalid insertions, fixes () 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 () 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 `>` () 2021-09-23 02:24:23 +03:00
Delyan Angelov bf2569a9a8
all: support `mut volatile x := 123` declarations () 2021-09-22 13:06:30 +03:00
yuyi 76e360ce86
cgen: format the generated C code for array map/filter/all/any methods () 2021-09-22 09:24:36 +03:00
yuyi e5fb4e4845
cgen: fix if expr with array call (fix ) () 2021-09-22 02:21:18 +03:00
Alexander Ivanov b9720f5d9e
cgen: fix struct init with multiple branches, fixes () 2021-09-22 00:46:07 +03:00
yuyi 2f3925a0cf
fmt: format vlib/v/token/token.v () 2021-09-21 23:29:53 +03:00
yuyi de4c0c237b
cgen: fix if infix expr with array.all/any() () 2021-09-21 16:20:41 +03:00
yuyi 108a01d65f
fmt: fix unnecessary line break in array init (fix ) () 2021-09-21 16:20:09 +03:00
yuyi d6fa6a459c
checker: fix generic sumtype method () 2021-09-21 16:19:43 +03:00
ChAoS_UnItY 95136cbfc7
all: add unsigned shift operators () 2021-09-21 14:02:17 +03:00
penguindark e4bd2306da
sokol: upgrade to latest version, add program icon support ()
* updated sokol_gfx.h to the last version: 16d7b2e

* merged sokol_app and update enums.v

* added missing icons structs

* try to fixing Mac keyboard problems

* added v patch marker to sokol_app.h

* upgrade for sokol_gl.h, sokol_fontstash.h

* manage sgl_load_default_pipeline

* added load_default_pipeline() for sokol coherence

* vfmt sapp_structs.c.v

Co-authored-by: Delyan Angelov <delian66@gmail.com>
2021-09-21 09:55:06 +03:00
Alexander Medvednikov f6bdc6b87e tmpl: fix <div> inside <div> 2021-09-21 07:54:10 +03:00
Enzo b2ecca3966
all: remove `size_t` () 2021-09-21 02:12:38 +03:00
Alexander Medvednikov 4aa99e4303 tmpl: add a <div> test 2021-09-21 02:11:33 +03:00
Ruofan XU 1430ebc5e3
scanner: cleanup scanning of `>` () 2021-09-21 00:57:05 +03:00
Anton Zavodchikov d51f8ed878
v.gen.c: use unmangled variant name for encoding sumtype values in json () 2021-09-20 21:19:16 +03:00
ChAoS_UnItY 077c55d0c8
encoding.utf8: add `pub fn is_letter(r rune) bool` () 2021-09-20 21:16:50 +03:00
Delyan Angelov 5cf0ee46b3
v.pref,v.builder: support overriding the C cross compiler by setting `VCROSS_COMPILER_NAME` 2021-09-20 19:57:43 +03:00
El Koulali András 9c4507d115
cgen: fix illegal character encoding with rune consts above 127 () 2021-09-20 10:45:42 +03:00
Delyan Angelov 1de4f1af2e
ci: reduce chance of spurious go_wait_option_test.v failures by retrying it 3 times 2021-09-20 10:32:40 +03:00
05st f9f4867c25
tmpl: fix $tmpl comptime operation only working in return statement () 2021-09-19 23:22:26 +03:00
Rémi 2534946ead
json: support sumtypes () 2021-09-19 21:36:26 +03:00
Delyan Angelov 7bd145d88a
os,net: cleanup deprecated @VROOT usages 2021-09-19 16:24:24 +03:00
Ruofan XU b343f19bec
v.scanner: fix ambiguity of two-level generics and shift-right () 2021-09-19 16:22:28 +03:00
Delyan Angelov 76f70d51f3
ci: fix another options_test.v failute, refactor for readability 2021-09-19 08:49:52 +03:00
Delyan Angelov b5d8c53a0c
v.gen.c: fix the :X string interpolation format for isize/usize on 64bit systems 2021-09-19 05:09:03 +03:00
Alexander Medvednikov 6799f3ac5c orm: verify column name in updates 2021-09-19 04:49:29 +03:00
Rémi e76be4ba37
checker: temporary error for optional struct fields () () 2021-09-18 23:22:24 +03:00
Delyan Angelov 0b4e03ad5c
ci: fix the failing new options_test.v on the `ubuntu` job 2021-09-18 21:10:41 +03:00
Delyan Angelov 6b2cc9c5cf
v.pref: add a simple options_test.v to check for -cflags regressions 2021-09-18 16:08:15 +03:00
yuyi 8501217a4e
cgen: add gen_free_for_type_array/map() () 2021-09-18 15:18:32 +03:00
Delyan Angelov 0a7fb34613
checker: simplify noreturn.v 2021-09-18 13:43:15 +03:00
czkz 396eede4db
math: fix typos () 2021-09-18 12:23:31 +03:00
Delyan Angelov df8a4a03a0
tests: support `// vtest retry: 4` for marking flaky tests 2021-09-18 11:48:32 +03:00
Delyan Angelov eec930b86a
os: turn some panics into `return error()` 2021-09-18 10:45:04 +03:00
yuyi 39ad6da506
checker, cgen: generate .free() methods for custom structs automatically () 2021-09-18 09:38:42 +03:00
Delyan Angelov 2eeba4758a
v.builder: fix `-cc msvc -cflags /O2` and support CFLAGS and LDFLAGS env vars 2021-09-18 09:14:21 +03:00
Alexander Medvednikov 219a764a83 autofree: only free user reference types 2021-09-18 06:32:25 +03:00
Alexander Medvednikov 6d47dd22df autofree: free references 2021-09-18 04:19:16 +03:00
yuyi 44ec8a8cd4
v.fmt, v.gen.js: use 'if foo in [TypeA, TypeB]' in fmt.v and js.v () 2021-09-17 21:59:16 +03:00
Delyan Angelov bd65ceb463
v.markused: remove __print_assert_failure from all_fn_root_names 2021-09-17 21:47:22 +03:00
Ruofan XU 9180647f99
scanner, fmt: fix multi-level generics () 2021-09-17 21:44:31 +03:00
Alexander Ivanov 30e53c95c7
checker: handle `if _likely_(x is Interface) {` from () 2021-09-17 21:01:12 +03:00
yuyi fb75d528eb
builder: remove panics, when cleaning up tmp files after tests () 2021-09-17 20:56:33 +03:00
czkz 816c6c62b5
os: fix documentation typo in args.v () 2021-09-17 20:55:16 +03:00
Vincent Laisney 273154c1ae
math.big: add Newton and Karatsuba algorithms () 2021-09-16 19:31:07 +03:00
yuyi 467afad065
cgen: use `if foo in [TypeA, TypeB]` in cgen.v () 2021-09-16 19:26:53 +03:00
JalonSolov 1688148828
flag: switch panics to optionals () 2021-09-16 19:25:05 +03:00
Delyan Angelov 0a18690a4f
v.gen.c: fix assert `f().len == 1` calling f() twice (closes issue 11501) 2021-09-16 19:01:35 +03:00
playX c175b4fd48
v.gen.js: refactor code, fix alias codegen, `-stats` now again works with tests on the JS backend () 2021-09-16 14:00:15 +03:00
Miccah ead5e66afd
net.http: add post_multipart_form function () 2021-09-16 07:34:07 +03:00
Dialga f295469fac
net.urllib: make unescape() autofree compatible () 2021-09-16 07:09:20 +03:00
yuyi d5e00b0920
checker, cgen: fix generic arrays sum() () 2021-09-16 07:08:28 +03:00
yuyi 09ded16e3d
checker: use 'if foo in [TypeA, TypeB]' in checker.v () 2021-09-16 07:08:14 +03:00
playX 7d1776b84d
js: equality method generation for V types () 2021-09-16 07:07:48 +03:00
Alexander Medvednikov d00808660f json: omitempty 2021-09-16 07:02:43 +03:00
Delyan Angelov 5bc6cc9512
v.checker: fix spurious warning for `if x := map_of_sumtypes[k] {}` 2021-09-15 15:42:28 +03:00
JalonSolov 7145461cc5
arrays: switch panics to optionals () 2021-09-15 15:17:55 +03:00
Ekopalypse 41fc4c55c6
v.builder: simplify target architecture logic for msvc () 2021-09-14 17:47:26 +03:00
ChAoS_UnItY 0c0e28df6e
arrays: add more modern array operation functions () 2021-09-14 16:49:23 +03:00
yuyi 9554470985
checker, cgen: fix generic operator overload of 'cmp' () 2021-09-14 16:20:02 +03:00
yuyi 8862c3af0f
all: implement `if foo in [Foo1, Foo2, Foo3]` () 2021-09-14 15:56:12 +03:00
Alexander Medvednikov 12ec900d20 checker: fix the void type check 2021-09-14 01:02:32 +03:00
Daniel Däschle b63ec8fbcf
checker: require `params` attribute to use struct as keyword arguments in function () 2021-09-14 00:05:30 +03:00
Alexander Medvednikov ae41d1d3c6 builtin, cgen: more -nofloat fixes 2021-09-13 19:06:19 +03:00
Alexander Medvednikov 8fc0b486a2 builtin: fix string interpolation when compiling with -nofloat 2021-09-13 18:40:32 +03:00
Alexander Medvednikov c99281709b pref: define nofloat comptime define 2021-09-13 18:35:21 +03:00
Alexander Medvednikov 04d4431299 checker: remove another unnecessary error 2021-09-13 18:35:08 +03:00
Alexander Medvednikov cfcc57f5d3 checker: remove unnecessary "no methods" error; builder: skip float.c.v with -nofloat 2021-09-13 18:14:26 +03:00
ChAoS_UnItY 2ced845e30
arrays: add chunk and window functions () 2021-09-13 16:13:32 +03:00
playX b9dfc89aa9
js: prefix V builtin functions, so they do not overlap with JS () 2021-09-13 11:44:55 +03:00
Ulises Jeremias Cornejo Fandos 480fe8041a
math.stats: update math.stats using generics () 2021-09-13 10:20:38 +03:00
yuyi 30029eaf5d
checker, cgen: fix generic operator overload (fix ) () 2021-09-13 09:49:28 +03:00
Enzo 012da10517
ast, fmt: cleanup () 2021-09-13 04:08:58 +03:00
yuyi cd7d482c3b
checker: fix generic array append () 2021-09-12 15:09:11 +03:00
Enzo ccf6285f82
checker: allow mut arg on C functions () 2021-09-11 14:25:38 +03:00
playX 5b619b99c2
v.gen.js: Interfaces support, fix for error propagation & panic stacktraces () 2021-09-11 14:24:47 +03:00
Alexander Medvednikov 90e04d03b2 net.http: fix request_test.v 2021-09-11 06:16:00 +03:00
Ekopalypse f9eb14d914
builder: remove fPic argument from windows builds () 2021-09-11 04:48:02 +03:00
zakuro fb20a92b1e
fmt: fix a bug that break generics call in string inter () 2021-09-11 04:47:22 +03:00
Alexander Medvednikov 1546090131 vweb: remove a duplicate function parse_multipart_form 2021-09-11 04:21:10 +03:00
playX 07bd61582c
js: fix strconv build, BigInt infix fix () 2021-09-11 00:11:36 +03:00
Enzo c8471528ce
fmt: format long sum-types with a line for each type () 2021-09-10 20:56:55 +03:00
Alexander Medvednikov 5c4385a472 cgen: nofloat for kernel code 2021-09-10 20:54:48 +03:00
Daniel Däschle be0c54caf9
checker: require or block for sumtype map () 2021-09-10 16:07:39 +03:00
yuyi af75789bbf
parser: fix reference var followed by block expr () 2021-09-10 15:31:09 +03:00
yuyi 91c6eeeae5
cgen: fix `b := &[5, 6, 7]` () 2021-09-10 14:30:30 +03:00
Delyan Angelov bdd053fcf1
v.builder: fix `./v examples/v_script.vsh` on windows (this quickfix is thanks to yuyi98) 2021-09-10 12:30:40 +03:00
Delyan Angelov 7143b8ab37
v.checker: allow assigning pointers to fn variables (fix vinix compilation) 2021-09-10 11:48:36 +03:00
Alexander Medvednikov afeb1525a1 native: rename cgen to code_gen to avoid confusion with cgen 2021-09-10 03:17:53 +03:00
Alexander Medvednikov 0370d4f268 native: fix macho test 2021-09-09 23:00:54 +03:00
Dialga 66ef27a776
tmpl: fix escaping @ () 2021-09-09 20:27:24 +03:00
Alexander Medvednikov ab3adf3346 checker: no longer allow automatic dereferncing in `a = b` 2021-09-09 20:21:01 +03:00
Alexander Medvednikov d1e9aa49ea net.http: in memory cert verification 2021-09-09 19:55:57 +03:00
Vincent Laisney c8d4a64512
math.big: fix subtract_digit_array () 2021-09-09 14:56:20 +03:00
Enzo 1a2d5f65fb
builtin: add `size_t.str()` again () 2021-09-09 10:50:35 +03:00
Enzo e57b068df0
os: add `open_uri/1`, use it in `v bug` () 2021-09-09 10:48:53 +03:00
Delyan Angelov 4faa0f8487
v.checker: add checks for `.free()` methods 2021-09-09 09:54:06 +03:00
playX 72089c4feb
js: use prefixed names for functions and global symbols () 2021-09-08 20:30:46 +03:00
Subhomoy Haldar 96d4a0777f
math.big: fix comparison and add tests () 2021-09-08 20:30:20 +03:00
Alexander Medvednikov 4a2728e1bf checker: verify json.decode type 2021-09-08 14:49:02 +03:00
Alexander Medvednikov 55451baa03 builtin: i32 alias 2021-09-08 14:49:02 +03:00
yuyi e5360e164a
fmt: remove unnecessary parentheses after `return` (fix ) () 2021-09-08 14:19:53 +03:00
Enzo bef3390f36
builtin: fix compilation () 2021-09-08 14:19:21 +03:00
Vincent Laisney 43fae5de74
bigint: division () 2021-09-08 14:16:35 +03:00
Enzo 56ad5d72ef
builtin: add `.str` method for `i/usize` () 2021-09-08 13:41:08 +03:00
Enzo e3b65092d6
parser: deprecate `size_t` () 2021-09-08 13:09:32 +03:00
Ruofan XU 892971024e
parser: fix generic detection of `foo < bar<T>()` () 2021-09-08 05:54:15 +03:00
Enzo cc8ee5fb84
all: introduce `isize` and `usize` () 2021-09-08 05:53:39 +03:00
Alexander Medvednikov 577fedfce1 net.http: fix a bug with ? in new_request 2021-09-08 05:11:02 +03:00
Dialga 00433ba460
net.urllib: avoid a double free in set_path() when compiled with -autofree () 2021-09-07 21:11:03 +03:00
Enzo 79c2bca401
v.scanner: fix error messages with unexpected token `?` () 2021-09-07 20:46:56 +03:00
yuyi bee5e7de03
v.gen.c: fix generics array delete () 2021-09-07 20:40:21 +03:00
pancake ddc62ab0d3
native: native prints () 2021-09-07 15:44:15 +03:00
Delyan Angelov 0b6d585b07
v.gen.c: allow overriding of the == operator on C.Struct type aliases 2021-09-07 12:02:01 +03:00
Delyan Angelov aec016bb14
v.builder: change exit code of `v -check file.v` to 0, when file.v is clean from any errors. 2021-09-07 07:29:45 +03:00
Ned Palacios aedb6b8e84
v.builder: implement a `-check` mode, that runs only the parser + the checker, without codegen () 2021-09-07 07:17:53 +03:00
Xavier Noria 2533f06e1b
regex: define the predicate matches_string () 2021-09-07 07:01:23 +03:00
Dialga 905c292a81
tmpl: enforce stricter line checking for html interpolation () 2021-09-07 02:21:23 +03:00
penguindark bd10a63839
builtin: string interpolation: binary format support () 2021-09-07 00:12:54 +03:00
Delyan Angelov f5a22f15d9 time: fix `./v -o vcross -os cross cmd/v` on macos 2021-09-06 19:50:16 +03:00
Delyan Angelov c6ff687e8a
term: do not put the unused c_line field in C.termios in declarations_linux.c.v (breaks BSD build) 2021-09-06 19:15:47 +03:00
Delyan Angelov 166dd61e90
Revert "Revert "term: obtain the cursor position via termios.h ()""
This reverts commit 0376cbf6bd.
2021-09-06 19:04:14 +03:00
Alexander Medvednikov 0376cbf6bd Revert "term: obtain the cursor position via termios.h ()"
This reverts commit af28d09630.
2021-09-06 18:21:55 +03:00
AAAA af28d09630
term: obtain the cursor position via termios.h () 2021-09-06 17:24:39 +03:00
Lathanao 78c26e69cf
builtin: fix the string.index_any method () 2021-09-06 15:06:37 +03:00
yuyi 6084c0fc54
checker, cgen: fix complex generic sumtype (fix ) () 2021-09-06 03:15:53 +03:00
Dialga 87f38bf6e7
tmpl: don't trim whitespace and escape \ () 2021-09-06 03:12:53 +03:00
penguindark 438bdd1b0b
regex: fix () 2021-09-06 03:11:38 +03:00
Wertzui123 e5c4c408b5
readline: fix typo () 2021-09-06 03:11:25 +03:00
Alexander Medvednikov 71f1be5388 checker: fix a typo 2021-09-05 18:46:14 +03:00
yuyi 3fd2dd45a4
checker: do now allow type name shadowing () 2021-09-05 18:34:21 +03:00
zakuro aefe267970
fmt: fix removal of selective imported generic type () 2021-09-05 17:59:35 +03:00
Delyan Angelov 6b55b6d417
ci: add more details for diagnosing the sporadically failing init_global_test.v 2021-09-05 16:19:00 +03:00
yuyi 48e65a7bb2
checker: check type in match range (fix ) () 2021-09-05 04:50:43 +03:00
penguindark 724942c4e6
regex: bug fixes () 2021-09-05 04:48:59 +03:00
yuyi 87934ecf39
cgen: fix variable name are 'array' or 'string' (fix ) () 2021-09-04 19:51:45 +03:00
AAAA 289e77d51b
term: group related functions () 2021-09-04 19:49:47 +03:00
yuyi 5181031480
builtin: check array.sort_with_compare() arg mismatch () 2021-09-04 15:02:05 +03:00
Dialga 9b983bdd95
net.urllib: fix double free in escape() () 2021-09-04 14:57:09 +03:00
yuyi 923ef733c0
checker: disallow array sort with fancy args for now () 2021-09-04 14:34:29 +03:00
zakuro 19a43db2de fmt: fix removal of comment before embed in struct () 2021-09-04 11:02:04 +03:00
Delyan Angelov 91f7be98d0
builtin.js.v: run vfmt 2021-09-03 14:13:36 +03:00
Delyan Angelov 96ef553f59
checker: check sumtype common fields for mutability when assigning too 2021-09-03 13:33:25 +03:00
playX a4df418a68
js: support `[export: 'AnotherName']` for FnDecl codegen () 2021-09-03 13:00:24 +03:00
yuyi 67ab5b858b
checker: fix checking fn prototype mismatch () 2021-09-03 12:26:46 +03:00
yuyi 939a6417ce
cgen: fix reserved keywords as struct field () 2021-09-03 12:18:45 +03:00
playX 08c517c966
strconv,v.gen.js: proper optionals returns, strconv compiles to the JS backend () 2021-09-03 12:16:07 +03:00
Larpon bd33eaa3b8
os: add function to expand "~" to home directory () 2021-09-01 16:32:28 +03:00
penguindark 63ff5690ff
sokol.sapp,gg: add support for drag & drop events () 2021-09-01 09:21:27 +03:00
Delyan Angelov 56993b9e2d
net.http: support passing client certificates in http.fetch () 2021-09-01 01:43:35 +03:00
Enzo d1974f500f
cgen: cleanup `Gen.cc_type` () 2021-08-31 23:55:37 +03:00
Adam Oates 1b262c4f1d
vweb: show correct page on http error 404 () 2021-08-31 21:36:26 +03:00
Subhomoy Haldar dadfda9400
math.big: implement big.integer in V () 2021-08-31 19:21:00 +03:00
playX f8aaf4bf67
js: fix strings module () 2021-08-31 17:10:19 +03:00
Delyan Angelov a208138283
v.markused: support a const used as default value in struct init 2021-08-31 15:55:32 +03:00
Delyan Angelov f68bdb7805 v.markused.walker: support `for x in struct{}` iterators 2021-08-31 15:15:05 +03:00
Delyan Angelov 37b4553f52
v.parser: fix running `math` programs, from V installed in folders containing `.v` 2021-08-31 09:16:12 +03:00
zakuro ebed01c946
v.tests: add a test_ fn, that returns an optional () 2021-08-31 08:50:26 +03:00
Alexander Medvednikov b72a2de931 0.2.4 2021-08-30 22:25:14 +03:00
playX a9b705bfd8
js: fix printing, make builtins for result and option types behave correctly () 2021-08-30 20:47:18 +03:00
Delyan Angelov f33f216698
v.markused: fix compilation with `-prod -skip-unused` of programs that embed files 2021-08-30 17:57:33 +03:00
penguindark 8dcb27a11d
sokol: expose the toggle_fullscreen and is_fullscreen functions () 2021-08-30 17:10:14 +03:00
Delyan Angelov 9496fcdfe1 v.builder: fix compilation with tcc on FreeBSD 13.0 2021-08-30 13:21:49 +00:00
yuyi f44eb88a8d
vfmt: fmt '!(a in/is b)' to 'a !in/is b' () 2021-08-30 09:45:36 +03:00
playX 61ac7b671d
js: add initial support for optional types, IfGuardExpr codegen for `if` () 2021-08-29 14:27:17 +03:00
yuyi 985fe85de2
checker: show concretes type name in error message () 2021-08-29 12:08:57 +03:00
Daniel Däschle ac442abc11
checker: allow noreturn in match expr () 2021-08-29 11:57:11 +03:00
yuyi 4ce9ad6a56
util/module: fix mod_path_to_full_name() () 2021-08-29 11:56:05 +03:00
yuyi 8be2be8311
all: change 'if !(a in b)' to 'if a !in b' () 2021-08-29 11:55:18 +03:00
playX 118c5fdcd8
js: fix -stats compilation of tests, proper alias codegen () 2021-08-28 16:57:33 +03:00
Delyan Angelov f41939f005
ci: fix deprecations.out (time is now > 2021/08/28 00:00:00) 2021-08-28 13:02:59 +03:00
Alexander Medvednikov cf4081e2dd all: more chdir/chmod fixes 2021-08-28 12:52:48 +03:00
yuyi e90a624738
checker: fix generic fn infer variadic parameter with arrays () 2021-08-28 10:32:51 +03:00
Alexander Medvednikov f731060caf all: update chmod/chdir usages 2021-08-28 10:23:01 +03:00
Alexander Medvednikov 29f550158e all: update chdir usages 2021-08-28 09:39:18 +03:00
Alexander Medvednikov 853d3cb83e os: make chmod() return error 2021-08-28 09:37:24 +03:00
Alexander Medvednikov 858ba25d55 os: make chdir() return error 2021-08-28 09:35:39 +03:00
Larpon e85311c2ba
gg: change draw_cubic_bezier* call signatures for speed and to match *_poly () 2021-08-27 16:52:05 +03:00
William Gooch 4d5521bbf7
scanner: clarify the float literal warning () 2021-08-27 16:49:29 +03:00
Delyan Angelov c954c2834a net: add `-d trace_tcp` support for more TcpConn methods; support again `-d net_blocking_sockets` too 2021-08-27 13:10:34 +03:00
crthpl a85467eb0f
cgen: fix `expr in shared_array` () 2021-08-27 11:48:32 +03:00
Delyan Angelov 16455a7660 fmt: preserve local fn parameter, when a module const with the same name is declared 2021-08-27 09:22:53 +03:00
playX bdf11d969a
js: add basic support for running tests, fix string.replace_each () 2021-08-26 15:20:54 +03:00
Delyan Angelov db194abeac os: merge os.c.v and os_c.c.v 2021-08-26 10:01:55 +03:00
yuyi 187c1c160b
parser: minor cleanup in comp_call() () 2021-08-26 07:57:10 +03:00
yuyi b635ff80de
fmt: format '1.' to '1.0' () 2021-08-26 07:18:27 +03:00
Alexander Medvednikov 714fa3215c scanner: make the 1. float error a warning for now 2021-08-25 16:58:54 +03:00
playX 109d5d5847
js: `os` now compiles to the JS backend, more builtins & minor codegen fixes () 2021-08-25 14:40:53 +03:00
yuyi f257a23313
checker: check non-generic struct init () 2021-08-25 14:40:40 +03:00
Ned Palacios 50d1e9aa2b
mssql: fix c function definition parameters () 2021-08-25 14:39:56 +03:00
yuyi 4d078edb72
scanner: no longer allow `1.` float literals () 2021-08-25 14:39:37 +03:00
yuyi 96398efd2b
checker: check array insert/prepend arguments () 2021-08-24 20:28:05 +03:00
Fabricio Pashaj 0bf9197f41
net.http: add a close method to immediatly close the listener of a started http.Server, add more tests () 2021-08-24 19:21:24 +03:00
pancake 3c85a03b8a
v.gen.native: initial support for the asm statement in the native backend () 2021-08-24 15:30:41 +03:00
pancake 57b148032f
v.gen.native: initial support for cast statements () 2021-08-24 15:26:49 +03:00
Larpon 833bf2cf15
gg: add cubic Bézier curves + examples () 2021-08-24 06:35:27 +03:00
Lukas Neubert 3249f8f0e7
cgen: properly cast to sumtypes in array prepend and insert () 2021-08-24 06:25:09 +03:00
Alexander Medvednikov 4824b409b1 builder: simplify the C error message 2021-08-24 06:24:35 +03:00
Adam Oates 83e2a84c21
encoding: add base58 support () 2021-08-24 06:22:46 +03:00
playX d78e7e3b2b
js: codegen fixes, W.I.P `os` availability for JS backend () 2021-08-23 14:25:02 +03:00
Benjamin Stigsen 76205cff2b
gg: add scaling to draw_convex_poly () 2021-08-23 13:38:29 +03:00
Miccah 51d7aede68
net.http: render each header value on a newline () 2021-08-23 00:38:09 +03:00
Benjamin Stigsen 352df873d5
gg: add scaling to draw_empty_poly() () 2021-08-23 00:37:20 +03:00
Ulises Jeremias Cornejo Fandos 1cfc4198f5
vlib/math: Add a pure V backend for vlib/math () 2021-08-23 00:35:28 +03:00
playX dd486bb0fb
js: match support () 2021-08-22 19:36:49 +03:00
yuyi b80777df4b
table: fix alias of sumtype method_call () 2021-08-22 17:20:10 +03:00
Delyan Angelov ec196cfcd1
all: support overriding individual function from .v files in .c.v or .js.v files. 2021-08-22 15:51:26 +03:00
Simon ed06c47a51
net: remove sockets if they already exists () 2021-08-22 13:38:02 +03:00
yuyi 2e28c9a4d6
checker: remove a duplicate check () 2021-08-22 12:09:14 +03:00
penguindark fde934cd93
builtin: optimize hex() () 2021-08-22 11:10:24 +03:00
playX 2f6b2dd189
js: math.big support, f{32,64}_bits,from_bits support, typeof(expr).name support () 2021-08-21 17:18:57 +03:00
yuyi 0d81d0c0c6
table, checker: fix sumtype array appending aggregate type values (fix ) () 2021-08-21 17:18:01 +03:00
pancake 02d823fa6e
v.gen.native: support infinite loops `for {}` in amd64 and arm64 () 2021-08-20 14:23:15 +03:00
pancake 82b16453e4
v.gen.native: improve error messages for unsupported features () 2021-08-20 14:21:05 +03:00
Alexander Medvednikov c9d6242c6d json: top level array test 2021-08-20 11:41:09 +03:00
yuyi e87cf8bac6
checker: cleanup checker.v () 2021-08-20 10:25:16 +03:00
yuyi 6201e78201
checker: fix generic struct with non-generic interface in generic fn () 2021-08-20 09:28:26 +03:00
Hualin Song 4fb570522a
json: fix json.decode bug for u64 values greater than 2^31 () 2021-08-20 09:14:55 +03:00
playX 1570e613b5
math: inf,nan,fmod for the JS backend () 2021-08-20 01:14:49 +03:00
Benjamin Stigsen 70a658a265
gg: set_pixels() () 2021-08-20 01:14:25 +03:00
yuyi a440b43630
checker, cgen: fix generic struct with non_generic interface () 2021-08-20 01:13:48 +03:00
Miccah 2cb0db633d
vweb: use Response struct for 302 response () 2021-08-20 01:13:36 +03:00
spaceface 67e8031a08
cgen: fix interface parameters in fn type aliases () 2021-08-20 01:12:31 +03:00
Jordan Liese a9fb24cb5f
vweb: fix missing newline in redirect header string () 2021-08-19 14:58:57 +03:00
Miccah 6991a3c8d5
net.http: add graceful shutdown .stop() method to the http.Server struct () 2021-08-19 11:19:49 +03:00
Leo Developer 7bffabbce2
vdoc: add `-comments` and new comment merger () 2021-08-19 10:20:43 +03:00
Delyan Angelov fe08e1c504
strings: add Builder.write_rune/1 and Builder.write_runes/1 methods 2021-08-19 07:18:09 +03:00
Alexander Medvednikov 26b77515b9 builtin: optimize []rune.string() 2021-08-19 06:58:53 +03:00
yuyi 3d22dc1608
all: fix formating Foo<A,B> to Foo<A, B> () 2021-08-18 17:17:21 +03:00
div72 881510e7ce
cgen: fix enum print () 2021-08-18 17:11:12 +03:00
div72 2bf1015ae1
os: add File.read_into_ptr () 2021-08-18 17:08:41 +03:00
JalonSolov b3c641f7d5
time: use `&C.time_t` instead of `&time_t` in C fn declaration () 2021-08-18 17:05:43 +03:00
spaceface d2ce1f74d6
ast.table: fix aggregate field type equality check () 2021-08-18 14:09:54 +03:00
yuyi e07678d6f3
checker: check using redundant parentheses () 2021-08-18 13:49:50 +03:00
spaceface 09e854c064
cgen: small interface conversion fix () 2021-08-18 13:47:57 +03:00
Delyan Angelov 9ca99c6f93
v.builder: add `-Wl,--allow-multiple-definition` when targeting FreeBSD 2021-08-18 12:57:44 +03:00
playX 0121c8b4fd
v.gen.js: fix method calls and other codegen parts, rand module compiles () 2021-08-18 11:33:37 +03:00
yuyi c51f83efba
checker: fix match expr type mismatch () 2021-08-18 08:52:01 +03:00
JalonSolov 1dee4f25fd
vweb: add more common mime types () 2021-08-18 08:51:18 +03:00
spaceface 7d9969ac17
all: support runtime interface conversions () 2021-08-17 21:00:27 +03:00
spaceface 7c9a1defa4
fmt: preserve method receiver mutability in interface decls () 2021-08-17 19:39:53 +03:00
Delyan Angelov f96b81b53a
ci: fix failing vweb_test.v 2021-08-17 18:57:04 +03:00
yuyi e1c762a616
cgen: fix assert fn_call with parentheses (fix ) () 2021-08-17 18:21:15 +03:00
Alexander Medvednikov f8174c381c net.http: simplify fetch() 2021-08-17 09:17:03 +03:00
Miccah 19abe8c750
math.big: add from_bytes function () 2021-08-17 09:12:39 +03:00
pancake 90b25e7a4b
os: filesystem level locking api () 2021-08-17 08:21:33 +03:00
yuyi 8521e227b4
cgen: fix if expr of multi stmts () 2021-08-16 21:48:58 +03:00
Delyan Angelov 405ed584a1
v.vmod: return errors instead of panic-ing 2021-08-16 16:54:41 +03:00
Louis Schmieder 0d30667ab5
orm: fix orm unique lists () 2021-08-16 14:59:23 +03:00
Louis Schmieder 482eecbc13
cgen: fix comptime selector reserved field names () 2021-08-16 14:58:23 +03:00
Leo Developer b417d3c043
v.readline: fix key delete panic'king on linux () 2021-08-16 12:28:40 +03:00
Miccah d235de63e2
math: add egcd function implementing the extended Euclidean algorithm () 2021-08-16 11:49:50 +03:00
yuyi 90b052b1db
v.gen.c: fix error of if_expr in infix_expr () 2021-08-16 11:23:19 +03:00
Delyan Angelov 46ede3fb98
v check-md: reduce false positives for too long lines in various cases (real problems are easier to spot now) 2021-08-16 10:12:29 +03:00
Alexander Medvednikov fadfc3b457 gg: format a line 2021-08-16 06:36:23 +03:00
Alexander Medvednikov eb1ac5b30d time: use i64 in unix() 2021-08-16 06:28:54 +03:00
Lukas Neubert 1c847e04c8
fmt: fix malformed import for incorrect module lookup paths () 2021-08-16 05:15:32 +03:00
Miccah 60f21f065f
encoding.hex: remove strconv dependency () 2021-08-16 04:59:21 +03:00
Benjamin Stigsen 022503a107
gg: fix top left corner pixel not being drawn () 2021-08-16 04:59:05 +03:00
Miccah ea4f6fd48f
encoding: add a hex sub-module () 2021-08-15 21:42:51 +03:00
playX 659f823c5c
js: initial work on porting rand module to JS backend () 2021-08-15 18:09:51 +03:00
Delyan Angelov 0be20f1556
v.pref: keep the -error-limit option for now too 2021-08-15 13:46:50 +03:00
Leo Developer b3094b0667
checker: abort prematurely on too many errors () 2021-08-15 13:41:51 +03:00
Delyan Angelov 6843b85063
ci: fix `clang -std=c99 -D_DEFAULT_SOURCE -o v vc/v.c` warnings 2021-08-15 11:12:48 +03:00
Delyan Angelov eef7eea7bc
v.pref, v.builder: support `-no-std` (skips passing `-std=c99` to the C backend) 2021-08-15 11:05:06 +03:00
Delyan Angelov f7cbcc241a
v.pref, v.builder: support `-no-rsp` (pass C options directly to the C compiler backend, without writing response files) 2021-08-15 10:47:44 +03:00
Delyan Angelov f67e5d12e5
v.gen.c: fix v_typeof_interface_idx codegen (add `static `) 2021-08-15 09:15:33 +03:00
Delyan Angelov 3ffa6c1664
v.pref: fix `./v -usecache -cg run examples/hello_world.v` 2021-08-15 08:35:41 +03:00
yuyi d3cf53ec41
cgen: fix a bug with autofree in if expr () 2021-08-15 07:55:27 +03:00
Delyan Angelov d540b3f1a8
v.util: improve formatted_error by adding cached_file2sourcelines, so .split_into_lines is called just once (important for long source files with many errors) 2021-08-14 23:01:30 +03:00
Leo Developer f6d7170e77
checker: changes related to warn/error limit () 2021-08-14 22:14:13 +03:00
Delyan Angelov 1743ad05c0
v.util: add a small cache for util.read_file, so reading individual source files is done just once 2021-08-14 21:59:28 +03:00
Leo Developer 8a8a0932f7
all: add limit to accumulated errors / warnings () 2021-08-14 19:49:21 +03:00
Delyan Angelov deb26b92b9
cgen: support `typeof(x).idx`, as well as `iface.type_idx()` () 2021-08-14 17:22:25 +03:00
Subhomoy Haldar 8dc043ba2c
builtin: fix minor C fn definitions () 2021-08-14 17:19:27 +03:00
Delyan Angelov 900c37aa65
v.gen.c: support `T.typ` - an int for the type index of the generic type `T` () 2021-08-14 08:48:25 +03:00
penguindark fb3671107e
regex: bug fix about \w \W backslash chars () 2021-08-14 08:47:12 +03:00
playX b72d1e5e86
v.gen.js: implement `u64` and `i64` with BigInt () 2021-08-13 21:24:10 +03:00
Delyan Angelov 34d39ccb64
builtin: fix leak in rune.str(), fix leaks in most assert x == y statements in tests () 2021-08-13 18:37:34 +03:00
Subhomoy Haldar 0bd68bf5a2
builtin: rename invalid parameter names in C fn declarations () 2021-08-13 17:03:39 +03:00
playX aa14fd1b05
v.gen.js: support operator overloading () 2021-08-13 10:06:59 +03:00
yuyi 083a90148d
tests: supplement multi-instances generic testing () 2021-08-13 08:38:20 +03:00
yuyi 579aa7b1b5
v.checker: fix multi insts of generics fn with generic struct () 2021-08-12 22:58:02 +03:00
Delyan Angelov 576664e31f
gg,sokol,stbi,gx,fontstash: cleanup for -Wimpure-v 2021-08-12 22:42:42 +03:00
Delyan Angelov 8fbd8f790d
os: cleanup for -Wimpure-v 2021-08-12 21:53:29 +03:00
Delyan Angelov 47884dfd1f
builtin: move C. calls to .c.v files () 2021-08-12 21:46:38 +03:00
playX c9e9556a92
js: array.delete_last() () 2021-08-12 19:39:33 +03:00
Miccah 1a7ba6f6d4
vweb: fix catchall route () 2021-08-12 19:05:50 +03:00
FireRedz a8905e2788
gg: add a `color` field to gg.DrawImageConfig () 2021-08-12 11:11:38 +03:00
Daniel Däschle 6dbc6f233b
v.parser: add checks for interoperability (C. or JS.) function declarations () 2021-08-12 10:47:24 +03:00
yuyi 89a8854e57
v.parser: fix generics type name in if_expr () 2021-08-12 10:19:06 +03:00
zakuro 9c74fb0449
cli: fix bug that caused help to panic () 2021-08-12 09:25:28 +03:00
penguindark 6771b7fea9
regex: added documentation about multiple dots syntax error () 2021-08-12 08:54:57 +03:00
yuyi 90adf4d092
v.checker: fix multi insts of generics struct with array () 2021-08-11 16:59:13 +03:00
Delyan Angelov a64a4d932c
v.checker: turn `interface field ... must be initialized` to a notice temporarily 2021-08-11 16:39:41 +03:00
Enzo 9d4d0a9894
v.gen.c: generate the closure helper for the choosen target platform, not the current one () 2021-08-11 14:09:40 +03:00
div72 8c2f7901aa
cli: have a posix mode to handle -- () 2021-08-11 12:26:17 +03:00
wilesun 18be9e52be
log: avoid using string__plus memory leak () 2021-08-11 09:26:02 +03:00
playX 70124d2d23
js: time module: implement utc,now,local () 2021-08-11 09:22:53 +03:00
Shobi 012b3f0f64
orm: refactor insert part of orm_stmt_gen () 2021-08-10 23:31:09 +03:00
Enzo da53f818df
all: initial support for closures (x64 / linux-only) () 2021-08-10 21:27:15 +03:00
pancake 2cfb8fd697
native: document arm64 registers with comments () 2021-08-10 21:15:32 +03:00
yuyi aceaaa681d
ast: fix formatting fn variadic of reference param () 2021-08-10 21:14:37 +03:00
Daniel Däschle 2ae77c1998
v.scanner: fix escaped backslash after string interpolation () 2021-08-10 17:04:42 +03:00
playX 8d6903a65a
time: move C backend specific code into .c.v files () 2021-08-10 14:34:53 +03:00
yuyi 11794039e2
v.gen.c: fix fn variadic of reference param () 2021-08-10 10:36:11 +03:00
pancake e7b8cf17e5
v.gen.native: add support for assert statements for amd64 () 2021-08-10 10:29:44 +03:00
Enzo 506c30a291
builtin: remove methods that can be autogenerated () 2021-08-09 15:42:31 +03:00
Enzo 1a555ab898
v.gen.c: fix generation for `string.index` () 2021-08-09 07:39:15 +03:00
Daniel Däschle a64b191ce5
checker: forbid multiple pointer yields () 2021-08-09 02:11:53 +03:00
yuyi eed8c4671f
cgen: fix fn mut arg of array () 2021-08-09 01:49:30 +03:00
playX 7a67a08d2f
js: implement codegen for array.sort and implement .any,.all () 2021-08-09 01:46:40 +03:00
yuyi 1f3f7705a2
cgen: fix struct_init with fixed array field () 2021-08-08 10:54:52 +03:00
Alexander Medvednikov 03ed32f805 ast: bring back Table.free() for now 2021-08-08 07:07:06 +03:00
Alexander Medvednikov eaf8b63dd2 cgen: fix a c2v bug with variadics 2021-08-08 06:23:22 +03:00
Delyan Angelov e32c65c322
ci: fix TcpConn.set_blocking on windows 2021-08-07 23:27:25 +03:00
Delyan Angelov b22c335496
net: add TcpConn.get_blocking/0, TcpConn.set_blocking/1 methods, change TcpConn.read_line to set the connection to blocking, if it was not already 2021-08-07 23:21:55 +03:00
Daniel Däschle 9af65d8830
checker: protect against assigning to a typeless variable () 2021-08-07 18:09:07 +03:00
yuyi 1d3786ff1e
v.parser: fix `if a == Abc{} {` () 2021-08-07 18:05:22 +03:00
playX 94c321c80d
v.gen.js: port fully the array test suite & add fixes () 2021-08-07 17:58:49 +03:00
Uwe Krüger c560d58f1e
cgen: use heuristic to detect circular reference in auto str () 2021-08-07 14:56:09 +03:00
Delyan Angelov 7d3476cbca
ci: fix tests-sanitize-address-clang job (regression after 9995f6c) 2021-08-07 14:37:51 +03:00
Sebastian Schicho 9995f6cca1
encoding.base64: speed up encoding and decoding ()
* add new function headers

* new encoding function

* rename to decode_micro and add helper functions

* implement new decoding function

* add test for buffer to buffer decoding

* - add notice to GO code
- v fmt base64.v

* implement new decoding function

* fix base64_memory_test.v by commenting a few lines

* vfmt base64.v

* add some more asserts to base64_memory_test.v

* remove unused decoding function

* add bounds check, when detecting the padding

* use union for storing the decoded data

Co-authored-by: Delyan Angelov <delian66@gmail.com>
2021-08-07 00:09:55 +03:00
Caden Haustein cf0767ad6c
v: add constant folding AST transformation () 2021-08-06 23:19:18 +03:00
yuyi ec39e38e14
cgen: fix generic method on alias struct receiver () 2021-08-06 21:26:54 +03:00
Daniel Däschle 3b116d2455
cgen: support embedded struct fields on sumtype common fields () 2021-08-06 21:26:19 +03:00
Dialga 25d49bc615
orm: handle empty fields () 2021-08-06 21:25:38 +03:00
alula e1cc1665dc
cgen: push function arguments in fn_args() () 2021-08-06 20:01:20 +03:00
Uwe Krüger e89bed3e25
ci: temporarily deactivate test case for (fixes CI timeouts) () 2021-08-06 12:46:56 +03:00
Louis Schmieder a4358a6801
orm: fix unique fields () 2021-08-06 06:21:59 +03:00
zakuro 490dec222f
fmt: keep char literal, `'` () 2021-08-06 06:21:28 +03:00
Daniel Däschle 91ade5bf8c
cgen: fix shared field init () 2021-08-06 05:11:03 +03:00
Enzo 44bacfc931
cgen: fix optional generation order () 2021-08-06 03:57:34 +03:00
Enzo 7346aeca5f
cgen: refactor array sort generation () 2021-08-06 03:55:48 +03:00
Daniel Däschle 8d2567740b
parser: make [..] work () 2021-08-06 03:54:24 +03:00
yuyi c30cda3daf
v.gen.c: fix error of `println(alias of struct)` () 2021-08-05 20:20:10 +03:00
yuyi 11784279ba
checker: check fn_call().sort() (fix ) () 2021-08-04 21:23:22 +03:00
Daniel Däschle f59119485a
v.parser: add check for existing type on sum type declaration () 2021-08-04 18:14:16 +03:00
Daniel Däschle 310b51c883
vlib: remove unused `os2` module () 2021-08-04 17:56:08 +03:00
Delyan Angelov f9c279d11d
v.checker: make calling a deprecated fn an error, 180 days (6 months) after its deprecation date () 2021-08-04 17:41:00 +03:00
Delyan Angelov efa8dcf4d2
time: turn Time.unix to i64, so it can represent times before 1970-01-01, fix time operators, add more tests () 2021-08-04 13:12:02 +03:00
Delyan Angelov 1bf6d04e37
ci: fix failing program_test.v due to deprecation warnings 2021-08-04 12:58:06 +03:00
yuyi 5162c257a2
v.parser: minor cleanup in parse_type.v () 2021-08-04 12:49:36 +03:00
playX 8743b616a0
v.gen.js: codegen fixes, add a few builtins, port more array tests () 2021-08-04 12:46:24 +03:00
Daniel Däschle 800c0e5092
vlib: remove deprecated map{} usages as well as deprecated functions () 2021-08-04 12:44:41 +03:00
yuyi b870f7a6f1
cgen: fix array sort error () 2021-08-04 06:31:57 +03:00
yuyi 2eb11110d6
cgen: fix autofree error of array init with string variable (fix ) () 2021-08-04 03:39:20 +03:00
Daniel Däschle 815c4b7420
all: rename generic_struct_inst to generic_inst () 2021-08-04 03:37:27 +03:00
Leo Developer 3677391329
vdoc: add v/preludes_js/ to .vdocignore () 2021-08-03 18:52:45 +03:00
pancake 00d4c7082e
native: add support for print, eprint and eprintln () 2021-08-03 16:04:31 +03:00
Alexander Medvednikov 80976e640c vweb: remove init_server() from all examples, tutorials, and tests 2021-08-03 16:03:16 +03:00
Alexander Medvednikov f879b3e221 ci: run gitly 2021-08-03 15:41:52 +03:00
playX 0455632b1f
v.gen.js: fix prefix, postfix and assign codegen and add more array tests () 2021-08-03 14:59:46 +03:00
Delyan Angelov 0ebad47d2a
v doc: fix an infinite recursion in `v doc .` executed in /tmp. Add tests for v.doc.get_parent_mod/1 . 2021-08-03 13:36:58 +03:00
yuyi fd58e9f819
cgen: fix auto str for map of reference struct (fix ) () 2021-08-03 08:03:00 +03:00
Enzo fc193bebf2
builtin: add documentation for builtin array functions () 2021-08-03 06:25:33 +03:00
Louis Schmieder a55ba08fad
orm: fix time () 2021-08-03 05:17:00 +03:00
Leo Developer 6dcf72fe9b
cgen: dont generate function if its flag is false () 2021-08-03 03:17:22 +03:00
Yuval Greenfield 820669b011
math.fractions: make the numerator and denominator public () 2021-08-02 18:50:11 +03:00
Florian Blasius 69f31d8d5c
checker: check int literal to enum cast (fix ) () 2021-08-02 07:12:29 +03:00
pancake dbf5c976a3
v.gen.native: support more `ifs` constructs for amd64 () 2021-08-01 20:19:02 +03:00
Miccah cc9463401e
http: change server handler from function to interface () 2021-08-01 15:50:11 +03:00
playX 836ac54d12
v.gen.js: add more array tests and fixes () 2021-08-01 14:08:49 +03:00
playX 77e9ed417f
v.gen.js: fix segfault when anonymous function is declared with assertion () 2021-08-01 07:27:44 +03:00
Delyan Angelov 33e4dc3ad3
ci: fix coutput_test.v on windows by fixing `-o -` on windows 2021-08-01 00:27:06 +03:00
Uwe Krüger 6068777e03
parser/checker: deduce type of global from initialization expression () 2021-07-31 16:35:19 +03:00
Delyan Angelov e374ffb590
checker: add an early checker error for `node.left_types.len != node.left.len` in assignments 2021-07-31 14:57:29 +03:00
Delyan Angelov 9082712e10
ci: skip coutput_test.v on windows temporarily 2021-07-31 14:17:33 +03:00
Delyan Angelov d82d41d804
os: fix os.dir, os.base, os.file_name, when the argument contains / on windows 2021-07-31 13:52:54 +03:00
Delyan Angelov 1231e5df20
debug coutput_test.v on windows 2021-07-31 13:27:28 +03:00
Delyan Angelov 456a19f6d4
ci: fix coutput_test.v on windows 2021-07-31 13:16:33 +03:00
Delyan Angelov 08016ab374
v.gen.c: add vlib/v/gen/c/coutput_test.v, to ease testing of produced C output 2021-07-31 12:14:56 +03:00
Delyan Angelov 033b027361
v.gen.c: use `const type* const_x` for `const_x &type` fn args 2021-07-31 08:42:40 +03:00
Delyan Angelov 26b7712bbe
tests: add a regression test for the comptime evaluated consts, using a _constructor function 2021-07-30 20:33:08 +03:00
Louis Schmieder 0bb587c8c2
checker: fix defer ident handling & fix defer optional error message () 2021-07-30 20:29:06 +03:00
Uwe Krüger a7c2aaf35b
cgen: initialize globals directly for simple cases () 2021-07-30 19:20:45 +03:00
Delyan Angelov f67922782e
ci: fix tools using `import math`, for `const x = i64(-9223372036854775807-1)` fails 2021-07-30 17:56:46 +03:00
Delyan Angelov 06d1422a05
ast,checker,cgen: support simple `const x = u16(0x53)` without using _vinit() 2021-07-30 17:22:27 +03:00
Delyan Angelov afb7168a64
hash: move dummy map initialisation into an `fn init(){}`, so users do not have to do it explicitly to be compatible with -skip-unused 2021-07-30 13:25:37 +03:00
playX a7ca051016
v.gen.js: fix for array filter, add more tests and other fixes () 2021-07-30 11:17:11 +03:00
Delyan Angelov c31397e17d tests: fix `v test-self` running locally 2021-07-30 09:26:05 +03:00
Alexander Medvednikov ec92964bb0 checker: make interface init check a warning for now 2021-07-30 03:32:02 +03:00
Delyan Angelov 7d5b6d2b48
fix running `v run file.v` in a current working folder containing a run/ subfolder 2021-07-30 03:28:54 +03:00
Delyan Angelov 44892fd942
os: let `os.dir("/xyz")` return "/" (fixes compiling .v files in /) 2021-07-30 03:28:53 +03:00
Louis Schmieder 7c504920e1
checker: fix negative values for unsigned integers () 2021-07-30 03:27:59 +03:00
Daniel Däschle 6fa8e4269e
checker: force interface init () 2021-07-30 03:18:20 +03:00
blackshirt 1eac351f25
math.big: change the return value of divmod to (quotient, remainder) () 2021-07-30 02:28:32 +03:00
pancake 6337325676
v.gen.native: improve few x64 generators () 2021-07-30 01:26:49 +03:00
Uwe Krüger 44d8dcc418
ci,globals: hot fix for hanging test case () 2021-07-29 22:06:08 +03:00
Lukas Neubert 1e255d3ab1
fmt: cleanup redundant generic types code () 2021-07-29 15:21:10 +03:00
yuyi 57f30668e3
v.checker: fix `a.map(voidfn(it))` () 2021-07-29 11:43:56 +03:00
playX 75c41252d9
js: add more tests & add array prepend codegen () 2021-07-29 11:39:36 +03:00
Uwe Krüger 08aa6c08f6
all: more improvements for global variables () 2021-07-29 10:57:31 +03:00
Delyan Angelov 7547882c11
ci: fix failing fn_args.vv (use `zu8` as a temporary name of the unaliased `u8` type, since `uu8` is already used in fn_args.vv as a function name) 2021-07-29 10:14:55 +03:00
Delyan Angelov 7a9b326200
ci: fix -cstrict rebuilding of V with clang 2021-07-29 09:54:52 +03:00
Alexander Medvednikov b79dd7f0b3 builtin: re-enable u8 alias 2021-07-29 06:46:12 +03:00
Alexander Medvednikov 09df5adbdd builtin: re-gen v.c 2021-07-29 06:45:04 +03:00
Alexander Medvednikov 1343ec7444 builtin: fix temporary u8 alias 2021-07-29 06:42:22 +03:00
Alexander Medvednikov 0b9b80e0c9 cgen: register u8 2021-07-29 05:02:13 +03:00
Alexander Medvednikov 628498e0dc table: register u8 type 2021-07-29 05:00:03 +03:00
Alexander Medvednikov a7270148e5 builtin: remove u8 alias to re-generate v.c 2021-07-28 22:41:41 +03:00
Alexander Medvednikov 65126efdc3 builtin: remove u8 for now 2021-07-28 22:36:04 +03:00
Delyan Angelov d25bd95a0e
v: support -show-depgraph in addition to -show-callgraph 2021-07-28 16:42:11 +03:00
playX e3cf95b058
js: add more tests for array, support array insert_many, minor fixes for references () 2021-07-28 13:01:00 +03:00
shadow 66bc8bc0cb
vlib: remove many deprecated functions () 2021-07-28 09:22:19 +03:00
yuyi 9f4431544d
checker: fix typo in selector_expr() () 2021-07-28 08:28:55 +03:00
Uwe Krüger 45ad48d76a
cgen: properly handle initialization expression for globals () 2021-07-28 08:11:55 +03:00
Delyan Angelov 8eb544146e
os: fix building V on Haiku 2021-07-27 20:28:04 +03:00
Uwe Krüger abd17ddb6a
cgen: initialize globals with default initializer when none is given. () 2021-07-27 20:14:30 +03:00
Alexander Medvednikov a56f579e0d Revert "cgen: define new u8 type"
This reverts commit b7f2adb69c.
2021-07-27 19:38:48 +03:00
Alexander Medvednikov b7f2adb69c cgen: define new u8 type 2021-07-27 19:07:47 +03:00
Delyan Angelov ef0161c233
v.markused: handle compiling vweb, `-live` and orm example programs 2021-07-27 15:50:42 +03:00
Miccah e98817e5ce
sync: only release semaphore in WaitGroup when there are waiters () 2021-07-27 15:49:51 +03:00
Delyan Angelov b0a721b2ec
js: draft support for compiling `-b js x_test.v` 2021-07-27 13:49:47 +03:00
Delyan Angelov 6e0c9f637d
v.markused: support `import json` programs too 2021-07-27 13:00:07 +03:00
Delyan Angelov 6134c4870b
v.util: extract v.util.version, use it to speed up building `v repl`, `v up` and `v doctor` 2021-07-27 12:59:56 +03:00
yuyi cb7be87d4e
parser: fix struct init and assign using `sql` variable () 2021-07-26 21:14:31 +03:00
Delyan Angelov 79c7aed3c2
gg: allow easily detecting the edges of key_down keyboard events 2021-07-26 18:39:59 +03:00
Delyan Angelov 0d12d55295
gg: allow customisation of the image format in gg.new_streaming_image 2021-07-26 11:05:16 +03:00
yuyi 4cf91a28f6
checker: fix generics interface with multi generic types () 2021-07-26 08:54:57 +03:00
Delyan Angelov b666482d84
ci: fix the vinix-build job 2021-07-26 08:50:05 +03:00
Delyan Angelov b44f81528f
v.gen.c: fix codegen for `const a = u64(5) + 5` 2021-07-26 08:06:59 +03:00
Delyan Angelov db5e0f2117
v.gen.c: fix cgen regression after f457b94 (prevented vinix builds), add tests 2021-07-25 23:31:23 +03:00
Delyan Angelov 6438099644
builtin: fix building vinix (missing C.strerror) 2021-07-25 23:31:22 +03:00
penguindark e4e6c90292
zip: read in memory () 2021-07-25 21:29:51 +03:00
Delyan Angelov 684c10af1f
json: support for a [required] field attribute () 2021-07-25 17:27:37 +03:00
Ben-Fields 8a097293a8
sokol: define a pixel color format () 2021-07-25 17:27:07 +03:00
Alexander Medvednikov e246ed9818 cgen: fix VUNREACHABLE on freebsd/tcc 2021-07-25 16:29:05 +03:00
yuyi ab20b8c53a
cgen: fix generics interface with multi generic structs () 2021-07-25 15:54:22 +03:00
Uwe Krüger a6245a56d8
builtin: fix Windows panic message () 2021-07-25 15:34:48 +03:00
Delyan Angelov 0bcb955258
checker: fix regression of anon fns that have loops with break/continue 2021-07-25 10:46:31 +03:00
Uwe Krüger 55c5b9ce7b
cgen: panic with error message when `go` command fails () 2021-07-25 01:13:34 +03:00
Daniel Däschle a09324faa9
scanner: remove pos 0 hack which is no longer needed () 2021-07-25 01:13:07 +03:00
Louis Schmieder 1943da54a5
orm: integrate psql to orm () 2021-07-24 20:49:40 +03:00
Miccah a0e27d3fd9
net.http: refactor the Response struct () 2021-07-24 20:47:45 +03:00
zakuro 3979e5c5ff
v.parser: show better position for sort struct init warning () 2021-07-24 20:41:59 +03:00
Daniel Däschle 3be8ef3b5a
checker: check duplicated field and method (only for fields that are anon-fns for now) () 2021-07-24 16:06:09 +03:00
spaceface a621149fc2
builtin: add bdwgc to thirdparty, statically link it on Windows () 2021-07-24 16:04:26 +03:00
playX f51fa7e665
v.gen.js: fix references and add iterator to map () 2021-07-24 15:35:17 +03:00
Delyan Angelov 45a15755b8
v.builder: implement -show-callgraph 2021-07-24 13:32:56 +03:00
Delyan Angelov c8e671d88c
v.pref: support a `-show-callgraph` option 2021-07-24 13:32:56 +03:00
Delyan Angelov a4c9aeab14
v.ast.walker: pass nodes by reference 2021-07-24 13:32:56 +03:00
Delyan Angelov 9ffbda3833
v.scanner: improve error diagnostic when scanner's file_path is not a file 2021-07-24 13:32:55 +03:00
Delyan Angelov b9771ea120
v.checker: small cleanup for incomplete match errors 2021-07-24 13:32:55 +03:00
Delyan Angelov 72c56ccc85
v.builder: use os.write_file/os.write_file_array for writing full files to disk. 2021-07-24 13:32:55 +03:00
Miccah 0acb84d5a5
net: add parse_headers function and handle header line folding ()
Closes https://github.com/vlang/v/issues/10930
2021-07-24 11:31:33 +03:00
a-iga 304f26edeb
flag: fix panic when given an empty string as args () 2021-07-24 11:26:00 +03:00
Delyan Angelov 29f55bdf9b time: fix V compilation for solaris 2021-07-24 11:17:54 +03:00
yuyi 29cda252f1
builtin: fix multiple array init () 2021-07-23 23:25:12 +03:00
Louis Schmieder 3d907caa3f
gen: fix comptime attrs stmts () 2021-07-23 23:24:56 +03:00
Uwe Krüger 1e5627e777
parser: don't require unary `>` prefix for `select` timeout () 2021-07-23 23:24:27 +03:00
Louis Schmieder 1999850f88
checker: disallow labels in defer statements () 2021-07-23 22:35:05 +03:00
playX 69cbdf9fdc
v.gen.js, os_js: port the OS module to JS () 2021-07-23 18:04:36 +03:00
Delyan Angelov 6313ed6a79
checker,cgen: fix `-os cross` support for `$if !solaris { #include <sys/ptrace.h> }` 2021-07-23 16:24:42 +03:00
Delyan Angelov c797e1460d
checker: do not skip any of the top level `$if OS {` branches in `-os cross` mode 2021-07-23 15:53:03 +03:00
yuyi f5776eb259
cgen: fix multiple assign array index () 2021-07-23 15:46:18 +03:00
Louis Schmieder 26db3b0995
orm: redesign orm (re-write it in V) () 2021-07-23 12:33:55 +03:00
Delyan Angelov ad41cd5c6f
cgen: fix `dump(fn_name)` (closes ) 2021-07-23 12:24:12 +03:00
Lukas Neubert 5e4cbcc1e3
fmt: unify struct field align code () 2021-07-23 12:12:09 +03:00
Lukas Neubert 3cc54d8e81
vfmt: split up asm code into more granular methods, add test () 2021-07-23 08:58:06 +03:00
Daniel Däschle 091ce6cc08
cgen: fix several sort declarations () 2021-07-23 08:55:55 +03:00
Daniel Däschle a2de3ffcdb
checker: check if condition optional () 2021-07-23 08:52:51 +03:00
shadow fe5e3c452f
parser: disable generic type aliases () 2021-07-23 01:17:16 +03:00
Daniel Däschle 2c0c211c79
all: implement accessing embedded field and method of aggregate () 2021-07-23 01:14:39 +03:00
Daniel Däschle f40090e8ff
checker: fix break inside anon fn () 2021-07-23 01:13:36 +03:00
Delyan Angelov 44828cbb29
ci: fix -cstrict job 2021-07-22 18:47:23 +03:00
Daniel Däschle ed234188b7
scanner: fix single backslash in raw string () 2021-07-22 17:02:11 +03:00
Delyan Angelov b537c9f624 tests: add a separate File.tell() test 2021-07-22 16:25:23 +03:00
Delyan Angelov c4da74dbf6 ci: fix building V on windows with tcc (regression since d7dcb47) 2021-07-22 14:50:22 +03:00
Delyan Angelov 9171c1131e
ci: skip a failing f.tell() test on macos only 2021-07-22 13:28:00 +03:00
Delyan Angelov ec585b4a54
os: fix sporadic failing glob_test.v 2021-07-22 13:26:23 +03:00
Bastian Buck 8f3646cb81
os: fix debugger_present for solaris ()
-solaris has no `sys/ptrace.h`, instead `ptrace` is included in  `sys/types.h` and `unistd.h`
2021-07-22 10:44:00 +03:00
Louis Schmieder 742f6f849c
checker: check using a map as a struct init in parameter () 2021-07-22 10:42:59 +03:00
Delyan Angelov d7dcb47db3
os: implement File.seek/2 and File.tell/0 2021-07-22 08:00:21 +03:00
Daniel Däschle 054bd67490
cgen: don't change field name of c structs () 2021-07-22 01:37:49 +03:00
Delyan Angelov 06de9c799c
Revert "gen: add type name to comp for ()"
Reason: 713a079 is more general and provides the same information.

This reverts commit dd3ee20566.
2021-07-21 23:56:00 +03:00
Louis Schmieder dd3ee20566
gen: add type name to comp for () 2021-07-21 23:45:08 +03:00
Uwe Krüger 713a079684
cgen: properly support `typeof()`, sizeof(), ... in compile time `for` () 2021-07-21 23:43:30 +03:00
Daniel Däschle 12884e9eb7
checker: disallow invalid pointer arithmetic () 2021-07-21 23:39:49 +03:00
Uwe Krüger 41982053f1
builtin: make `array.delete()` reallocate, provide `.delete_many()` () 2021-07-21 20:55:32 +03:00
Alexander Medvednikov de6784a007 net: base address_freebsd.c.v on darwin instead of linux 2021-07-21 17:31:32 +03:00
yuyi ec87f4ee99
table: fix error of generics interface declaration () 2021-07-21 15:24:52 +03:00
Alexander Medvednikov e38b0d7e9f net: freebsd fixes 2021-07-21 14:29:45 +03:00
Lukas Neubert 38100faecf
fmt, parser: fix pos.last_line for assembly blocks () 2021-07-21 11:48:12 +03:00
Daniel Däschle aebb028349
gen: fix C keyword escape to _v_ instead of just v_ () 2021-07-21 11:46:04 +03:00
shadow 591af866ba
checker: prohibit returning a fixed array () 2021-07-21 11:39:22 +03:00
Delyan Angelov c12cd0c964
ci: workaround for failing net tests 2021-07-21 09:58:40 +03:00
Delyan Angelov d41a4ec662
v test-self: check unsafe_test.v, match_test.v, match_in_fn_call_test.v with -cstrict 2021-07-20 19:34:16 +03:00
Delyan Angelov 24c59881f5 v.gen.c: do not use precomputed const values in -usecache mode (fix `v test-all` on M1) 2021-07-20 17:52:07 +03:00
Daniel Däschle 3f5e3c4bfe
gen: fix haiku platform () 2021-07-20 16:13:23 +03:00
Delyan Angelov 2c9f6899ba
v.gen.c: fix `v -cstrict -o vtmp_werror cmd/v` on Apple M1 2021-07-20 16:09:47 +03:00
Delyan Angelov 5098334e65
os: add execute_or_exit(cmd), use it consistently instead of execute_or_panic(cmd) 2021-07-20 15:22:04 +03:00
yuyi 850a715c79
table: minor cleanup in does_type_implement_interface() () 2021-07-20 15:19:02 +03:00
Uwe Krüger f457b94fe4
cgen: properly support reference args in receivers and arithmetic op methods () 2021-07-20 15:08:32 +03:00
Lukas Neubert 05d0288e8d
fmt: move asm related code into it's own file () 2021-07-20 15:07:15 +03:00
Daniel Däschle f6402eae10
checker: check `match` with type alias () 2021-07-20 15:06:36 +03:00
Daniel Däschle 60b705b4c4
checker, gen: implement basic struct embed direct field init support () 2021-07-20 15:06:06 +03:00
Daniel Däschle ad3835b598
parser: deprecate short struct init () 2021-07-20 11:17:08 +03:00
Uwe Krüger de39bba7bd
v.gen.c: fix calling pointer receiver on function return result () 2021-07-20 08:30:07 +03:00
Delyan Angelov eed4f50d8c
ci: fix sanitize failures with math.big 2021-07-19 20:51:41 +03:00
Enzo 1db354c360
v.gen.c: fix codegen ordering problem with interfaces with interface fields () 2021-07-19 19:57:12 +03:00
Delyan Angelov 732d8101e0
math.big: add .bytes() and .bytes_trimmed() methods, `big.from_int(1024).bytes_trimmed() == [byte(0x00), 0x04]` 2021-07-19 17:17:08 +03:00
Daniel Däschle 9127e202d5
v.parser: fix error on empty name expr () 2021-07-19 17:09:51 +03:00
playX 425ca5e3c3
v.gen.js: add three backend options for JS, and comptime if support () 2021-07-19 15:55:03 +03:00
yuyi 8e99a018df
checker, cgen: fix generics interface method () 2021-07-19 13:29:46 +03:00
yuyi cf82bd3407
checker: fix fixed array with const unint type size (fix ) () 2021-07-19 12:44:03 +03:00
yuyi fdba3607af
checker: fix generics fn selector expr with unexpected symbol () 2021-07-19 09:16:15 +03:00
Delyan Angelov 83b0a80ff4
ci: fix MSVC build (delay const string initialiastion to _vinit) 2021-07-19 08:20:09 +03:00
Delyan Angelov 8ea576783b
tests: fix failed consts test (it now works properly) 2021-07-19 01:18:39 +03:00
Delyan Angelov 241a7b760d
strconv,checker,cgen: fix -cstrict compilation of hello_world.v 2021-07-19 01:08:48 +03:00
Delyan Angelov 48546d0f45
all: do compile time const evaluation for `const x = "abc" + "xyz"` and `const x = 16 * 1024 + 5` (fix const prealloc_block_size) 2021-07-18 22:59:18 +03:00
Delyan Angelov 3ccde5ce55
builtin: use `prealloc_block_size = 16777216` temporarily 2021-07-18 17:03:25 +03:00
Delyan Angelov 016240d00b
v: support `-o - x_test.v` too, describe `-o -` in the `v help` screen 2021-07-18 16:41:32 +03:00
Delyan Angelov a007dd5d22
builder: support `-o -` to print the generated C/JS source to stdout 2021-07-18 16:26:50 +03:00
yuyi a5c784830b
all: simplify global_scope processing () 2021-07-18 15:29:34 +03:00
shadowninja55 eb65ad078d
checker: prohibit passing non-lvalue as `voidptr` () 2021-07-18 15:04:16 +03:00
Miccah 1a6a7a678a
vweb: change Context.headers from string to struct Header () 2021-07-18 12:21:07 +03:00
playX d5e0fa6d1b
v.gen.js: port string methods and fix booleans () 2021-07-18 09:00:20 +03:00
yuyi 8b8f496762
checker: fix generics fn return generic interface (fix ) () 2021-07-18 08:55:19 +03:00
Delyan Angelov 6edfb2c7fe
v.parser: eliminate PrefixExpr from `&Type(x).name` and `&Type(x)[idx]` too (fix vinix build) 2021-07-17 20:20:20 +03:00
Delyan Angelov fc8a8e3b6f
ci: fix failure for function_stored_in_global.vv 2021-07-17 18:19:20 +03:00
Delyan Angelov ee9e91b8e7
builtin: fix `-d no_backtrace` error with tcc 2021-07-17 18:09:16 +03:00
Delyan Angelov 568aa742b2
v.parser: improve conditions for debugging ast.CastExpr parsing 2021-07-17 17:49:29 +03:00
Delyan Angelov b0167297e5
builtin: support `-d no_backtrace` on macos/bsd too 2021-07-17 17:49:28 +03:00
yuyi 3a0fa550b6
checker: fix generics fn inferring map type (fix ) () 2021-07-17 17:49:21 +03:00
div72 d84ffbf73c
runtime: decrement default cpu amount in nr_jobs () 2021-07-17 17:07:59 +03:00
spaceface 22fcbe70a2
checker: allow omitting `{}` in trailing struct args () 2021-07-17 15:44:44 +03:00
crthpl ec47cda386
cgen: fix other generic pointer cases () 2021-07-17 11:51:42 +03:00
William Gooch 51dd8304bb
tools: make the `v` REPL help screen look nicer () 2021-07-17 11:23:29 +03:00
shadowninja55 355f46f475
gen: implement `thread.str()` () 2021-07-17 11:19:28 +03:00
shadowninja55 0d587d3580
checker: prohibit using non-lvalue as mut receiver () 2021-07-16 13:03:40 +03:00
yuyi fe64346ae2
parser: minor optimization of array filtering judgement () 2021-07-16 12:00:37 +03:00
Delyan Angelov cbe4ac703e
v.builder: remove temporary file.js file after `v -b js run file.v` 2021-07-16 10:03:46 +03:00
Delyan Angelov 0723daf788
tests: add vlib/v/gen/js/program_test.v to ease regression testing `-b js` programs 2021-07-16 09:36:45 +03:00
spaceface ebc34c237b
cgen: fix generating invalid Option decls for generic interfaces () 2021-07-15 22:15:25 +03:00
yuyi aca66d503d
parser: minor optimization in call_expr() () 2021-07-15 17:47:59 +03:00
yuyi ddaac5af92
checker: fix generics with multi generic struct types () 2021-07-15 17:39:55 +03:00
playX 06edbc8a38
v.gen.js: implement most of array and map methods in builtin/js () 2021-07-15 17:36:53 +03:00
Delyan Angelov 027be2ecd4
tests: show a list of all failed commands in the summary too 2021-07-15 11:53:14 +03:00
shadowninja55 7c0be629ab
checker: prohibit fixed array to fixed array assignment where elem_typ is a pointer () 2021-07-15 08:38:03 +03:00
spaceface 6e942bf4c2
v: initial support for generic interfaces and sumtypes () 2021-07-15 08:29:13 +03:00