Commit Graph

341 Commits

Author SHA1 Message Date
Andrew Kelley 5951b79af4 remove stdcallcc, extern, nakedcc from stage1; zig fmt rewrites 2020-01-06 15:23:05 -05:00
LemonBoy 563d9ebfe5 Implement the callconv() annotation 2020-01-02 18:53:16 +01:00
Andrew Kelley 26f3c2d061 fix std.mem.addNullByte and implement sentinel slicing
see #3770
2019-12-20 18:28:56 -05:00
Vexu c759a77aa0 fix dot init parsing 2019-12-12 13:06:48 -05:00
Andrew Kelley a3f6a58c77 remove var args from the language
closes #208
2019-12-09 15:27:27 -05:00
Andrew Kelley fe8d65556d add syntax for comptime struct fields 2019-12-08 12:26:20 -05:00
LemonBoy 26c8930b95 Accept comptime-known expression for asm 2019-12-02 19:53:06 -05:00
Andrew Kelley f25182f46d structs can have fields with type var
behavior tests passing now
2019-11-23 17:51:37 -05:00
Andrew Kelley 7597735bad update the stage1 implementation to the new proposal
See #3731
2019-11-23 04:45:35 -05:00
Andrew Kelley 47f06be369 string literals are now null terminated
this also deletes C string literals from the language, and then makes
the std lib changes and compiler changes necessary to get the behavior
tests and std lib tests passing again.
2019-11-21 20:43:41 -05:00
Andrew Kelley 1aa978f32e implement null terminated pointers 2019-11-21 20:43:41 -05:00
Andrew Kelley 57b8614a5a Merge pull request #3697 from Vexu/container-docs
Implement container level doc comments
2019-11-17 22:31:12 +00:00
Vexu 6cddf9d723 properly parse anon literal in array 2019-11-17 22:24:21 +00:00
Vexu 977b613881 add container doc comments to generated docs 2019-11-15 15:17:59 +02:00
Vexu e509d21f39 implemented container doc comments in stage 1 2019-11-15 15:02:51 +02:00
Andrew Kelley de30438ed2 stage1 parser code for anon container lit 2019-11-11 13:11:58 -05:00
Brendan Hansknecht c1e8fdf812 add token for parsing pointer dereference 2019-11-06 14:03:21 -05:00
Vexu 2550cb4638 remove pub syntax for container fields 2019-10-21 23:04:19 -04:00
Andrew Kelley e0f0e2aace generated docs: error sets in fn docs 2019-10-08 18:09:08 -04:00
Andrew Kelley 2ccb48ddc3 generated docs: show doc comments on functions 2019-10-07 12:21:11 -04:00
Andrew Kelley 8e2c441b2e stage1 parser supports doc comments 2019-10-06 16:39:27 -04:00
Andrew Kelley 0a3c6dbda9 implement noasync function calls
See #3157
2019-09-05 21:55:32 -04:00
LemonBoy fabf45f5fc Add the noinline keyword for function declarations 2019-09-05 13:04:58 -04:00
Andrew Kelley 6ab8b2aab4 support recursive async and non-async functions
which heap allocate their own frames

related: #1006
2019-08-30 20:06:02 -04:00
Tetralux 3ec10ea174 parsing of align(N) on struct fields 2019-08-22 22:58:02 +00:00
Vexu 2151f84d59 implement new async syntax in self-hosted compiler 2019-08-16 06:17:28 -07:00
Andrew Kelley 13b5a4bf8c remove cancel 2019-08-15 14:05:12 -04:00
Andrew Kelley ee64a22045 add the anyframe and anyframe->T types 2019-07-26 19:52:35 -04:00
Andrew Kelley 54e716afdc remove coroutines implementation and promise type 2019-07-19 18:18:44 -04:00
Andrew Kelley af8661405b fix usingnamespace
It used to be that usingnamespace was only allowed at top level. This
made it OK to put the state inside the AST node data structure. However,
now usingnamespace can occur inside any aggregate data structure, and
therefore the state must be in the TopLevelDeclaration rather than in
the AST node.

There were two other problems with the usingnamespace implementation:

 * It was passing the wrong destination ScopeDecl, so it could cause an
   incorrect error such as "import of file outside package path".
 * When doing `usingnamespace` on a file that already had
   `pub usingnamespace` in it would "steal" the usingnamespace, causing
   incorrect "use of undeclared identifier" errors in the target file.

closes #2632
closes #2580
2019-07-19 16:56:44 -04:00
Andrew Kelley b1f8b53d20 rename internal names regarding usingnamespace 2019-07-16 16:20:54 -04:00
hryx cce11a724c Make anyerror not a keyword 2019-07-06 15:57:32 -07:00
Andrew Kelley 33371ab55c Merge remote-tracking branch 'origin/master' into copy-elision-3 2019-06-11 00:09:58 -04:00
Andrew Kelley b7811d3269 whitespace cleanup 2019-06-10 00:45:24 -04:00
SamTebbs33 6c160b8856 Add check for null body in if, for and while 2019-06-10 00:41:33 -04:00
Andrew Kelley 3a4b749c8a Merge remote-tracking branch 'origin/master' into copy-elision-3 2019-06-09 19:44:01 -04:00
Andrew Kelley b735764898 different array literal syntax when inferring the size
old syntax:  []i32{1, 2, 3}
new syntax: [_]i32{1, 2, 3}

closes #1797
2019-06-09 19:26:32 -04:00
Andrew Kelley 52eb347188 hook up result locs for try 2019-06-08 01:16:19 -04:00
Andrew Kelley b7a82288ad change use to usingnamespace
See #2014

`use` syntax is still accepted for now. `zig fmt` automatically
updates code. After a release cycle the old syntax will be removed.
2019-05-29 19:09:58 -04:00
Jimmi Holst Christensen 6cf7fb1177 fixes #2235 2019-05-11 20:51:59 +02:00
Jimmi Holst Christensen c051904903 Fixed parser for extern threadlocal variables 2019-05-11 18:48:52 +02:00
Jimmi HC 6b10f03b4a Fixes and simplifications for stage 1 parser 2019-05-10 16:09:58 +02:00
hryx 5765cbd2de Allow tag expr for enum but not struct 2019-04-22 00:14:51 -07:00
Andrew Kelley 5eaead6a56 implement allowzero pointer attribute
closes #1953

only needed for freestanding targets.

also adds safety for `@intToPtr` when the address is zero.
2019-03-25 12:55:45 -04:00
Andrew Kelley d0551db5cd introduce the enum literal type
see #683
2019-03-24 00:44:18 -04:00
Andrew Kelley 15c316b0d8 add docs for assembly and fix global assembly parsing
Previously, global assembly was parsed expecting it to have
the template syntax. However global assembly has no inputs,
outputs, or clobbers, and thus does not have template syntax.
This is now fixed.

This commit also adds a compile error for using volatile
on global assembly, since it is meaningless.

closes #1515
2019-03-20 19:00:23 -04:00
Jimmi Holst Christensen e508b85746 Updated parser to newest grammar 2019-03-19 10:36:37 +01:00
Andrew Kelley 5424b4320d remove namespace type; files are empty structs
closes #1047
2019-02-28 10:11:32 -05:00
Matthew McAllister 51783510b9 Deduplicate compile log statement warnings 2019-02-17 14:02:37 -08:00
Andrew Kelley 661fc79fba langref: update grammar with c pointers
See #1059
2019-02-10 12:02:56 -05:00