Andrew Kelley
02c1b9df3b
fix compiler-rt tests accidentally running std tests
...
also reduce the aggressiveness of std.atomic.stack
and std.atomic.queue fuzz testing. appveyor has 1 core
and 10,000 iterations is too much for 6 threads to
thrash over
2018-05-02 21:34:34 -04:00
Andrew Kelley
3a8dc4e90d
zig fmt: line comments in struct initializer
2018-05-01 01:30:53 -04:00
Andrew Kelley
7c822869fe
zig fmt: only some docs have doc comments
2018-04-30 20:25:54 -04:00
Andrew Kelley
61a726c290
zig fmt: comments in field decls
2018-04-30 19:27:14 -04:00
Andrew Kelley
4cc1008c2d
zig fmt: error set decls
2018-04-30 19:16:46 -04:00
Andrew Kelley
3e61c45f89
zig fmt: consistent spacing for container inits
2018-04-30 18:49:05 -04:00
Andrew Kelley
eed49a2104
zig fmt: aggregate type init with only 1 field
2018-04-30 18:30:47 -04:00
Andrew Kelley
1d06915f27
zig fmt: support union(enum(tag)) and enum init values
2018-04-30 18:20:27 -04:00
Andrew Kelley
7dc8d433ab
zig fmt: support labeled suspend
2018-04-30 17:30:57 -04:00
Andrew Kelley
37d3ef2835
zig fmt: support promise->T
2018-04-30 16:16:58 -04:00
Andrew Kelley
47680cc0d8
zig fmt: better multiline string handling
2018-04-30 15:10:55 -04:00
Andrew Kelley
54987c3d8f
std.zig.tokenizer: 3 slashes is doc comment, 4 is line comment
2018-04-30 00:56:59 -04:00
Andrew Kelley
0bf7ebcfea
std.zig.tokenizer: fix handling of line comment / doc comment
2018-04-30 00:52:09 -04:00
Andrew Kelley
fd2cd38bdb
zig fmt: support line comments and doc comments
...
line comments can go anywhere a list of something is allowed
2018-04-30 00:19:55 -04:00
Andrew Kelley
4e23fb7f06
zig fmt: comments before error set decl
2018-04-29 22:12:17 -04:00
Andrew Kelley
f04015c080
zig fmt: comments before switch prong
2018-04-29 21:47:54 -04:00
Andrew Kelley
a912c7d75f
zig fmt: same-line comment after switch prong
2018-04-29 21:27:44 -04:00
Andrew Kelley
c53209a8a8
zig fmt: comments before var decl in struct
2018-04-29 19:55:57 -04:00
Andrew Kelley
3235eb03f9
zig fmt: preserve same line comment after struct field
2018-04-29 19:23:19 -04:00
Andrew Kelley
3fa0bed985
zig fmt: array literal with 1 item on 1 line
2018-04-29 18:22:39 -04:00
Andrew Kelley
c03b9010db
zig fmt: preserve same-line comment after statement
2018-04-29 17:37:15 -04:00
Andrew Kelley
ad4ee47d9f
zig fmt: preserve comments before global variables
2018-04-29 16:24:12 -04:00
Andrew Kelley
b7095912c7
zig fmt: respect comments before statements
2018-04-29 15:48:53 -04:00
Andrew Kelley
1098545e47
std.zig.parser: remove unused field
2018-04-21 02:10:22 -04:00
Andrew Kelley
6e57243a79
zig fmt: preserve comments in front of test blocks
...
* refactor std.zig.parser
* fix compiler crashing for some compile errors
* take advantage of @field in std.zig.ast
* move ast.NodeFoo to ast.Node.Foo
* comment preservation is more explicit
See #911
2018-04-20 02:15:09 -04:00
Jimmi Holst Christensen
a498993fd1
Merged with master
2018-04-13 10:40:37 +02:00
Jimmi Holst Christensen
44c53c9979
std.zig.parser: Refactor round 2
...
* More work on ensuring that each state only eat one token
* VarDecl parsing now constructs its node
* Handling all fn parsing in the same case
* Using eatToken instead of getNextToken where possible
* All tokenIdTo* now takes @TagType(Token.Id)
* Added a createToCtxLiteral function
2018-04-13 10:15:12 +02:00
Andrew Kelley
0f652b4d80
zig fmt: switch cases on new lines
...
See #911
2018-04-12 21:56:12 -04:00
Andrew Kelley
9e701e951b
zig fmt includes trailing commas
...
See #911
2018-04-12 21:40:15 -04:00
Andrew Kelley
d4572d1140
zig fmt: container init fields each on own line
...
See #911
2018-04-12 21:23:18 -04:00
Jimmi Holst Christensen
fad54e62bb
std.zig.ast: Fixed build failures
2018-04-12 18:56:58 +02:00
Jimmi Holst Christensen
d35a6655e0
std.zig.parser: Refactored commaOrEnd to expectCommaOrEnd
...
* Now it returns end when found, or null if comma was found.
* State should now be appended outside the function
2018-04-12 18:13:09 +02:00
Jimmi Holst Christensen
206c0b8bdb
std.zig.parser: Refactor, round 1:
...
* Removed the Optional state
* We now have an OptionalCtx instead of DestPtr
* OptionalCtx simulated return, instead of reverting states
* OptionalCtx is a lot less hacky, but is still a small footgun
* Trying to avoid consuming more than one token per state
* This is required, because of comments
* The C++ compiler allows comments between all tokens
* We therefor have to consume comment tokens between each state
* Reordered states so they are grouped in some logical fasion
2018-04-12 16:08:23 +02:00
Jimmi Holst Christensen
0d8646d262
std.zig.parser now parses alignment of functions
...
Related #909
This allows it to parse `std/special/compiler_rt/index.zig`
2018-04-12 08:46:26 +02:00
Jimmi Holst Christensen
5b584e06e3
std.zig.parser special cased error in return.
...
Related #909
This allows parsing of `std/special/build_runner.zig`
2018-04-11 20:56:05 +02:00
Jimmi Holst Christensen
a7f77d7c6a
std.zig.parser: requireSemiColon now matches the C++ behavior
...
Related #909
Allowes parsing of `std/os/child_process.zig`
2018-04-11 15:26:00 +02:00
Jimmi Holst Christensen
df4c575525
std.zig.parser now parses inline fn proto
...
Related #909
Allows parsing of `std/os/zen.zig`.
2018-04-11 15:17:51 +02:00
Jimmi Holst Christensen
fe7146277d
std.zig.parser now accept both string and multiline string for strings
...
Related #909
Allows it to parse `std/special/compiler_rt/aullrem.zig`,
`std/special/compiler_rt/aulldiv.zig` and `std/math/x86_64/sqrt.zig`
2018-04-11 14:43:53 +02:00
Jimmi Holst Christensen
28ea364e5e
std.zig.parser now handle try's precedence correctly
...
This allows parsing of `std/zig/parser.zig`. Related: #909
2018-04-11 13:56:39 +02:00
Jimmi Holst Christensen
841ac0f4e1
std.zig.parser now allows assignment expr in switch cases.
...
This makes `std/os/index.zig` parse
related: #909
2018-04-11 13:46:35 +02:00
Jimmi Holst Christensen
4b0556ebd4
std.zig.parser can now parse std/heap.zig:
...
related: #909
* Struct fields can now be pub
* Parsing of double deref now works
* Block expressions now have the right precedence
2018-04-11 13:38:06 +02:00
Jimmi Holst Christensen
6fb5ab1b52
std.zig.parser: Redid parsing of error set delc
...
related: #909
2018-04-11 13:05:42 +02:00
Jimmi Holst Christensen
5f3ec023cd
std.zig.parser: Fixed parsing of field access rhs
...
related: #909
2018-04-11 12:53:01 +02:00
Jimmi Holst Christensen
281c17f6ae
std.zig.parser:
...
* Renamed eatToken to expectToken
* A new eatToken fn, which only eats the token, if the id match
* Inlined initNode, as it is not suppose to be used outside createNode
2018-04-11 12:05:10 +02:00
Jimmi Holst Christensen
dae287524d
std.zig: Major refactor
...
* There now exists a few function to allocate all nodes in parser.zig
* ast.zig now have a table of Ids and their corrisponding type
2018-04-11 10:37:04 +02:00
Josh Wolfe
405a2390f0
zig fmt while-else with no blocks
2018-04-10 22:44:55 -04:00
Andrew Kelley
27e881c2d7
fix another undefined deref
...
see 0ba85ea6ff91
2018-04-10 21:58:04 -04:00
Jimmi Holst Christensen
0ba85ea6ff
std.zig.parser fixed segfault when parsing cc for fn decl
2018-04-10 17:46:17 +02:00
Jimmi Holst Christensen
c6aa637146
std.zig.parser: removed dublicate "zig fmt: coroutines" test
2018-04-10 16:33:43 +02:00
Jimmi Holst Christensen
b9cccce26d
std.zig.ast: fixed none compiling code
2018-04-10 15:56:37 +02:00