Commit Graph

236 Commits (870ed86afc4023d46ca2433285de20b4c2e5d088)

Author SHA1 Message Date
Swastik Baranwal 7ec116d588
all: only allow defining `==` and `<` and auto generate `!=`, `>`, `>=` and `<=` (#8520) 2021-02-03 15:18:38 +01:00
Larpon d25825df57
all: support compile time `$env('ENV_VAR')` (#8456) 2021-01-31 19:22:42 +02:00
Lukas Neubert 75d85403a6
fmt: better ternary concat wrapping (#8379) 2021-01-28 11:23:48 +01:00
Delyan Angelov 242d7d0fc0
tools: improve error diagnostic for `v up` and `v self`. Make `v self` more robust. 2021-01-27 23:58:13 +02:00
Nick Treleaven 58a76344cb
checker: avoid SelectorExpr filter on Ident unless it's a generic type name (#8357) 2021-01-27 13:52:52 +01:00
Delyan Angelov e5a84719ca
all: require calling `optfn() ?` / `optfn() or {...}` for `fn optfn() ? {}` 2021-01-26 16:43:17 +02:00
Delyan Angelov 728344ff65
ci: fix `v test-cleancode` 2021-01-25 12:55:01 +02:00
Lukas Neubert 8b61891348
fmt: smarter if condition wrapping (#8201) 2021-01-23 10:33:22 +02:00
Alexander Medvednikov 46cdf4f1ff 0.2.2 2021-01-22 10:39:44 +01:00
zakuro f413c92f2f
v.util: fix bug of mod_path_to_full_name (#8236) 2021-01-21 13:24:32 +02:00
Delyan Angelov 94b5e47ba8
ci: fix compilation of projects cloned inside the main repository 2021-01-20 22:44:18 +02:00
Delyan Angelov 071549baae
v.util: fix an out of bounds panic in mod_path_to_full_name/2 2021-01-20 18:22:58 +02:00
joe-conigliaro 97ebecc5f4
usecache: get all tests running with -usecache enabled by default (p.1) (#7699) 2021-01-20 06:04:59 +01:00
Delyan Angelov 7037965973
parser: cleanup unused `p.os_from_string` 2021-01-19 08:33:03 +02:00
Lukas Neubert ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
Delyan Angelov 17266ecb07
tools: support cmd/tools/.disable_autorecompilation in `v up` and `v self` too 2021-01-18 09:33:33 +02:00
Delyan Angelov 72790cda83
v.util: support cmd/tools/.disable_autorecompilation 2021-01-18 08:43:20 +02:00
zakuro 33694665f0
fmt: align each contiguous field of struct. not the whole. (#7981) 2021-01-12 04:38:43 +01:00
Swastik Baranwal 1f5255c2bb
cgen: implement `>=` and `<=` (#7991) 2021-01-10 12:24:46 +02:00
Delyan Angelov aa37382e8d
tools: let `v fmt` use VTMP too, stabilise `v test-cleancode` 2021-01-09 20:41:15 +02:00
Delyan Angelov 9593ad20f9
v.util: extend launch_tool with auto recompilation of a folder with several .v files too 2021-01-06 23:48:38 +02:00
Alexander Medvednikov 3e04dfc79f builtin: fix byte.str() (part 1) 2021-01-05 18:59:51 +01:00
yuyi 443bf44031
tests: fix ci error in vtest-fixed (fix #7827) (#7830) 2021-01-03 16:38:28 +01:00
Swastik Baranwal 9033099676
cgen: implement overriding of `!=` and `==` (#7837) 2021-01-03 16:19:02 +01:00
yuyi 01e098aa77
vrepl: fix v repl on Windows (#7798) 2021-01-02 12:17:39 +01:00
Swastik Baranwal 24b18f05c4
cgen: implement > and < for structs (#7774) 2021-01-01 14:54:32 +01:00
Ryan Prior 64e7c54884
v.util: accomodate reproducible build environments like guix, by not recompiling cmd/tools when mtime < 1024 (#7702) 2020-12-31 10:31:38 +02:00
Delyan Angelov b4f02adc32
os: add os.execve/3 (extracted from unix_spawn_process); use os.execvp/2 in v.util.launch_tool/3 2020-12-30 18:14:03 +02:00
Alexander Medvednikov e26a690975 0.2.1 2020-12-29 21:24:33 +01:00
Delyan Angelov 8872b0a23b
v.util: fix launch_tool for the vdoc (folder) case 2020-12-27 17:43:44 +02:00
Daniel Däschle 929a002229
vdoc: move to it's own directory cmd/tools/vdoc/ (#7606) 2020-12-27 14:43:23 +02:00
spaceface 214290d55b
fmt: add a space around single-line `unsafe` expressions (#7505) 2020-12-23 19:13:42 +01:00
Alexander Medvednikov e4f94b6ad5 V 0.2 2020-12-22 20:48:45 +01:00
joe-conigliaro d782db8878
util: add clipboard & ui to bundle_modules (fix dupe symbols) 2020-12-20 03:38:11 +11:00
Delyan Angelov 2f1cc2bd08
v.util: simplify the sorting of v's timing output 2020-12-19 12:55:42 +02:00
Delyan Angelov a1c81aa49d
v,gen,checker: implement `-d time_checking -d time_cgening -d time_v` 2020-12-19 12:36:08 +02:00
Delyan Angelov 6f7889a3ca
parser: support for `-d time_parsing` 2020-12-18 17:23:57 +02:00
Delyan Angelov 7e1e247f56
builder: implement b.timing_start/1 and b.timing_measure/1 2020-12-18 13:21:17 +02:00
joe-conigliaro 239a8c8aa3
cgen: cached modules fixes (#7345) 2020-12-15 16:07:06 +01:00
spaceface777 50a3009113
fmt: make single-stmt `or` blocks single-line (#7126) 2020-12-04 13:25:23 +02:00
Alexander Medvednikov ed39d151b7 V 0.1.30 2020-11-28 04:43:11 +01:00
pancake d8f64f516b
js: fix codegen for multiline strings (#6791) 2020-11-18 18:23:44 +01:00
Lukas Neubert dbdcef5166
quote_path: also quote ampersands (#6846) 2020-11-16 19:26:44 +02:00
Delyan Angelov 4b35495fbe all: support VMODULES environment variable (defaulting to ~/.vmodules) 2020-11-08 08:07:17 +02:00
Larpon 785bf40f67
all: remove comp time '@' expansion from scanner (#6746) 2020-11-05 10:12:32 +02:00
Ned Palacios 7b5a580c0c
util: split bom checking to a separate fn (#6694) 2020-10-29 17:21:08 +01:00
Delyan Angelov 23ee3018c3 tools: add `v test-vet` 2020-10-24 16:37:58 +03:00
Delyan Angelov 9322e91d1b v test-fmt: add 1 sec sleep before rebuilding vfmt, to avoid its parallel recompilation afterwards 2020-10-21 15:20:07 +03:00
Delyan Angelov 87f659a0dc ci: fix should_recompile_tool/2 2020-10-21 15:07:57 +03:00
Delyan Angelov 1aa6c125d9 ci: fix `v self` 2020-10-21 13:43:18 +03:00
Delyan Angelov 02db94c4bc v test-fmt: reuse v.util.should_recompile_tool/2, extracted from v.util.launch_tool/3 2020-10-21 12:54:10 +03:00
Enzo b083f4014b
fmt: fix multiple things and format most of the compiler (#6631)
Format expressions inside string interpolation like the rest (it used to be a+b instead of a + b, not too sure why)
Fix formatting some match branches when there were only one statement inside (it was inlined)
Fix parsing and formatting some comments edge case on struct field init. You should check out this test because the result is a bit different from before. I personally find it more logical but I would understand if the former format was to stay
Fix formatting of void-returning function signature
2020-10-15 22:12:59 +02:00
Alexander Medvednikov 7da1afa140 all: switch to the new fn arg syntax everywhere; add lots of vfmt -verify tests 2020-10-15 12:32:28 +02:00
Enzo 93bb7564dc
fmt: fix multiple problems with types (#6603) 2020-10-12 09:27:55 +03:00
Delyan Angelov ac384db71f builder: cleanup .timing_message/2 2020-10-01 18:21:34 +03:00
Delyan Angelov a0e4be04be compiler: print more suggestions, without a good specific match 2020-10-01 17:27:31 +03:00
Henrixounez 46dc6cc24b
repl: fix ctrl+z job to background on linux (#6417) 2020-09-18 16:34:00 +03:00
Alexander Medvednikov ea31f75098 checker: more default field fixes 2020-09-09 14:14:44 +02:00
Uwe Krüger cbcba2e4cf
parser: enable module auto import (of `sync`) (#6271) 2020-08-31 10:44:39 +02:00
Uwe Krüger c351f8fa47
checker, builtin: prepage for builtin channels (#6262) 2020-08-30 08:55:31 +02:00
spaceface777 d663f57d43
parser: move flag logic to checker (#6239) 2020-08-28 09:24:04 +03:00
Alexander Medvednikov a55bea44da table: register rune type 2020-08-25 18:15:24 +02:00
Alexander Medvednikov f965ddae49 parser: handle several errors in types; cgen: objC includes 2020-08-16 19:16:59 +02:00
Nick Treleaven bab5c21224
parser: warn when fixed-size ArrayInit doesn't have trailing `{}`. (#6137) 2020-08-16 04:54:05 +02:00
Delyan Angelov ca7a64a451 cgen: add support for -g again 2020-08-12 02:05:45 +03:00
Alexander Medvednikov ce4ee2b247 v0.1.29 2020-08-06 19:36:52 +02:00
Delyan Angelov 6c27ce58ed v.util.vtest: extract the common code for VTEST_ONLY in a single place 2020-08-05 19:34:27 +03:00
Delyan Angelov 65891f54ed v.util.suggestions: fix hash.crc32.Crc32 case 2020-07-30 19:35:16 +03:00
Delyan Angelov f300f787f3 checker: add suggestions for method mispellings and unknown types 2020-07-30 18:48:16 +03:00
Delyan Angelov 81f8e910e6 compiler: remove space at the end of warn/error messages to minimize diff churn 2020-07-29 20:37:55 +03:00
Delyan Angelov c1e14b451e builder: show timing info in bold; also add a `checker summary:` line with -stats 2020-07-25 10:32:29 +03:00
Delyan Angelov c2083203b3 v.util: fix util.emanager.set_support_color 2020-07-24 08:31:05 +03:00
Alexander Medvednikov 632e27a4a9 all: fix a big mutability bug and update all mutable vars 2020-07-23 23:16:36 +02:00
Nick Treleaven ee349691f9
v/checker: Warn about pointer indexing outside unsafe {} (#5918) 2020-07-22 20:28:53 +03:00
Nick Treleaven a74cbf55c7
checker: warn if C.m* or C.s* functions are called outside unsafe blocks (#5869) 2020-07-20 20:06:41 +03:00
Delyan Angelov de0fc53d62 CI: fix failing tests because of hash.wyhash duplicates 2020-07-18 15:27:57 +03:00
Alexander Medvednikov 38e5569503 all: cached modules fixes 2020-07-18 11:15:44 +02:00
Ryan Willis e804ba5294
vfmt: add support for VDIFF_TOOL, detect more diffing tools (#5857) 2020-07-17 14:03:07 +03:00
Delyan Angelov 26768e8514 vfmt: strip `current_module.` in fn args more robustly 2020-07-11 16:09:20 +03:00
Delyan Angelov 108913c69e checker: handle error token positions with negative pos.len 2020-07-04 21:55:14 +03:00
Delyan Angelov fe50bdc164 vfmt: ran `v vet vlib/v/` and fix spaces 2020-07-04 16:19:54 +03:00
Alexander Medvednikov e9e437ce05 repl: show short version 2020-07-03 22:30:34 +02:00
Delyan Angelov 78e1127d99
cgen: treat the main module like any other v module 2020-07-01 00:53:53 +02:00
Delyan Angelov 13783aea70 vfmt: support for 'VDIFF_OPTIONS=-w' 2020-06-28 12:35:05 +03:00
Uwe Krüger 3b6e66db0d
fmt: further fixes for string interpolation and builtin macros 2020-06-18 18:48:23 +02:00
Alexander Medvednikov 7be952605b 0.1.28 2020-06-18 15:57:53 +02:00
Delyan Angelov cadde3e9f0 vlib: fix os.exec().output usages, that may rely on trimmed lines 2020-06-15 15:38:20 +03:00
Delyan Angelov 05177b9dcb builder: add 'builtin' to builtin_module_parts instead of .clone() 2020-06-11 19:23:13 +03:00
Delyan Angelov 3521c9045b vpm: change hardcoded ~/.vmodules/ (does not work on windows) 2020-06-02 14:36:49 +03:00
Ned Palacios b99ba21ddd
vdoc: markdown, html, json generation + lots of fixes 2020-06-02 12:10:01 +02:00
Mike 'Fuzzy' Partin 411868a43a
util: add gdiff to the list of diff utilities to support bsd systems 2020-05-31 17:01:31 +02:00
Delyan Angelov d148920b54 v.util: prepare CI for the external markdown module (needed for vdoc) 2020-05-30 11:06:16 +03:00
Tim Basel 7e538d7401
utils: add args to launch_tool 2020-05-28 19:40:09 +03:00
Delyan Angelov 481f103dc9 checker: make an error using non `pub` fns from other modules 2020-05-27 12:00:19 +03:00
Ned Palacios b02ec8cbf9
vfmt: fix raw string support 2020-05-27 03:10:47 +02:00
Delyan Angelov 9d4fe88d09 compiler: support for -color/-nocolor option overrides 2020-05-20 20:34:04 +03:00
Alexander Medvednikov 03525843a0 parser: do not allow calling private functions 2020-05-18 22:54:11 +02:00
Alexander Medvednikov 81148fa2bd cmd/v: version: print only main repo hash 2020-05-16 23:52:06 +02:00
Larpon aa30549337
scanner: fill out '@FN' placeholder at compile time while scanning 2020-05-16 14:20:19 +02:00
Delyan Angelov 74005b4362 vfmt: handle file paths with spaces 2020-05-14 09:07:14 +03:00
Delyan Angelov 1bf13f8a09 v version: do more accurate current git hash detection, when not on a branch 2020-05-10 18:56:19 +03:00
eyelash 1722171adc
compiler: color only the relevant part of the source code in error messages 2020-05-10 17:24:29 +02:00
eyelash eabc72d4fe
compiler: print underlines in the same color as the error 2020-05-10 12:27:46 +02:00
yuyi b627bb933c
message: use uniform message reference format 2020-05-06 09:10:40 +03:00
Alexander Medvednikov 67351c74c8 V 0.1.27 2020-05-06 02:26:43 +02:00
Delyan Angelov acd80f052b
tests: improve diagnostic output on failure 2020-05-04 11:21:25 +03:00
eyelash 4d04e88679
errors: show line numbers in default color and add a space 2020-05-01 14:46:12 +02:00
eyelash 6b08cbcb7a
compiler: print warnings in magenta 2020-05-01 13:44:15 +03:00
Delyan Angelov 0e765e34be vfmt: extract v.util.find_working_diff_command, color_compare_files 2020-04-29 11:51:45 +03:00
Delyan Angelov 8a81aa5c93 errors: disambiguate between variable and fn source_context 2020-04-28 16:20:50 +03:00
Delyan Angelov 7924b4d77c compiler: handle a panic when an error is produced, but source == '' 2020-04-28 16:15:56 +03:00
Enzo Baldisserri 682838a0cf
checker: check array and fields mutability 2020-04-27 22:53:26 +02:00
Delyan Angelov e67bf674e3 scanner: cleanup, only v.parser now depends on v.scanner 2020-04-27 16:08:04 +03:00
Alexander Medvednikov 3ab8dc0092 parser: array init: `[]string` => `[]string{}` 2020-04-26 09:17:17 +02:00
Alexander Medvednikov a48080afec parser: deprecate import(); replace remaining import()s 2020-04-26 07:36:02 +02:00
Delyan Angelov 8a1248b2e7 builder: restore module import cycle detection/topological reorder 2020-04-16 12:29:36 +03:00
Daniel Däschle 12e48c6fe2
checker: check match for exhaustion 2020-04-14 01:03:31 +02:00
Delyan Angelov 95709811e0 v: support VFLAGS, fix 'v run source.v arg after source' 2020-04-11 10:28:43 +03:00
Delyan Angelov 3573030b9b checker: fix error position for assignment expression 2020-04-10 15:14:05 +03:00
yuyi 7f87ac996d
test: fix vlib/math/big/big_test.v 2020-04-10 12:26:15 +03:00
Daniel Däschle 0f11d883fa
checker: fix error messages and add checker tests
* checker: fix error messages
* tests: fix command and ignore defect output
2020-04-10 11:59:07 +03:00
Daniel Däschle 32550c6d69
scanner: even better error messages 2020-04-10 00:09:34 +02:00
Alexander Medvednikov a08e64f37f cgen: operator overloading 2020-04-08 22:12:42 +02:00
Daniel Däschle 7cf9b32742
cmd: show cleaner messages, when v can not compile a tool, or update itself 2020-04-07 17:56:33 +03:00
Delyan Angelov 8da12eb8a7 errors: column index tweaks for emacs/vim 2020-04-06 23:15:53 +03:00
Delyan Angelov 333e725380 errors: remove 0 from caret line 2020-04-06 20:41:33 +03:00
Delyan Angelov bc2ea2f3d4 errors: fix caret position on lines with tabs 2020-04-06 20:35:24 +03:00
Delyan Angelov d74eb99066 errors: do not bold the actual error message content 2020-04-06 19:46:23 +03:00
Delyan Angelov 7a99949f0e errors: print more informative and pretty errors 2020-04-06 19:40:20 +03:00
Delyan Angelov f139e98745 launch_tool: use println for verbose messages instead of eprintln 2020-04-05 15:31:09 +03:00
Delyan Angelov 44a271d9e9 v version: show only vhash, when vhash and current_hash are the same 2020-04-05 14:47:01 +03:00
Alexander Medvednikov 46aed151ab parser: snake_case check; array: mutable array test 2020-04-04 14:09:58 +02:00
Delyan Angelov 133842bf95 Remove unused self import of v.util into v.util . 2020-04-04 14:49:08 +03:00
Delyan Angelov 31c4b1cda6 v2: compile vfmt again; consistent colored error messages 2020-04-03 18:42:22 +03:00
Delyan Angelov 4ada412a05
v2: stage 2 for enhancing 'v version' with the current git commit hash 2020-04-02 15:51:48 +02:00
Delyan Angelov 084f853a2a
v2: enhance version with current git commit hash. Cleanup redundant code. 2020-04-02 13:31:02 +02:00