Andrew Kelley
1c79eea125
zig fmt: while loops
2021-02-09 17:23:57 -07:00
Andrew Kelley
bcafc51e58
zig fmt: fn protos and anytype
2021-02-09 14:41:50 -07:00
Andrew Kelley
b1d8a0a5a6
zig fmt: asm expressions
2021-02-08 22:03:23 -07:00
Isaac Freund
d869133a9f
zig fmt: implement switches
2021-02-08 15:41:31 -08:00
Isaac Freund
837cd748a8
zig fmt: fix block lbrace indent
2021-02-08 15:41:31 -08:00
Isaac Freund
aaf13a2bb3
zig fmt: implement break
2021-02-08 15:41:31 -08:00
Isaac Freund
57cec38e61
std/zig/ast: fix Tree.lastToken() for blocks
...
The fact that blocks may end in a semicolon but this semicolon is not
counted by recursive lastToken() evaluation on the sub expression causes
off-by-one errors for lastToken() on blocks currently.
To fix this, introduce BlockSemicolon and BlockTwoSemicolon following
the pattern used for trailing commas in e.g. builtin function arguments.
2021-02-07 14:51:37 -08:00
Isaac Freund
0e38362d24
zig fmt: split Slice and SliceSentinel
...
This saves 4 whole bytes in the common case where there is no sentinel.
2021-02-07 14:51:37 -08:00
Isaac Freund
1d71b19c0d
zig fmt: implement error set decls
2021-02-07 14:51:37 -08:00
Isaac Freund
bb7b5ee2ac
zig fmt: implement catch and return
2021-02-07 12:04:32 -08:00
Isaac Freund
0929fcbc34
zig fmt: implement slices
2021-02-07 12:04:32 -08:00
Isaac Freund
33915cb1ed
zig fmt: implement pointer types
...
rename PtrType => PtrTypeBitRange, SliceType => PtrType
This rename was done as the current SliceType is used for non-bitrange
pointers as well as slices and because PtrTypeSentinel/PtrTypeAligned
are also used for slices. Therefore using the same Ptr prefix for all
these pointer/slice nodes is an improvement.
2021-02-06 21:29:45 -08:00
Andrew Kelley
d898945786
zig fmt: builtin call with trailing comma
2021-02-05 20:38:30 -07:00
Andrew Kelley
409ca88829
zig fmt: trailing comma in fn parameter list
2021-02-05 17:46:15 -07:00
Andrew Kelley
16a2562c3f
zig fmt: implement container decls
2021-02-05 15:47:18 -07:00
Isaac Freund
0f3fa4d654
zig fmt: array types
2021-02-05 11:36:19 -08:00
Isaac Freund
6f3b93e2e8
zig fmt: struct and anon array initialization
2021-02-05 10:51:45 -08:00
Andrew Kelley
7069459a76
zig fmt: implement struct init
2021-02-04 19:59:06 -07:00
Andrew Kelley
8e46d06650
zig fmt: implement fn protos and defers
2021-02-04 16:38:29 -07:00
Asherah Connor
4428acf0f7
zig fmt: deref, unwrap optional
2021-02-04 10:49:45 -08:00
Andrew Kelley
725adf8332
zig fmt: builtin calls and array access
2021-02-03 22:12:11 -07:00
Andrew Kelley
f5279cbada
zig fmt: implement top-level fields
2021-02-03 17:02:12 -07:00
Andrew Kelley
1a83b29bea
zig fmt: implement if, call, field access, assignment
2021-02-02 21:05:53 -07:00
Andrew Kelley
0c6b98b825
zig fmt: implement simple test with doc comments
2021-02-01 21:31:41 -07:00
Andrew Kelley
272a0ab359
zig fmt: implement "line comment followed by top-level comptime"
2021-02-01 20:11:55 -07:00
Andrew Kelley
20554d32c0
zig fmt: start reworking with new memory layout
...
* start implementation of ast.Tree.firstToken and lastToken
* clarify some ast.Node doc comments
* reimplement renderToken
2021-02-01 17:23:49 -07:00
Timon Kruiper
e23bc1f76a
render: fix bug when rendering struct initializer with length 1
...
This crashed the compiler when running translate-c. See the added test.
2021-01-25 10:40:00 -08:00
LemonBoy
ac004e1bf1
stage1: Allow nameless test blocks
...
Nameless blocks are never filtered, the test prefix is still applied.
2021-01-22 15:46:58 +01:00
Jay Petacat
e72472d953
io: FindByteOutStream to FindByteWriter
...
See #4917
2021-01-08 16:54:56 -05:00
Jay Petacat
1595ce273e
Remove deprecated stream aliases
2021-01-08 16:54:56 -05:00
Jay Petacat
a9b505fa77
Reduce use of deprecated IO types
...
Related: #4917
2021-01-07 23:48:58 -08:00
LemonBoy
dd973fb365
std: Use {s} instead of {} when printing strings
2021-01-02 17:12:57 -07:00
Frank Denis
6c2e0c2046
Year++
2020-12-31 15:45:24 -08:00
LemonBoy
fa6449dac0
zig fmt: Fix alignment of initializer elements
...
Resetting `column_counter` is not needed as the effective column number
is calculated by taking that value modulo `row_size`.
Closes #7289
2020-12-11 02:34:44 -05:00
Vexu
be71994fb1
zig fmt: improve var decl initializer formatting
2020-12-09 13:47:22 +02:00
Tadeo Kondrak
069fbb3c01
Add opaque type syntax
2020-10-06 22:08:24 -06:00
Lachlan Easton
4496a6c9cc
zig fmt: Special case un-indent comma after multiline string in param list
2020-09-18 20:34:00 +10:00
Lachlan Easton
1aacedf6e1
zig fmt: Fix regression in ArrayInitializers
2020-09-18 20:34:00 +10:00
Lachlan Easton
40b6e86a99
zig fmt: fix #6171
2020-09-18 20:34:00 +10:00
Lachlan Easton
c06674e701
zig fmt: Small cleanup
2020-09-18 20:34:00 +10:00
Lachlan Easton
206a8cf670
zig fmt: fix comments and multiline literals in function args
2020-09-18 20:34:00 +10:00
Lachlan Easton
291482a031
zig fmt: Don't consider width of expressions containing multiline string literals when calculating padding for array initializers. fixes #3739
...
Changes some of the special casing for multiline string literals.
2020-09-18 20:34:00 +10:00
Lachlan Easton
e1bd271192
zig fmt: Allow trailing comments to do manual array formatting. close #5948
2020-09-18 20:34:00 +10:00
Lachlan Easton
9f0821e688
zig fmt: Fix erroneously commented out code, add passing test case to close #5722
2020-09-18 20:34:00 +10:00
Lachlan Easton
283d441c19
zig fmt: fix #3978 , fix #2748
2020-09-09 21:54:42 +10:00
Lachlan Easton
bb848dbeee
zig fmt: Patch rename stream to ais (auto indenting stream) & other small refactors
2020-09-02 20:16:28 +10:00
Lachlan Easton
7841c9b7d1
zig fmt: Fix merge errors
2020-09-01 21:59:27 +10:00
Lachlan Easton
671b3abe5d
Merge remote-tracking branch 'ziglang/master' into fmt_indentation
2020-09-01 18:41:23 +10:00
Andrew Kelley
8dc58a4e94
Merge pull request #6208 from tadeokondrak/remove-@OpaqueType
...
Remove @OpaqueType
2020-08-31 17:44:03 -04:00
Lachlan Easton
029ec456bc
zig fmt: Set indent_delta to 2 when rendering inline asm
2020-08-31 23:39:50 +10:00