Commit graph

1488 commits

Author SHA1 Message Date
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
Turiiya
e465f7490c
tests: cleanup legacy temp path (#19716) 2023-10-31 15:16:19 +02:00
Turiiya
3708061d61
tools.vpm: fix install --once for external modules, add already installed info, add test (#19702) 2023-10-31 15:00:30 +02:00
Turiiya
a2dabddc70
testing: add temporary file hash to prevent accidental collisions with test file binaries (#19710) 2023-10-31 08:07:51 +02:00
Turiiya
1c4c5050de
v.help: add [noreturn] attribute to print_and_exit (#19706) 2023-10-30 14:58:45 +02:00
Turiiya
109fc22269
tools.vpm: simplify, use more stdlib functionality part2, add more tests (#19692) 2023-10-30 03:21:28 +02:00
Turiiya
00165d147b
tools: add vpm tests for installing modules with different URLs/identifiers (#19664) 2023-10-29 11:22:21 +02:00
Turiiya
5c2eafc154
fmt: recognize or blocks in call args (#19690) 2023-10-29 11:15:07 +02:00
Turiiya
b9d0aedb09
tools: cleanup vcreate tests (#19666) 2023-10-29 04:36:16 +02:00
Turiiya
491558af69
tools.vpm: simplify, use more stdlib functionality (#19665) 2023-10-28 18:39:59 +03:00
Larpon
775b25e11b
sokol: update to match uptream at 9e0f1b4 (#19687) 2023-10-28 17:15:46 +03:00
Turiiya
c09b66b00b
tools: move vpm.v into its own cmd/tools/vpm/ module (#19659) 2023-10-26 09:51:44 +03:00
Delyan Angelov
d11db9a3aa
tools: make the commit message more informative, for the repo for https://fast.vlang.io/ in cmd/tools/fast/website/ 2023-10-26 08:21:16 +03:00
Turiiya
a1063bd63d
vcreate: fix v init with project names containing dashes (#19619) 2023-10-25 20:39:14 +03:00
Delyan Angelov
f5c4864db8
tools: print an error message, when make is needed, but is missing on unix 2023-10-25 20:23:07 +03:00
Turiiya
9051ac8921
all: fix typos (#19634) 2023-10-23 21:21:15 +03:00
Turiiya
8a8129cd5c
vdoc: add hr style, use prettier version 3 in the CI (#19628) 2023-10-23 10:30:34 +03:00
Turiiya
a132345e08
parser: fix vet bad top level statement error for one file programs (#19613) 2023-10-23 09:54:08 +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
Turiiya
06fb8f0ffa
vcreate: don't use template names as project descriptions (#19439) 2023-10-12 07:10:28 +03:00
Turiiya
2332c17bea
tools: fix typos (#19546) 2023-10-11 03:16:59 +03:00
Turiiya
3e50ba0856
ci: update and cleanup the ci related code (#19541) 2023-10-10 21:39:00 +03:00
Turiiya
37e5616b4d
tesst: fix vcreate test failing on macOS (#19536) 2023-10-10 01:05:57 +03:00
Turiiya
4dee1e051a
vcreate: add tests for module creation with v new (#19519) 2023-10-09 18:55:26 +03:00
yuyi
169a6b5ce0
native: fix native new_int errors (#19532) 2023-10-09 12:27:48 +03:00
yuyi
05d940ac2a
fmt: simplify formatting assign statement comments (#19524) 2023-10-08 13:32:22 +03:00
yuyi
e3ba197361
ast, parser, checker, cgen: cleanup ast.ArrayInit (#19526) 2023-10-08 13:31:52 +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
c0a7397637
native: support -no-builtin (generate executables < 1KB Linux with v -no-builtin -b native examples/hello_world.v) 2023-10-02 19:44:02 +03:00
Alexander Medvednikov
5cc1db8318 0.4.2 changelog 2023-09-30 14:41:41 +03:00
yuyi
74997fd824
ast, cgen: fix as cast with call expr (fix #19453) (#19462) 2023-09-29 11:59:14 +03:00
Turiiya
1a2ad27e79
vcreate: update templates, add lib (#19444) 2023-09-28 19:06:00 +03:00
Delyan Angelov
b3ee304381
tests: skip testing v -os windows -experimental -b native -o hw.exe examples/hello_world.v on !windows 2023-09-27 12:31:33 +03:00
Delyan Angelov
c075e44ec1
ci,examples: fix v examples/sokol/simple_shader_glsl/simple_shader.v, ensure it compiles on the misc-tooling job (#19404) 2023-09-21 19:44:58 +03:00
Casper Küthe
74d80a5120
orm: add support for V enum struct fields (#19374) 2023-09-18 16:06:26 +03:00
Delyan Angelov
cf0856cea9
tools: add -E flag to v test-parser, that will show the partial source that caused the parser to fail with -no-builtin -check-syntax file.v 2023-09-16 17:17:13 +03:00
asvln
2cce907dcb
orm: add references attribute to allow foreign key declarations on fields (#19349) 2023-09-16 12:04:32 +03:00
Delyan Angelov
24cb98d5dc
parser: fix regression for v -e "import os; import math;", add a test to check it (#19353) 2023-09-15 09:59:05 +03:00
Delyan Angelov
f3aec20000
all: support ; statements, allowing for oneliners like ./v -e 'import os; println( os.ls(os.args[1])!.sorted(a > b) )' vlib/math (#19345) 2023-09-15 00:44:15 +03:00
Delyan Angelov
b746083b44
tools: skip _input.vv files in cmd/tools/git_pre_commit_hook.vsh, just report them without vfmt-ing them 2023-09-14 22:46:10 +03:00
Casper Küthe
e8d133d548
orm: fix cgen inserting wrong array index (#19324) 2023-09-12 14:50:13 +03:00
Turiiya
51fa83dbbd
vdoc: prevent main-content outline with certain devices / browsers (#19304) 2023-09-08 07:54:48 +03:00
yuyi
a23f89e243
fmt: simplify the processing logic for removing inline comments (#19297) 2023-09-07 16:00:00 +03:00
Delyan Angelov
3739175fdb
tools: fix notice in cmd/tools/vpm.v, found after ./v -N build-tools 2023-09-06 15:17:59 +03:00
Turiiya
dac6f0b0c9
vdoc: improve html tag escape (#19266) 2023-09-06 09:42:18 +03:00
Turiiya
0e154bbbfd
vdoc: update html escape test to cover more cases (#19272) 2023-09-06 09:39:06 +03:00
yuyi
18e60e77de
fmt: remove inline comments (#19263) 2023-09-03 23:51:56 +03:00
Alexander Medvednikov
84f70c56a0 tools: improve changelog helper; finish 0.4.1 changelogs 2023-09-03 22:40:26 +03:00
Alexander Medvednikov
ae4fe20b5e tools: changelog_helper.v for speeding up changelog generation; more 0.4.1 changelogs 2023-09-03 19:44:44 +03:00