Commit Graph

57 Commits (d24dce8eb33d60395e8dd8326bbfd0e81a0bcf7b)

Author SHA1 Message Date
yuyi b9cf2db6a8
parser: fix inline array's element access (#14253) 2022-05-02 16:16:32 +03:00
Alexander Medvednikov 364656b312 builtin: define C.abs() 2022-04-20 13:03:30 +03:00
Alexander Medvednikov c03fe020bf parser: do not allow [x]byte{} 2022-04-15 20:40:37 +03:00
Alexander Medvednikov 78cb6e2b41 all: handle fixed []u8 2022-04-15 18:35:56 +03:00
Alexander Medvednikov 36ec47cd20 all: replace "NB:" with "Note:" (docs/comments) 2022-03-06 20:01:22 +03:00
yuyi 291a1ffd8d
token: rename Position to Pos, rename position() to pos() (#13279) 2022-01-26 12:36:28 +02:00
Alexander Medvednikov 59ed4be49a all: update copyright year 2022-01-04 12:21:12 +03:00
ChAoS_UnItY 4d1307f29b
all: index accessor in array init expression (#12181) 2021-10-15 03:57:49 +03:00
Daniel Däschle ad3835b598
parser: deprecate short struct init (#10842) 2021-07-20 11:17:08 +03:00
Uwe Krüger 1b0f099552
parser: fix handling of `-` inside array literals (#9771) 2021-04-17 02:37:17 +03:00
yuyi 1250ce4353
cgen: fix generics with embed generics (fix #8694) (#9724) 2021-04-15 01:44:11 +02: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
Lukas Neubert 7f7f9dca6b
parser,fmt: fix regression with non-void arrays in if conditions (#9161) 2021-03-06 20:39:38 +02:00
Joe Conigliaro 818be80581
parser: fix [] in if expr. closes #9131 2021-03-06 01:43:34 +11: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 9dc770e29c
fmt: do not struggle with comments inside maps (#8897) 2021-02-22 13:04:48 +02:00
Lukas Neubert f18adf7759
parser,fmt: handle array pre-comments separately from exprs (#8884) 2021-02-21 20:18:19 +02:00
Alexander Medvednikov 0a03856c83 parser: small c2v fixes 2021-02-12 09:12:26 +01:00
Lukas Neubert cb1f63f765
parser: replace eat_line_end_comments() with configurable eat_comments() (#8636) 2021-02-08 18:16:02 +02:00
Uwe Krüger 118ca1240e
all: allow `shared` element types for `struct` and arrays (#8631) 2021-02-08 00:28:29 +01:00
Nick Treleaven f5f65f929f
parser: parse `map{key_expr: val_expr}` (#8608) 2021-02-06 22:13:24 +01:00
Delyan Angelov 119dfc0bb0
all: support map[f32]string and map[f64]string (float map keys) too (#8556) 2021-02-04 23:59:49 +01:00
Lukas Neubert ea06966fd4
fmt: hide ´[]Type{} instead of []Type´ and ´(f mut Foo)´ warnings (#8528) 2021-02-03 11:25:08 +02:00
yuyi b8857baa98
parser: fix map_init position (#8293) 2021-01-23 13:33:19 +01:00
Tim Basel 129eee346b
fmt: keep single empty lines (#8189) 2021-01-19 14:49:40 +01:00
Lukas Neubert ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
yuyi a2efb5319d
all: change `[1,2,3]!!` to `[1,2,3]!` (#8101) 2021-01-14 03:51:13 +01:00
zakuro 47536df2d0
table: remove nr_dims from Array (#8053) 2021-01-13 23:43:19 +01:00
zakuro 3e3d45b2b1
parser: improve array init warning (#8024) 2021-01-13 06:03:23 +01:00
yuyi 03a0534483
all: change fixed array init from `[1,2,3]!!` to `[1,2,3]!` (#8068) 2021-01-13 03:28:53 +01:00
yuyi 704f38d87f
parser: fix multi fixed arrays init (#7996) 2021-01-10 06:58:31 +01:00
Nick Treleaven 9243e06dba
parser: allow integer and rune keys for map literal (#7756) 2021-01-01 17:23:32 +01:00
Daniel Däschle 11808f9fa3
parser: fix silent errors (#7271) 2020-12-12 04:06:09 +01:00
Daniel Däschle 47d0ed308d
parser: prepare for better VLS integration, more accurate parser errors (#7119) 2020-12-04 20:34:05 +02: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
Daniel Däschle 6e4dad9acf
parser: fix position of array init (#6998) 2020-11-28 17:05:14 +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
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
Nick Treleaven bab5c21224
parser: warn when fixed-size ArrayInit doesn't have trailing `{}`. (#6137) 2020-08-16 04:54:05 +02:00
Nick Treleaven 0f0a91fc9e
parser: support custom fixed size ArrayInit: `[3]int{init: -1}` (#6114) 2020-08-15 11:01:54 +02:00
Enzo 90d9040e6e
all: make comment expressions + fix vfmt array init (#5851) 2020-07-17 19:13:22 +02:00
spaceface777 60716bba29
parser: fix nested array_init syntax 2020-05-28 19:36:57 +03:00
Alexander Medvednikov 01dbb25a37 checker: do not allow defining methods on types from other modules 2020-05-28 15:23:20 +02:00
yuyi 977eb895e8
checker: check array init's element type 2020-05-28 13:32:12 +02:00
Alexander Medvednikov 1bf26a35fa array: rename default to init 2020-05-13 22:00:24 +02:00
Alexander Medvednikov 33a9822548 parser/vfmt: handle array len and default in array init 2020-05-13 16:11:52 +02:00
yuyi 2f52106253
parser: use .next instead of .check, when a token is already known 2020-05-07 07:51:36 +03:00
Alexander Medvednikov f23948010a parser: new array init syntax 2020-04-26 17:28:48 +02:00
Delyan Angelov ee31339dfd parser: fix error position for use `x := []Type{}` 2020-04-26 10:42:46 +03:00