Commit Graph

746 Commits (870ed86afc4023d46ca2433285de20b4c2e5d088)

Author SHA1 Message Date
Lukas Neubert 043c29cf95
fmt: fix string interpolation with CastExpr (#9137) 2021-03-06 20:47:19 +02:00
zakuro b83530e0ed
fmt: extract part of fmt.v into struct.v (#9141) 2021-03-06 20:40:44 +02:00
Lukas Neubert 7f7f9dca6b
parser,fmt: fix regression with non-void arrays in if conditions (#9161) 2021-03-06 20:39:38 +02:00
Delyan Angelov 849cde245c
v: support dump(expr) (#9160) 2021-03-06 18:09:28 +01:00
Lukas Neubert ead2ba6004
fmt: proper single line check for ConcatExpr (#9121) 2021-03-05 15:36:49 +03:00
zakuro 9ba312066e
fmt: extract type decls code into functions to cleanup (#9126) 2021-03-05 15:34:51 +03:00
Lukas Neubert 80356edd8c
fmt: combine simple attributes into a single line (#9120) 2021-03-05 07:17:57 +02:00
Delyan Angelov 6da66226e5
vfmt: keep `mut:` in interface declarations (#9053) 2021-03-04 15:30:30 +02:00
Delyan Angelov eb1e1afbc1
ci: fix failing fn_trailing_arg_syntax_keep.vv 2021-03-04 13:05:14 +02:00
zakuro 6b2c7fd53e
fmt: remove tail space when using multiline short arg (#9110) 2021-03-04 12:44:50 +02:00
Lukas Neubert 8ce53b8b55
fmt: prevent code corruption with struct update syntax as trailing function arg (#9091) 2021-03-04 12:44:17 +02:00
Lukas Neubert 28fc91acb7
fmt: minor cleanups (#9090) 2021-03-04 12:43:11 +02:00
zakuro 5b041db442
fmt: don't prepend mod when cast with selective imported types (#9109) 2021-03-04 12:33:52 +02:00
Lukas Neubert 0f8f8bd90d
fmt: force empty lines after struct declarations and most functions (#9096) 2021-03-03 23:56:40 +01:00
Lukas Neubert 460e06b9ff
fmt: do not insert a newline before returned $vweb.html() (#9063) 2021-03-03 10:14:05 +02:00
Lukas Neubert 8a0b5bad94
fmt: keep empty lines in const blocks (#9071) 2021-03-03 09:23:11 +02:00
spaceface b712af56fd
all: bring back `panic(err.msg)` -> `panic(err)` (#9022) 2021-03-01 00:18:14 +01:00
spaceface d63b7bc35a
all: update repo to use the new error handling syntax (#8950) 2021-02-28 23:20:21 +03:00
Delyan Angelov e354dcefc2
fmt: fix support for `mut static x := 42` 2021-02-28 19:40:21 +02:00
Delyan Angelov 4125bfe401
all: fix references to time.wait -> time.sleep 2021-02-28 18:01:31 +02:00
Lukas Neubert 5aebd646bb
fmt: keep some line comments in multi line arrays (#8969) 2021-02-26 09:01:03 +02:00
Lukas Neubert 2c609411dd
fmt: do not write single line or blocks with multi line stmts (#8952) 2021-02-26 08:41:24 +02:00
Lukas Neubert e4beea4268
fmt: restructure comment line break logic inside arrays (#8963) 2021-02-25 11:10:54 +01:00
Lukas Neubert 7e27920cf7
fmt: fix inserted empty line before go stmt with anonymus function (#8951) 2021-02-25 01:30:04 +01:00
Lukas Neubert 8e69d3629f
parser,fmt: refactor array comment handling to fully rely on the ecmnts field (#8929) 2021-02-24 19:33:59 +01:00
Lukas Neubert b18d091e18
fmt: fix pos of added imports (#8931) 2021-02-24 19:33:17 +01:00
Lukas Neubert e53476d5e1
fmt: do not remove chan type of struct fields (#8948) 2021-02-24 20:26:12 +02:00
Lukas Neubert 51125541c7
parser: fix weird minus after comment parse error in arrays (#8912) 2021-02-23 09:51:00 +02:00
Lukas Neubert 18aecde9e5
fmt: cleanup comments code (#8901) 2021-02-22 18:43:54 +02:00
Lukas Neubert 7f6c4caa01
fmt: fix missing space after single line array pre comments (#8904) 2021-02-22 17:53:55 +02:00
zakuro f54c1a5cc2
all: add strings.Builder.write_string and use write_string instead of write (#8892) 2021-02-22 13:18:11 +02:00
Lukas Neubert 9dc770e29c
fmt: do not struggle with comments inside maps (#8897) 2021-02-22 13:04:48 +02:00
Delyan Angelov c37daba41d
ci: fix the remaining obsolete reference to time.sleep and time.usleep 2021-02-22 09:12:23 +02:00
Lukas Neubert f18adf7759
parser,fmt: handle array pre-comments separately from exprs (#8884) 2021-02-21 20:18:19 +02:00
Lukas Neubert a86bf3254a
fmt: keep empty line between if statement and comment (#8846) 2021-02-20 16:05:05 +02:00
Lukas Neubert 329e3938d9
fmt: respect user choice of newlines between functions without body (#8838) 2021-02-20 16:00:30 +02:00
zakuro f381836f9e
fmt: sort names in selective imports (#8827) 2021-02-20 12:22:09 +01:00
Lukas Neubert 859d382c6e
fmt: remove a few obsolete comments (#8837) 2021-02-20 09:54:55 +01:00
zakuro 0d69d97143
fmt: mark imports as used, when types from them are used in struct declarations (#8810) 2021-02-18 11:32:45 +02:00
zakuro 600f6ad2a0
fmt: do not prepend mod to selectively imported types from nested module (#8805) 2021-02-17 20:42:26 +01:00
Delyan Angelov aa3d0ea345
vfmt: cleanup spurious printlns, remove obsolete code 2021-02-17 14:59:42 +02:00
zakuro 3341c17202
fmt: keep one empty line in struct decl (#8782) 2021-02-17 05:45:09 +01:00
Lukas Neubert 55b69a76a6
fmt: minor cleanup of or_expr (#8789) 2021-02-17 05:43:29 +01:00
zakuro 51c286df5a
fmt: fix bug that vfmt removes emmbeded struct in struct decl (#8775) 2021-02-16 12:45:56 +01:00
zakuro 6813866141
fmt: fix bug of disappearing `pub` in struct decl (#8777) 2021-02-16 12:39:50 +01:00
Delyan Angelov 0bbc5a5c6a
fmt: add a small comment about f.line_len 2021-02-16 10:22:39 +02:00
Lukas Neubert ad20b3806f
fmt: fix possible code corruption by unwrapped single line if (#8780) 2021-02-16 10:13:48 +02:00
zakuro d3bcd5d305
fmt: keep single line if in struct init (#8734) 2021-02-14 19:22:24 +01:00
Uwe Krüger 374739b804
all: rename `[ref_only]` -> `[heap]` (#8718) 2021-02-13 16:52:01 +02:00
glebbash aa548f45ea
docs: fix functions in array/map example (#8695) 2021-02-12 21:10:54 +02:00
Lukas Neubert 8cb01ba8db
fmt: keep comments between and after imports (#8637) 2021-02-08 19:48:48 +02:00
Nick Treleaven e2ff2a5405
parser: deprecate `{var |` struct update (#8618) 2021-02-08 17:03:05 +02:00
Nick Treleaven 9e751f72c4
doc, fmt: use `map{key: value}` syntax for map literals (#8623) 2021-02-08 16:57:42 +02:00
Lukas Neubert 473cd1d416
fmt: single line ternary return (#8605) 2021-02-08 00:28:46 +01:00
Lukas Neubert 7f4c582f1a
fmt: unwrap long infix exprs inside parenthesis if necessary (#8609) 2021-02-07 23:10:39 +01:00
zakuro 9f59b04e86
fmt: remove unused selective imports (#8595) 2021-02-07 03:58:43 +01:00
Lukas Neubert db0fc8fbc9
fmt: better function call wrapping inside ternary if branches (#8604)
* fmt: better funcation call wrap in singel line ifs

* tests

* format files
2021-02-06 21:46:52 +01:00
Uwe Krüger cf230644b6
fmt: enable shared return types (#8614) 2021-02-06 21:25:06 +01:00
Lukas Neubert 9ab1d17cbc
fmt: keep __global in struct declarations (#8584) 2021-02-05 16:46:43 +01:00
Uwe Krüger 9dcf673216
all: make `lock` and `rlock` dead lock free :-) (#8534) 2021-02-03 15:16:52 +01:00
Lukas Neubert 5aaeac79fa
ci: fix compilation (#8511) 2021-02-02 12:06:54 +02:00
Alexander Medvednikov 2c4674eb42 cgen: obfuscate functions 2021-02-02 09:14:41 +01:00
Lukas Neubert cf1084105c
fmt: allow single line ternary if as function argument (#8486) 2021-02-01 20:08:42 +01:00
Lukas Neubert d660f2cc6f
fmt: insert newline after last HashStmt (#8482) 2021-02-01 14:50:41 +01:00
Lukas Neubert 8755f40430
fmt: keep comments after imports (#8483) 2021-02-01 14:45:08 +01:00
Lukas Neubert 43676330ba
fmt: keep braces around @ escaped fields in string interpolation (#8488) 2021-02-01 11:04:57 +02:00
Larpon d25825df57
all: support compile time `$env('ENV_VAR')` (#8456) 2021-01-31 19:22:42 +02:00
Delyan Angelov 5746ac4dd4
vfmt: remove tracing println for match branches 2021-01-31 11:05:49 +02:00
div72 8c70920695
all: add offsetof (#8380) 2021-01-30 12:57:09 +01:00
Nick Treleaven c0685eeefc
parser: add warning for s.$field.name without brackets (#8411) 2021-01-30 12:56:10 +01:00
Lukas Neubert a044441224
fmt: keep {} in string interpolation for chained CallExprs (#8422) 2021-01-30 11:58:19 +01:00
Lukas Neubert 2774db077d
fmt: keep user choice for newlines in match branches (#8418) 2021-01-30 11:57:57 +01:00
zakuro 391d62bca5
fmt: remove duplicated imports (#8433) 2021-01-30 11:04:36 +02:00
Lukas Neubert 974cac2037
fmt: relocate two methods; minor cleanup (#8423) 2021-01-29 23:15:26 +02:00
Lukas Neubert 93acc929f7
fmt: keep lines of comments inside an array (#8420) 2021-01-29 20:19:14 +02:00
zakuro f5242890b8
fmt: keep multiline selective import (#8412) 2021-01-29 14:48:28 +01:00
Lukas Neubert e47c13903b
fmt: keep newlines between toplevel stmts (#8383) 2021-01-29 12:17:59 +02:00
Alexander Medvednikov 608a4ccccd fmt: fix a bug with an empty module in consts 2021-01-29 00:26:57 +01:00
Lukas Neubert 75d85403a6
fmt: better ternary concat wrapping (#8379) 2021-01-28 11:23:48 +01:00
Delyan Angelov e5a84719ca
all: require calling `optfn() ?` / `optfn() or {...}` for `fn optfn() ? {}` 2021-01-26 16:43:17 +02:00
Lukas Neubert 2007dbc7b5
fmt: put the opening brace on a new line again for infix (#8336) 2021-01-26 11:19:32 +01:00
Lukas Neubert 3790bd67e3
fmt: minor cleanup of sql_expr (#8340) 2021-01-26 10:36:46 +01:00
zakuro 22847d1ec3
fmt: assert (a == b) -> assert a == b (#8351) 2021-01-26 10:36:21 +01:00
Lukas Neubert c6f98afaba
fmt: minor cleanup of return_stmt (#8341) 2021-01-25 23:22:14 +01:00
Delyan Angelov dbaccd4272
vfmt: shorten `main.const_name` to just `const_name` 2021-01-25 20:57:33 +02:00
Lukas Neubert b2f2f387dc
fmt: cleanup and expand tests for ternary if (#8333) 2021-01-25 14:22:08 +01:00
Delyan Angelov 728344ff65
ci: fix `v test-cleancode` 2021-01-25 12:55:01 +02:00
Lukas Neubert 997f56a3dc
fmt: better newline handling in block comments (#8325) 2021-01-24 22:08:24 +01:00
Alexander Medvednikov 29d6e40f29 all: vfmt (new const rule) 2021-01-24 10:54:27 +01:00
Alexander Medvednikov 2238bf9a83 fmt: use new const rule in tests 2021-01-24 10:12:49 +01:00
Alexander Medvednikov 8bcb6c10cc checker: remove duplicate const error; fmt: force full path to consts 2021-01-24 10:01:13 +01:00
Lukas Neubert 522eac200f
fmt: keep `arr << if x {} else {}` on a single line (#8289) 2021-01-24 08:02:35 +01:00
Lukas Neubert 8b61891348
fmt: smarter if condition wrapping (#8201) 2021-01-23 10:33:22 +02:00
spaceface c2d501e8a9
all: implement interface fields (#8259) 2021-01-23 08:57:17 +02:00
Louis Schmieder e06e8b10cd
orm: fix empty struct and simplify (#8246) 2021-01-22 23:28:26 +01:00
Daniel Däschle 500ebf77e4
all: implement multiple generics (#8231) 2021-01-22 13:49:56 +01:00
Enzo 55efd8309a
parser: fix parsing interface methods with varargs (#8229) 2021-01-20 23:15:02 +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
Tim Basel 129eee346b
fmt: keep single empty lines (#8189) 2021-01-19 14:49:40 +01:00
Lukas Neubert ca70d815b6
fmt: move StructDecl comments handling into functions (#8191) 2021-01-19 10:43:48 +01:00
Delyan Angelov 24d1ec2714
vfmt: support `a[i] or { panic(err) }` too 2021-01-19 08:42:56 +02:00
Lukas Neubert b44c08aff0
fmt: wrap match branch expressions (#8190) 2021-01-19 06:16:42 +01:00
Lukas Neubert ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
Lukas Neubert 16c9cbce7c
fmt: correctly increase f.line_len for write_indent (#8174) 2021-01-18 06:02:29 +01:00
Nick Treleaven df39e7001c
parser: support `module:` for immutable private struct fields (#8140) 2021-01-17 05:39:44 +01:00
Lukas Neubert 3e44816e44
fmt: minor code cleanup (#8147) 2021-01-17 05:32:10 +01:00
Lukas Neubert 371730f8a8
fmt: correct indent for StructDecl multi line default exprs (#8148) 2021-01-17 05:01:55 +01:00
Daniel Däschle 53941c4a0a
fmt: fix if cond break readability (#8132) 2021-01-16 02:12:17 +01:00
Uwe Krüger 2f7a66386e
docs: document `go` with handle and `wait()` (#8142) 2021-01-15 23:40:26 +02:00
Uwe Krüger 8d014d4646
sync: allow `go` routine join with return value (#8125) 2021-01-15 13:45:26 +01:00
Lukas Neubert 57dd511c9d
fmt: move all exprs and stmts to their own methods (#8107) 2021-01-15 10:26:33 +01:00
Lukas Neubert 20c80db426
fmt: move comments related methods to extra file (#8028) 2021-01-15 07:51:07 +01:00
Larpon f73500f2fe
all: add support for the `x := $embed_file('v.png')` compile time call (#8048) 2021-01-14 16:20:11 +02:00
Lukas Neubert 8a8978fb01
fmt: keep same line comments after arr.sort() in vsh files (#8026) 2021-01-13 20:10:17 +02:00
Lukas Neubert 219486f0a5
fmt: cleanup `'` and `"` quotes handling (#8082) 2021-01-13 11:09:03 +02:00
yuyi 7458b699d0
fmt: change `[1,2,3]!!` to `[1,2,3]!` (#8081) 2021-01-13 08:32:17 +01:00
Nick Treleaven ac85257ea0
parser: fix sizeof(mod.Type), fix checking sizeof expression (#8065) 2021-01-13 06:13:39 +01:00
zakuro 254df0ca62
fmt: improve string quotes (#8075) 2021-01-13 06:05:27 +01:00
Lukas Neubert 0e490766df
fmt: do not move single line block comments to previous line (#8046) 2021-01-13 03:30:24 +01:00
zakuro 33694665f0
fmt: align each contiguous field of struct. not the whole. (#7981) 2021-01-12 04:38:43 +01:00
Uwe Krüger 5f95dd54bd
builtin: rename `any_*` -> `*_literal` - 2. part (#8032) 2021-01-11 22:58:15 +01:00
Lukas Neubert 5d6e9f7bf9
fmt: fix rare extra tab after a SumType (#8035) 2021-01-11 22:19:42 +01:00
zakuro c1b1ec9005
fmt: keep same line comment in array init (#7980) 2021-01-10 21:06:48 +01:00
zakuro 2103d9a6c4
fmt: keep new line at both ends of block comment (#8003) 2021-01-10 21:06:29 +01:00
Lukas Neubert a8378273a5
fmt: fix too many \n if file has only imports (#8012) 2021-01-10 21:19:31 +02:00
Lukas Neubert d96a1b8a5f
fmt: intelligent newlines for trailing arg syntax (#7748) 2021-01-10 17:39:37 +01:00
Daniel Däschle a8dd13f086
parser: change array decompose syntax (#7965) 2021-01-09 22:48:23 +01:00
Lukas Neubert e79695e8fc
fmt: keep comments after call_expr in vscript (#7990) 2021-01-09 22:47:33 +01:00
Uwe Krüger 29c2240aef
fmt: enable `or` block for `ch <- x` (#7969) 2021-01-08 21:39:21 +01:00
Uwe Krüger cbe7740d97
fmt: do not generate `import` statements for auto imports (#7966) 2021-01-08 17:42:40 +01:00
Delyan Angelov 46a5c487c1
parser,fmt: implement `[manualfree] module abc` for opting out *all* fns in a given .v from autofree 2021-01-08 17:24:42 +02:00
Lukas Neubert 653121bad9
fmt: test bin2v output formatting (#7926) 2021-01-07 21:36:59 +01:00
Nick Treleaven cbefe6c32f
parser: warn about old use of `typeof` (#7923) 2021-01-07 20:32:02 +01:00
Lukas Neubert eaba21d81a
fmt: keep the shebang header in vsh files (#7893) 2021-01-05 16:14:16 +02:00
Daniel Däschle 5841d5d8e1
all: implement basic comptime field selector (#7888) 2021-01-05 16:11:43 +02:00
zakuro a7a8e659f6
fmt: keep generic type in method call (#7874) 2021-01-05 01:29:58 +01:00
Daniel Däschle 7c9fb73b3f
vfmt: fix comments before ...f in Abc{...f} (#7870) 2021-01-04 21:01:35 +02:00
Daniel Däschle 164d7bf5fb
parser: struct updating syntax with `Abc{...oldabc newfield: val}` (#7865) 2021-01-04 20:19:03 +02:00
Nick Treleaven b9c6011602
parser: support casting to a pointer to array (#7861) 2021-01-04 18:22:04 +02:00
zakuro dd516858d4
fmt: align struct field comments (#7632) 2021-01-03 21:10:25 +01:00
Enzo 22e54e6703
fmt: fix formatting array decomposition (#7835) 2021-01-03 16:19:43 +01:00
zakuro 91a1a2877b
fmt: add a test for struct embed (#7831) 2021-01-03 15:41:19 +01:00
zakuro b3de003302
fmt: fix broken formatting in fn struct fields (#7794) 2021-01-02 16:36:31 +01:00
Alexander Medvednikov 9976641be0 fmt: fix a space in const decl 2020-12-30 02:24:38 +01:00
Alexander Medvednikov ad78875a8c parser: allow `const x = 0` consts outside of const blocks 2020-12-30 02:15:44 +01:00
joe-conigliaro 02965e753e
all: re-implement variadics using arrays & implement array decomposition to varg (#7689) 2020-12-29 16:14:08 +01:00
Lukas Neubert cf441091f1
fmt: AnonFn with body is not single line (#7659) 2020-12-28 20:27:27 +02:00
Lukas Neubert 2360762a42
fmt: fix unexpected `comment`, expecting struct key for trailing arg syntax (#7658) 2020-12-28 20:26:24 +02:00
Lukas Neubert 4783503185
fmt: keep interface comments between methods (#7650) 2020-12-28 18:14:55 +02:00
Lukas Neubert 97bfabf194
fmt: heavily refactor and improve/fix logic for structs that use short args syntax (#7653) 2020-12-28 18:14:08 +02:00
Lukas Neubert ef6011b94c
fmt: keep comments after struct decl default value (#7648) 2020-12-28 15:38:21 +02:00
Lukas Neubert 06fdf34214
fmt: unwrap long single line ifs (#7608) 2020-12-27 14:20:30 +01:00
Lukas Neubert c9081a8df8
fmt: improve conditions for single line if 2020-12-27 12:59:28 +01:00
Lukas Neubert 9a5bbc3101
fmt: use single quotes around fixed string arr default expr (#7581) 2020-12-26 15:12:25 +02:00
Lukas Neubert 693e5137eb
fmt: cleanup copy pasta for array_init (#7579) 2020-12-26 14:22:50 +02:00
Lukas Neubert f707e13b3f
fmt: keep order by in orm blocks (#7576) 2020-12-26 14:18:09 +02:00
Lukas Neubert e7ca5dd17a
fmt: update expr_is_single_line for MatchExpr, StructInit and CallExpr with or block (#7564) 2020-12-25 21:43:50 +02:00
Lukas Neubert 2c0fba5480
fmt: keep comment between enum fields (#7566) 2020-12-25 21:41:59 +02:00
Lukas Neubert 8cd74df2f3
vfmt: keep UnsafeExpr linebreacks as set by developer (#7558) 2020-12-25 16:52:16 +02:00
Lukas Neubert 691e6f9d3f
fmt: keep any langauge prefix variations in struct fields (#7534) 2020-12-24 13:36:54 +02:00
zakuro fec9f1324c
fmt: trim space in embedded comments (#7521) 2020-12-24 11:57:48 +01:00
spaceface 214290d55b
fmt: add a space around single-line `unsafe` expressions (#7505) 2020-12-23 19:13:42 +01:00
Daniel Däschle b27f5c378c
all: reimplement struct embedding with methods (#7506) 2020-12-23 19:12:49 +01:00
zakuro a6e6c48c36
fmt: keep _ separator in number literals (#7495) 2020-12-23 14:48:43 +02:00
Lukas Neubert a2cd1b163c
fmt: keep empty curlies and parenthesis as they are (#7329) 2020-12-22 23:43:48 +01:00
Lukas Neubert c4aae2b55f
vfmt: do not replace module aliases in fn param and return types (#7472) 2020-12-22 22:38:13 +02:00
Delyan Angelov 97855eca93 ci: fix the failing build-module-docs job 2020-12-22 17:25:57 +02:00
zakuro fb0c4556fd
vfmt: keep JS object name (#7462) 2020-12-22 15:32:49 +02:00
Lukas Neubert 304aafdc50
fmt: add a space after + operator/method overload (#7453) 2020-12-21 21:20:00 +02:00
Delyan Angelov 04757a4853
vfmt: fix `struct Abc { field fn() ? }` 2020-12-18 11:32:04 +02:00
Lukas Neubert c922565525
fmt: only insert a space after // if the 3rd char is alphanumeric (#7330) 2020-12-15 04:26:28 +01:00
Lukas Neubert 9b139c58ca
fmt: keep module alias in struct decl field types (#7305) 2020-12-14 05:03:43 +01:00
Lukas Neubert d59c5b01e1
fmt: intelligent line wrap for trailing struct syntax (#7309) 2020-12-14 05:03:17 +01:00
Lukas Neubert 25153490e1
fmt: keep comments after assign on same line (#7269) 2020-12-11 19:20:24 +02:00
joe-conigliaro d7ff342ab3
fmt: fix formatting in anon_fn_as_param_keep.vv 2020-12-11 21:13:18 +11:00
joe-conigliaro 1626aa5500
fmt: make test clearer 2020-12-11 21:09:36 +11:00
joe-conigliaro d1224ffb5a
parser: error on non local array/map methods & add tests 2020-12-11 20:50:26 +11:00
Lukas Neubert 0e7192c9b7
fmt: keep comments in struct init without fields (#7212) 2020-12-09 16:35:03 +02:00
Delyan Angelov 338f3afd31
vfmt: fix `type MyFn = fn (int) int mut arr := []MyFn{}` 2020-12-09 15:18:45 +02:00
Lukas Neubert 3b6b5b8090
vfmt: properly parse comments on lines after init fields (#7202) 2020-12-09 11:11:22 +02:00
joe-conigliaro 78a6795319
all: change the way import symbols work & support consts (#7182) 2020-12-07 19:13:03 +02:00
Roland Lammel 028c82e255
fmt: improve map value alignment (#7105) (#7151) 2020-12-06 02:04:45 +01:00
spaceface777 50a3009113
fmt: make single-stmt `or` blocks single-line (#7126) 2020-12-04 13:25:23 +02:00
Lukas Neubert 02ba923ba7
fmt: do not add braces for trailing struct arg (#7072) 2020-12-04 11:22:26 +02:00
Lukas Neubert dedb8f7e41
fmt: smarter wrap of orm lines (#7070) 2020-12-02 04:06:20 +01:00
Lukas Neubert 8adc8ed103
parser: do not fail on comment direct after import (#7071) 2020-12-01 22:32:34 +02:00
Alexander Medvednikov 3612bd58ef fmt: revert the fn \n change 2020-12-01 17:00:06 +01:00
Alexander Medvednikov 0ddf0a4b92 gg: custom bold font path 2020-12-01 16:30:25 +01:00
Lukas Neubert a98162118b
fmt: orm delete (#7035) 2020-11-30 14:02:36 +01:00
joe-conigliaro ff63fb74d9
dont allow method on non-local types & no mod for arrays. closes #6971 2020-11-30 11:43:22 +11:00
Swastik Baranwal 3afa606154
vfmt: fix eating `c` in `c'foo'` (#7009)
* fmt: add formatting for cstrs

* fmt
2020-11-29 10:39:50 +02:00
Daniel Däschle 32c027a0bf
parser: disallow ptr type as sum type variant (#6996) 2020-11-28 23:40:40 +02:00
Delyan Angelov cbe607baf2 vfmt: fix compilation warning 2020-11-27 10:40:56 +02:00
Daniel Däschle 966b95ca4e
parser: move mut in if/match to expr (#6973) 2020-11-27 03:08:42 +01:00
Alexander Medvednikov 5e59718970 fmt: handle $tmpl 2020-11-26 18:53:38 +01:00
Daniel Däschle 7d6f97259f
all: refactor UnionSumType to SumType (#6944) 2020-11-25 13:09:40 +02:00
Daniel Däschle a042966082
all: remove old sumtype code (#6937) 2020-11-24 17:55:24 +01:00
Daniel Däschle aa6303f0b2
all: use the new types with old syntax (#6922) 2020-11-24 13:58:29 +01:00
Lukas Neubert 8be9bdacd1
fmt: do not wrap real multiline comments into single line in arrays (#6923) 2020-11-24 12:55:39 +01:00
Takahiro Yaota 2f9b7fe0f7
vfmt: fix error with `return // comment` (#6914) 2020-11-23 11:36:20 +02:00
Daniel Däschle 838ad16296
all: refactor ast.Expr to use the new sum type implementation (#6792) 2020-11-21 00:05:57 +01:00
Lukas Neubert 5d76e85a23
vfmt: fix extra whitspace in fn type decl with type-only args (#6888) 2020-11-20 15:00:40 +01:00
Nick Treleaven 9871d24929
fmt: fix labelled break & continue (#6889) 2020-11-20 14:12:40 +01:00
Lukas Neubert ef3e8d2c84
vfmt: handle comments after type declarations (#6874) 2020-11-20 11:51:50 +02:00
Daniel Däschle 9feb010355
all: mutable smartcasts (#6878) 2020-11-19 17:28:46 +01:00
Delyan Angelov 69bb0891c7 vfmt: fix ^A keep.vv test too 2020-11-19 16:25:52 +02:00
Delyan Angelov 92a75c80db vfmt: trim ^A from embedded inline comments too 2020-11-19 15:32:51 +02:00
Lukas Neubert ee5ad2a653
parser: fix duplicated struct attrs on first field (#6859) 2020-11-17 21:25:54 +01:00
Delyan Angelov 2dc9a45e06 vfmt: fix eating of `app.$method(vars)`; format vlib/vweb/vweb.v 2020-11-14 13:55:10 +02:00
Delyan Angelov ba8cdb2977 vfmt: fix `$for method in App.methods {}` turning to App(methods) 2020-11-14 12:24:46 +02:00
Delyan Angelov f42a44abec vfmt: fix `match x { 10 /* ... */ {} }` and `a := [1/* x */, /* y */2, 3]` 2020-11-11 22:59:43 +02:00
Delyan Angelov e6cc967ac8 vfmt: small cleanup 2020-11-11 21:43:47 +02:00
Delyan Angelov 8197463b08 vfmt: fix `x := Repo<User,Permission>{}` 2020-11-11 21:41:04 +02:00
Delyan Angelov ebfd259333 vfmt: support `struct Repo <T, U> { }` 2020-11-11 17:50:03 +02:00
Daniel Däschle 6271798ce3
cgen: union sum types implementation (#6745) 2020-11-11 09:18:15 +01:00
Delyan Angelov d34c5b767b vfmt: keep the source fn type alias names, instead of the expanded fn declarations 2020-11-05 20:21:37 +02:00
Delyan Angelov 3f9b05a876 vfmt: skip {} for pure fn declarations (let the bodies hit the floor) 2020-11-05 18:59:36 +02:00
Delyan Angelov e80487b35c vfmt: support inline comments before fields in struct initializations 2020-11-05 18:49:52 +02:00
Delyan Angelov 4bf1c2fdcc vfmt: support `match a { x...y {} }` 2020-11-05 18:35:14 +02:00
Delyan Angelov 35096cda3f vfmt: support comments after interface methods 2020-11-05 18:23:45 +02:00
Larpon 785bf40f67
all: remove comp time '@' expansion from scanner (#6746) 2020-11-05 10:12:32 +02:00
Delyan Angelov 9eb655e65c all: add .pos fields to all AST nodes, to avoid wrong positions in error messages 2020-11-04 13:34:12 +02:00
Delyan Angelov ae241785bf vfmt: fix `union {}` declarations 2020-11-03 00:35:12 +02:00
Alexander Medvednikov 791fda16d3 fmt: handle "it" in lambdas 2020-10-30 07:35:44 +01:00
Alexander Medvednikov 2c75b1397c all: struct embedding 2020-10-30 07:09:26 +01:00
Delyan Angelov ab137e4164
cgen: print results of failed callexprs in `assert fn() == fn2()` (#6665) 2020-10-21 21:58:40 +02:00
Delyan Angelov dd96ba0d24 vfmt: fix `type TwoSameArgs = fn (i int, j int) string` formatting 2020-10-18 08:54:29 +03:00
Delyan Angelov 5c4ba3474b vfmt: fix `init_fn gg.FNCb = voidptr(0)` when vfmt-ing gg.v 2020-10-18 08:42:08 +03:00
Delyan Angelov 140166e1cd interpolation: support '' (rounding like in C) 2020-10-16 17:28:11 +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
Delyan Angelov 5d4cce3e95 ci: fix failing tests 2020-10-15 15:42:16 +03:00
Alexander Medvednikov 8b13f3b53f fmt: fix tests 2020-10-15 12:45:34 +02:00
Delyan Angelov c33a748344 vfmt: handle more comments in interface/struct init/match branches 2020-10-14 22:52:33 +03:00
Alexander Medvednikov ea09bd5e45 checker/fmt: `for mut val` fixes 2020-10-14 12:50:19 +02:00
Delyan Angelov d316f78f94 vfmt: remove the buggy f.type_to_str, use f.table.type_to_str from now on 2020-10-13 16:17:02 +03:00
Delyan Angelov 1123f4fcc9 vfmt: fix deep nested map types, using f.table.type_to_str 2020-10-13 16:08:25 +03:00
Enzo da7d531f8f
fmt: refactor `type_to_str` (#6607) 2020-10-12 18:41:42 +03:00
Enzo 93bb7564dc
fmt: fix multiple problems with types (#6603) 2020-10-12 09:27:55 +03:00
Delyan Angelov e862fad917 parser: support `mut static x := y` in -translated mode 2020-10-09 22:24:21 +03:00
Enzo fd88bfbac8
fmt: fix formatting of anon args (#6545) 2020-10-04 06:32:47 +02:00
Enzo c84848c417
fmt: fix formatting enum with attributes (#6551) 2020-10-03 21:33:02 +03:00
Enzo 677b0ba2d2
gen: access fields in multi-type sumtype match (#6541) 2020-10-03 11:19:43 +02:00
Henrixounez c9574ae7d7
syntax: new global variable declaration syntax (#6540) 2020-10-03 07:03:44 +02:00
Delyan Angelov dc954bbb03 all: use `macos` consistently in os.user_os and the compiler 2020-09-29 22:32:20 +03:00
Delyan Angelov f9ce7f3542 vfmt: fix formatting for [4][4]int static arrays 2020-09-27 22:46:33 +03:00
Delyan Angelov cbd7c7d8c6 tests: support VTEST_ONLY in vlib/v/fmt/fmt_keep_test.v too 2020-09-27 22:01:46 +03:00
Alexander Medvednikov c5dc792c5d fmt: args => params 2020-09-27 03:46:15 +02:00
Daniel Däschle abc98c273c
parser: require assign on type alias (#6477) 2020-09-25 12:02:32 +02:00
Nick Treleaven be2ac0ba89
fmt: fix writing ConcatExpr (#6466) 2020-09-24 18:04:39 +02:00
Uwe Krüger 72ecc222ee
fmt: support `select` expressions (#6460) 2020-09-23 22:22:39 +02:00