Commit graph

964 commits

Author SHA1 Message Date
Delyan Angelov
51e19dd54e
examples: fix gg: 0 notice for bounce.v 2024-01-08 04:30:16 +02:00
Anton
763f94388b
all: update copyright year (#20334) 2024-01-01 23:29:54 +02:00
shove
cc250baf3c
cgen: fix missing line breaks in generated code with closure IIFE, when compiled with '-g' (fix #20306) (#20316) 2023-12-31 07:04:41 +02:00
Delyan Angelov
923b410d4d
x.vweb: fix $vweb.html() integration in cgen for the newer x.vweb module (fix #20204) 2023-12-30 23:05:07 +02:00
Delyan Angelov
c4180d4b06
examples: shrink examples/gg/minimal.v even more 2023-12-29 16:46:18 +02:00
Delyan Angelov
0b4a93c1c1
examples: add an even smaller gg usage example, demonstrating how to always show the builtin fps counter, and how to avoid importing gx 2023-12-29 16:31:01 +02:00
Yuyi_Hao
680b0d463a
example: add a path finding algorithm visualizer using gg (#20060) 2023-12-28 23:19:28 +02:00
el-gringo
5be5cd9be1
websocket: enable using an already existing connection (from vweb or another http server) (#20103) 2023-12-19 14:16:07 +02:00
Swastik Baranwal
25c900f439
examples: minor refactor in the xvweb example (#20206) 2023-12-17 20:51:32 +02:00
Larpon
6d0d82dbb9
gg: fix overlapping slices in draw_slice_filled() (#20182) 2023-12-15 19:31:33 +02:00
Casper Küthe
70c575a9f2
examples: add TODO app example with x.vweb (#20175) 2023-12-14 20:20:16 +02:00
yuyi
5d99138cb2
checker: fix generic fn with generic fn call returning generic map (fix #20106) (#20150) 2023-12-12 11:41:58 +02:00
Delyan Angelov
2de9a24f2f
examples: increase the resolution of the generated image in examples/wasm/mandelbrot 2023-12-11 16:54:09 +02:00
Hitalo Souza
1b3c4f596e
examples: serve the wasm mandelbrot project using a v web server (#19937) 2023-12-11 14:10:06 +02:00
Delyan Angelov
131052c1ed
ci: rename duplicate example files, to make them unique, and reduce false positives in v build-examples on windows. 2023-12-11 13:40:57 +02:00
Casper Küthe
08189d649c
vweb2 (#19997) 2023-12-09 08:07:51 +03:00
Delyan Angelov
4687f8c1f7
examples: add an example of a simple process wrapper, built around an interactive python process, in wrapping_interactive_python.v 2023-12-08 14:39:08 +02:00
Larpon
64e8139d46
examples, x: fix notice about assigning 0 to a reference field (#20115) 2023-12-07 22:34:53 +02:00
Delyan Angelov
4b3109237d
builtin: deprecate string.last_index/1 for string.index_last/1, and string.last_index_u8/1 for string.index_u8_last/1 (#20095) 2023-12-05 13:56:59 +02:00
Delyan Angelov
c88f0d382c
examples: show how to turn on CORS in a vweb server app 2023-11-30 13:50:07 +02:00
Alexander Medvednikov
51bb2768ca vweb: .html('custom_template.html') 2023-11-26 03:01:48 +03:00
Delyan Angelov
5e37798560
ci: run VAUTOFIX=1 ./v check-md -hide-warnings . to fix doc failures 2023-11-25 09:34:46 +02:00
Alexander Medvednikov
f09826e928 all: unwrap const() blocks 2023-11-25 10:02:51 +03:00
Turiiya
c80515465e
docs: update deprecated blockquote highlight syntax (#19974) 2023-11-23 13:33:33 +02:00
Delyan Angelov
f7b9e4eafd
vfmt: automate transition from the old [attribute] to the new @[attribute] syntax (#19912) 2023-11-17 17:43:29 +02:00
Turiiya
b347f546f2
all: update remaining deprecated attr syntax (#19908) 2023-11-17 12:03:51 +02:00
Joe C
757929392e
all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
shove
e92d210bd0
checker: add missing check when assignment statement lvalue is ParExpr (fix #19819) (#19830) 2023-11-11 13:27:00 +03:00
Casper Küthe
a176021afe
picoev: improve raw mode, change fn signature for the raw_cb field to fn (mut Picoev, int) (#19817) 2023-11-11 09:36:52 +02:00
Delyan Angelov
d86b3689d9
tests: workaround name conflict, causing false positives with msvc on windows, when both tests were executed at the same time (locked executable) 2023-11-07 14:41:25 +02:00
Delyan Angelov
50c22b5a12
os: implement os.fd_is_pending/1, os.Process.pipe_read/1, os.Process.is_pending/1 (#19787) 2023-11-07 13:47:25 +02:00
Turiiya
e34e06350a
pref: fix unintended file extensions in default output names, allow for v run file.c.v (#19745) 2023-11-03 19:51:44 +02:00
Delyan Angelov
03709169e2
ci: mark more tests as flaky 2023-11-03 07:12:33 +02:00
Joe C
a63f3e6f77
coroutines: use photon work_pool when nr_jobs > 0, and use photon libc fn wrappers (#19711) 2023-10-31 20:12:52 +03:00
Larpon
775b25e11b
sokol: update to match uptream at 9e0f1b4 (#19687) 2023-10-28 17:15:46 +03:00
Larpon
95509cf8fb
all: make all struct C.XYZ -> pub struct C.XYZ (#19651) 2023-10-25 15:01:50 +03:00
Turiiya
9051ac8921
all: fix typos (#19634) 2023-10-23 21:21:15 +03:00
Delyan Angelov
0fb38edcb6
ci: fix vcreate_input_test.v on FreeBSD (expect is in /usr/local/bin there, if installed) (#19578) 2023-10-16 10:11:51 +03:00
Alexander Medvednikov
545ee1ae23 checker: stricter rules for C types; C aliases; sokol fixes 2023-10-14 18:31:44 +03:00
pomid
5f1e6815cd
examples: fix net_udp_server_and_client.v with latest V and latest net module (listen on 0.0.0.0, and dial to 127.0.0.1) (#19564) 2023-10-14 17:08:26 +03:00
Turiiya
c4ee940047
tests: fix input tests with expect, not covering false negatives (#19518) 2023-10-10 20:37:21 +03:00
Alexander Medvednikov
4f85b49bb5 all: new int fixes 2023-10-08 14:12:38 +03:00
Larpon
3c68e78f32
sokol: fix usage of sokol sampler (#19527) 2023-10-07 21:05:30 +03:00
Alexander Medvednikov
0bf85d049e sokol: upgrade to latest version, fix all related issues 2023-10-05 20:22:49 +03:00
Tim Marston
756075380b
orm: add null handling and option fields (#19379)
* orm: added is none and !is none handling

* orm: added NullType, support option fields and deprecate [nonull]

Nullable DB fields are now determined by corresponding option struct field.  The
[nonull] attribute is deprecated and fields are all NOT NULL now, unless they
are option fields. New orm primitive, NullType, added to support passing none
values to db backends, which have been updated to support it.  Also, empty
string and 0 numberic values are no longer skipped during insert (since they may
be valid values).

* orm: fix [nonull] deprecation warning

* orm: add null handling to update and select

also, improved formatting for orm cgen, and removed optimised operand handling
of orm `is` and `!is` operators

* sqlite: read/report NULLs using new orm NullType

* postgres: returning data primitives now returns new orm.NullType

* orm: initialise NullType Primitives properly

* orm: do not smart cast operands inside sql

* orm: fix bad setting of option value

* orm: improve orm_null_test.v, adding/fixing selects

* orm: cleanup: rename NullType->Null, use serial const, cgen output

* orm: handle automatically generated fields more explicitly

During insert, fields which are
* [sql: serial]
* [default: whatever]
and where the data is a default value (e.g., 0, ""), those fields are not sent
to the db, so that the db can generate auto-increment or default values.  (This
was previously done only for [primary] fields, and not in all circumstances, but
that is not correct -- primary and serial/auto-increment fields are differnet.)

* orm: udpated README

* orm: select cgen fixes: read from uninit res; fail to init res

* orm: udpated tests

* orm: fix option sub-struct fields

* orm: fixed joins to option structs

Changed orm.write_orm_select() so that you pass to it the name of a resut
variable which it populates with the result (or not) and changed use of it in
sql_select_expr() and calls in write_orm_select() to populate substructs.

* orm: fix pg driver handling of NULL results

* orm: move runtime checks to comptime checker; cache checked tables

* orm: vfmt :(

* orm: markdown formatting

* orm: renamed orm.time_ and orm.enum_; updated db drivers

* checker: updated orm tests

* orm: fix issue setting up ast option values as orm primitives

* checker: ORM use of none/options and operations (added tests)

* orm: fixed tests

* db: clean code

* examples: remove orm nonull attributes

* orm: skip test memory santisation for orm_null_test.v

* orm: make the type-to-primitive converstion fns not public

* orm: mv object var c-code from checker->cgen; fix memory corruption

Code in checker/orm.v used the SqlStmtLine object field name to store c-specific
referenecs to option and array fields (for arrays of children).  I moved this
logic to cgen.  And fixed an issue introduced with option fields, where an array
of children was unpacked into a non-array result which could corrupt memory.

* orm: fixed vast error

* orm: skip 2 tests on ubuntu-musl which require sqlite3.h

* cgen: prevent casting a struct (string)

* v fmt orm_fkey_attribute.vv, orm_multidim_array.vv, orm_table_attributes.vv; run `VAUTOFIX=1 ./v vlib/v/compiler_errors_test.v`
2023-10-05 19:09:03 +03:00
Delyan Angelov
7a49f24eb1
examples: fix brainvuck.v (handle [ and ] properly); allow both brainvuck.v wasm_codegen/bf_compiler.v to work with .b files too 2023-10-03 17:01:55 +03:00
l-m
7ebee2ed36
examples: add a brainfuck->wasm compiler example (#19492) 2023-10-02 14:42:02 +03:00
Alexander Medvednikov
5cc1db8318 0.4.2 changelog 2023-09-30 14:41:41 +03:00
Delyan Angelov
6fc3a3d088
examples: add examples/gg/sample_count.v, showing the influence of the sample_count gg.Config parameter 2023-09-29 12:06:06 +03:00
Keito Tobichi
86a2917fdd
examples: add another graph example for bread first search with backtracking (#19463) 2023-09-28 14:23:58 +03:00