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

14542 Commits

Author SHA1 Message Date
fe2db64384 tests: add unsafe block for the int->enum cast in bench_compare_tokens.v (#16438) 2022-11-15 18:34:44 +02:00
5dc5766def doc: minor update for $\{\} (#16440) 2022-11-15 18:33:33 +02:00
017ace6ea7 vfmt: change all '$expr' to '${expr}' (#16428) 2022-11-15 16:53:13 +03:00
56239b4a23 toml: fix typo in parser.v (#16430) weekly.2022.46 2022-11-14 21:08:22 +03:00
58cee6ccc8 checker: disallow none type in struct fields (#16425) 2022-11-14 17:48:00 +03:00
91ecfb917c checker: fix generic fn casting &u8 to &alias to u32 (#16420) 2022-11-14 17:37:53 +03:00
37583b04b4 gg: make create_image's receiver immutable 2022-11-14 17:25:42 +03:00
f44af02e32 sqlite: affected rows count (#16426) 2022-11-14 17:23:42 +03:00
1a4d1aece4 checker: minor cleanup and optimization in method_call() (#16421) 2022-11-13 22:33:36 +02:00
eb11b0149d tools: fix git_pre_commit_hook.vsh on windows 2022-11-13 21:57:10 +02:00
1978176c22 tools: add an utility cmd/tools/git_pre_commit_hook.vsh script
That script can be used to ensure that all commited V files are vfmt-ed,
i.e. it will run `v fmt -w ` on them before commiting them.

To use the script in your V project, you need to be in the main folder
of your project, then do the equivalent of:
```sh
cp /PATH/TO_YOUR/V/cmd/tools/git_pre_commit_hook.vsh .git/hooks/pre-commit
chmod 755 .git/hooks/pre-commit
```

Note: you can use this command:
`git config --bool --add hooks.stopCommitOfNonVfmtedVFiles true`
... to make it just *prevent* the commiting of unformatted .v files,
i.e. stop the commiting, if they are not, but *without modifying them*
automatically (you will then need to run `v fmt -w` on them manually).

Note 2: Git supports the option `--no-verify`, to temporarily disable all hooks.
2022-11-13 21:22:46 +02:00
38555a92e1 time: change days_from_civil to days_from_unix_epoch, add date_from_days_after_unix_epoch (#16363) 2022-11-13 14:30:14 +02:00
7cfaacbe7a doc: add more examples to vlib/time/README.md (#16362) 2022-11-13 13:48:07 +02:00
5a28699edb cgen: minor cleanup in auto_str_methods.v (#16411) 2022-11-13 11:59:32 +03:00
f31a3b4250 checker: check sumtype argument mismatch in generic methods (fix #16340 part2) (#16403) 2022-11-13 11:58:53 +03:00
e8e75251b4 vweb: change optional to result in vweb_test (#16412) 2022-11-13 11:57:35 +03:00
b54f9c2949 parser: fix attributes with optional or result types (#16401) 2022-11-12 18:35:01 +03:00
9a8602ff03 doc: improve types order (#16399) 2022-11-12 11:42:30 +02:00
46f1b20bbc doc: split TOC into two rows (#16397) 2022-11-12 10:06:10 +02:00
5bb058e35b gg: revamp the Context pipeline for more effects, implement an additive effect (#16394) 2022-11-12 09:39:18 +02:00
7d31473523 doc: add links (#16398) 2022-11-12 09:35:35 +02:00
12f01318c2 v.live, cgen: enable using [live] in modules too (monitor used .v files for changes, not just the top level one) (#16396) 2022-11-11 22:06:42 +02:00
c9ce5f89c7 builtin: fix f32.str() (#16391) 2022-11-11 13:56:45 +02:00
c1a44efc78 tests: ensure that const loading is stressed in live_test.v, to prevent -live regressions for more complex examples like bounce.v 2022-11-11 10:45:54 +02:00
e9fac05775 cgen: fix v -cc tcc -live run examples/hot_reload/graph.v too 2022-11-11 10:20:18 +02:00
202f9574ec cgen: fix v -live -cc gcc examples/hot_reload/graph.v 2022-11-11 10:20:17 +02:00
3a85955d22 all: rollback to old interpolation (step 4) (#16383) 2022-11-11 11:06:01 +03:00
993e21e85b checker: check fntype mismatch of struct field init (fix #16372) (#16381) 2022-11-10 20:19:19 +02:00
196b01aef7 all: minor cleanup of optional and result (#16382) 2022-11-10 20:14:20 +02:00
26d643fc5d all: rollback to old interpolation (step 3) (#16380) 2022-11-10 15:05:34 +03:00
bbae7a705f checker: fix incomplete implicit ast.CastExpr{} replacements 2022-11-10 13:59:22 +02:00
7543b769ad checker: allow for all.children := { "abc": rect, "def": rectangle()}, where children is map[string]Widget, without needing explicit casts for all the map values 2022-11-10 13:59:21 +02:00
46921480fc comptime: fix embed file with variable argument (fix #16360) (#16375) 2022-11-10 04:09:51 +02:00
bbd0603b41 checker: add check for unknown generic types in type alias decl (#16377) 2022-11-10 04:08:00 +02:00
2634b99769 sqlite: expose SQLite's VFS layer (#16359) 2022-11-09 19:57:06 +02:00
7e000bb6ae embed_file: correct test file name (#16376) 2022-11-09 19:55:51 +02:00
a199a9afab all: rollback to old interpolation (step 2) (#16373) 2022-11-09 17:37:27 +03:00
dd5f6186a1 all: rollback to old interpolation (step 1) (#16370) 2022-11-09 11:57:54 +03:00
7830597b66 checker: add check for multi level fn aliases (#16361) 2022-11-09 10:36:39 +02:00
ce79c9c876 checker: extract valid_comptime_ constants into v.checker.constants (#16371) 2022-11-09 10:07:21 +02:00
a07f77ac52 make: add 'rebuild' target (clean and reset sub-repos, then rebuild V) (#16357) 2022-11-08 17:51:29 +03:00
c7d0f0561e scanner: fix new string interpolation - nested quotes (#16345) 2022-11-08 17:51:02 +03:00
bc30608e92 checker: always trigger error for anon fns without a body block (#16358) 2022-11-08 15:50:59 +02:00
1d04b71c91 cgen: fix generic sumtype auto str (#16355) 2022-11-08 10:49:09 +02:00
dc9997f58c fmt: fix - v fmt transforms compile time options in some cases (#16351) 2022-11-08 08:05:48 +02:00
5f33585edf tools: add support for VSELF_SHOULD_FAIL to v self, in order to make testing all v up failure modes easier. weekly.2022.45 2022-11-07 12:36:30 +02:00
c015f15d8d make.bat: fix use of make.bat from v up (#16348)
* .editorconfig: fix EOL for BAT files

* make.bat: fix use of `make.bat` from `v up`

- use move semantics, instead of replace, for `v` executable updates
- fixes [#16184](https://github.com/vlang/v/issues/16184)

# [why]

`v up` updates the executable by directly calling `make.bat`, awaiting
the result, which keeps an open file handle to it's own executable file.
`make.bat` compiles and, crucially, attempts to directly replace that
`v` executable. But, in WinOS, files with open file handles cannot be
deleted/replaced, so the `make` then fails. The other key point is that,
although WinOS files with open file handles can't be deleted/replaced,
they _can be moved/renamed_.

Thus, the technique that most self-updating WinOS executables use is to
move the current executable to some alternate name (ie, *v_old.exe*) and
then move the newly updated executable to the original location (ie,
*v.exe*). The next invocation of the "original" executable will then run
the updated version.

Note, this technique also works correctly for direct invocations of `make.bat`.
2022-11-07 08:48:08 +02:00
407bb6641f cgen: fix #16326 -cstrict with $embed_file (#16343) 2022-11-06 15:47:06 +02:00
5638005b17 README: fix Termux instructions (add libexecinfo too) 2022-11-06 15:09:29 +02:00
040bcd9141 README: add a section to clarify the installation process on Termux 2022-11-06 15:04:37 +02:00