Commit Graph

70 Commits (846ddfd728d672ff38d339bb0d1af1e9d374e58a)

Author SHA1 Message Date
yuyi e3e5bef139
ast, parser: fix formatting of `if` with inline comments (fix #7796) (#14018) 2022-04-13 00:15:27 +03:00
yuyi bb2ddb98a3
parser: check if guard condition (#13765) 2022-03-18 17:49:20 +03:00
yuyi dbb18e3656
parser: fix error for match branch with array expression (#13733) 2022-03-14 16:19:05 +02:00
yuyi 291a1ffd8d
token: rename Position to Pos, rename position() to pos() (#13279) 2022-01-26 12:36:28 +02:00
yuyi ca1f675dba
ast, checker, cgen: implement if guard with multi return optional (#13273) 2022-01-25 14:36:33 +02:00
Tim Basel 10efe47f03
parser: add support for mutable if guards (#13132) 2022-01-11 15:32:58 +02:00
Alexander Medvednikov 59ed4be49a all: update copyright year 2022-01-04 12:21:12 +03:00
zakuro eed882950c
fmt: remove extra comma of branch instead of parse error (#12814) 2021-12-14 08:14:43 +02:00
pancake 8ac7739db8
parser: forbid empty match statements 'match cond.op {else {}}' (#12618) 2021-11-30 09:32:48 +02:00
yuyi c28041cecc
all: cleanup/rename all `comp_` names to be `comptime_` (#12467) 2021-11-15 15:47:29 +02:00
Delyan Angelov 1c12186701
v.token,ast,scanner,parser: use a KeywordsMatcher lookup for builtin_type_names searches too 2021-11-07 16:39:40 +02:00
Uwe Krüger 1e5627e777
parser: don't require unary `>` prefix for `select` timeout (#10928) 2021-07-23 23:24:27 +03:00
Daniel Däschle ad3835b598
parser: deprecate short struct init (#10842) 2021-07-20 11:17:08 +03:00
shadowninja55 06a6a8e199
checker: check for empty branches in match expressions (#10593) 2021-06-28 19:32:28 +03:00
Wertzui123 148bb31f6e
v.parser: allow for `if x { $if y {} } else {}`, fix #10243 (#10294) 2021-06-01 12:19:39 +03:00
Louis Schmieder 38796521fa
all: allow defer use from other scope (#10284) 2021-05-31 14:43:44 +03:00
Alexander Medvednikov ca8158ac41 parser: handle casts in match expressions; c2v: minor fixes 2021-05-28 17:59:43 +03:00
Uwe Krüger 3c0a368af3
all: automatically move (some) referenced objects to heap (#9873) 2021-04-25 21:40:38 +03:00
Alexander Medvednikov 7385f8e56b all: a massive merge of ast and table modules 2021-04-02 01:57:09 +03:00
Alexander Medvednikov 6f318be96c checker: do not allow nil sum types init 2021-03-31 11:13:52 +03:00
Ned Palacios aa4e22c287
scanner, token: add column information to tokens (#9407) 2021-03-23 06:23:46 +01:00
ka-weihe 3753a58ce0
parser: fix if-guard redefinition (#9425) 2021-03-23 04:38:36 +01:00
spaceface 7d0cba5e96
v.ast: remove the `stmt.position()` method (#9233) 2021-03-11 14:50:02 +02:00
spaceface b9a381f101
all: migrate to the new Option (p. 1) (#8924) 2021-02-28 22:24:29 +03:00
Delyan Angelov 1c0eefae38
parser/scanner: replace p.peek_tok2/3 with p.peek_token(2/3) (#8946) 2021-02-24 21:03:53 +03:00
Lukas Neubert cb1f63f765
parser: replace eat_line_end_comments() with configurable eat_comments() (#8636) 2021-02-08 18:16:02 +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
Lukas Neubert 2774db077d
fmt: keep user choice for newlines in match branches (#8418) 2021-01-30 11:57:57 +01:00
Lukas Neubert e47c13903b
fmt: keep newlines between toplevel stmts (#8383) 2021-01-29 12:17:59 +02:00
Lukas Neubert 8b61891348
fmt: smarter if condition wrapping (#8201) 2021-01-23 10:33:22 +02:00
Tim Basel 129eee346b
fmt: keep single empty lines (#8189) 2021-01-19 14:49:40 +01:00
Swastik Baranwal 6f1ae65811
parser: add a warning for only else branch in match (#8185) 2021-01-18 18:31:36 +02: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
Daniel Däschle 53941c4a0a
fmt: fix if cond break readability (#8132) 2021-01-16 02:12:17 +01:00
Daniel Däschle 085085a2b9
parser: fix sumtype match with array type (#7939) 2021-01-07 20:12:35 +01:00
Lukas Neubert 06fdf34214
fmt: unwrap long single line ifs (#7608) 2020-12-27 14:20:30 +01:00
Daniel Däschle b76c91ec05
parser: silent mode fixes (#7286) 2020-12-12 13:52:22 +01:00
joe-conigliaro 0aa9f5a007
all: optimize scope usage in checker & parser. store scope in ast nodes (#7281) 2020-12-12 19:01:12 +11:00
Daniel Däschle aedd1d17b8
parser: fix `v test-parser examples/cli.v` (#7243) 2020-12-10 19:32:15 +02:00
Daniel Däschle 47d0ed308d
parser: prepare for better VLS integration, more accurate parser errors (#7119) 2020-12-04 20:34:05 +02:00
Lukas Neubert 2691163a7e
scope: remove redundant name arg from register() (#7077) 2020-12-02 14:40:25 +01:00
Alexander Medvednikov c5cd53ca79 parser: bring back old $if position calculation 2020-12-01 18:59:33 +01:00
Alexander Medvednikov 0ff541375d autofree: fix a bug with $if and add a test 2020-12-01 18:58:16 +01:00
Daniel Däschle 966b95ca4e
parser: move mut in if/match to expr (#6973) 2020-11-27 03:08:42 +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
Daniel Däschle 22fdf76db5
gen: unwrap optional on if guard expr (#6903) 2020-11-21 22:40:05 +01:00