aboutsummaryrefslogtreecommitdiff
path: root/src/ast_render.cpp
AgeCommit message (Collapse)Author
2020-01-02Implement the callconv() annotationLemonBoy
2019-12-05implement `@call`Andrew Kelley
closes #3732
2019-12-02Accept comptime-known expression for asmLemonBoy
2019-11-23structs can have fields with type `var`Andrew Kelley
behavior tests passing now
2019-11-23update the stage1 implementation to the new proposalAndrew Kelley
See #3731
2019-11-21string literals are now null terminatedAndrew Kelley
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-11implement anon struct literal syntaxAndrew Kelley
This implements stage1 parser support for anonymous struct literal syntax (see #685), as well as semantic analysis support for anonymous struct literals and anonymous list literals (see #208). The semantic analysis works when there is a type coercion in the result location; inferring the struct type based on the values in the literal is not implemented yet. Also remaining to do is zig fmt support for this new syntax and documentation updates.
2019-11-06fix NodeErrorSetDecl renderingVexu
2019-10-06stage1 parser supports doc commentsAndrew Kelley
2019-09-05implement `noasync` function callsAndrew Kelley
See #3157
2019-09-05Add the noinline keyword for function declarationsLemonBoy
2019-08-30support recursive async and non-async functionsAndrew Kelley
which heap allocate their own frames related: #1006
2019-08-15remove `cancel`Andrew Kelley
2019-08-05add a src() method to AstNode to aid debuggingAndrew Kelley
2019-08-02Merge branch 'master' into rewrite-coroutinesAndrew Kelley
2019-08-02implement async await and returnAndrew Kelley
2019-07-26add the `anyframe` and `anyframe->T` typesAndrew Kelley
2019-07-23fix escape sequence renderingVexu
2019-07-19remove coroutines implementation and promise typeAndrew Kelley
2019-07-19fix usingnamespaceAndrew Kelley
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-06-27Merge branch 'master' into translate-c-userlandhryx
2019-06-23stage1: always render space after `fn` like stage2hryx
2019-06-09Merge remote-tracking branch 'origin/master' into copy-elision-3Andrew Kelley
2019-06-09different array literal syntax when inferring the sizeAndrew Kelley
old syntax: []i32{1, 2, 3} new syntax: [_]i32{1, 2, 3} closes #1797
2019-06-08hook up result locs for `try`Andrew Kelley
2019-06-04src/ast_render.cpp: fix rendering of character literals <= 0x0fNick Erdmann
2019-04-25translate-c: a little closer to self-hosted implementationAndrew Kelley
2019-04-22Correct rendering of AST Char literalsLemonBoy
2019-03-24introduce the enum literal typeAndrew Kelley
see #683
2019-03-20add docs for assembly and fix global assembly parsingAndrew Kelley
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-08fix .d file parsing and string literal ast renderingAndrew Kelley
2019-03-08breaking changes to zig build API and improved cachingAndrew Kelley
* in Zig build scripts, getOutputPath() is no longer a valid function to call, unless setOutputDir() was used, or within a custom make() function. Instead there is more convenient API to use which takes advantage of the caching system. Search this commit diff for `exe.run()` for an example. * Zig build by default enables caching. All build artifacts will go into zig-cache. If you want to access build artifacts in a convenient location, it is recommended to add an `install` step. Otherwise you can use the `run()` API mentioned above to execute programs directly from their location in the cache. Closes #330. `addSystemCommand` is available for programs not built with Zig build. * Please note that Zig does no cache evicting yet. You may have to manually delete zig-cache directories periodically to keep disk usage down. It's planned for this to be a simple Least Recently Used eviction system eventually. * `--output`, `--output-lib`, and `--output-h` are removed. Instead, use `--output-dir` which defaults to the current working directory. Or take advantage of `--cache on`, which will print the main output path to stdout, and the other artifacts will be in the same directory with predictable file names. `--disable-gen-h` is available when one wants to prevent .h file generation. * `@cImport` is always independently cached now. Closes #2015. It always writes the generated Zig code to disk which makes debug info and compile errors better. No more "TODO: remember C source location to display here" * Fix .d file parsing. (Fixes the MacOS CI failure) * Zig no longer creates "temporary files" other than inside a zig-cache directory. This breaks the CLI API that Godbolt uses. The suggested new invocation can be found in this commit diff, in the changes to `test/cli.zig`.
2019-02-11translate-c: use C pointer type everywhereAndrew Kelley
See #1059
2019-02-06thread local storage working for linux x86_64Andrew Kelley
2019-01-29backport copy elision changesAndrew Kelley
This commit contains everything from the copy-elision-2 branch that does not have to do with copy elision directly, but is generally useful for master branch. * All const values know their parents, when applicable, not just structs and unions. * Null pointers in const values are represented explicitly, rather than as a HardCodedAddr value of 0. * Rename "maybe" to "optional" in various code locations. * Separate DeclVarSrc and DeclVarGen * Separate PtrCastSrc and PtrCastGen * Separate CmpxchgSrc and CmpxchgGen * Represent optional error set as an integer, using the 0 value. In a const value, it uses nullptr. * Introduce type_has_one_possible_value and use it where applicable. * Fix debug builds not setting memory to 0xaa when storing undefined. * Separate the type of a variable from the const value of a variable. * Use copy_const_val where appropriate. * Rearrange structs to pack data more efficiently. * Move test/cases/* to test/behavior/* * Use `std.debug.assertOrPanic` in behavior tests instead of `std.debug.assert`. * Fix outdated slice syntax in docs.
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-10-15Solve the return type ambiguity (#1628)Jimmi Holst Christensen
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}
2018-09-26the last number in a packed ptr is host int bytesAndrew Kelley
See #1121
2018-09-13remove `this`. add `@This()`.Andrew Kelley
closes #1283
2018-08-02src/ast_render.cpp: remove promise_symbol from suspend;kristopher tate
Tracking Issue #1296 ;
2018-06-10breaking syntax change: orelse keyword instead of ?? (#1096)Andrew Kelley
use the `zig-fmt-optional-default` branch to have zig fmt automatically do the changes. closes #1023
2018-06-09breaking syntax change: ??x to x.? (#1095)Andrew Kelley
See #1023 This also renames Nullable/Maybe to Optional
2018-06-04disallow single-item pointer indexingAndrew Kelley
add pointer arithmetic for unknown length pointer
2018-05-31use * for pointer type instead of &Andrew Kelley
See #770 To help automatically translate code, see the zig-fmt-pointer-reform-2 branch. This will convert all & into *. Due to the syntax ambiguity (which is why we are making this change), even address-of & will turn into *, so you'll have to manually fix thes instances. You will be guaranteed to get compile errors for them - expected 'type', found 'foo'
2018-05-09Merge branch 'master' into pointer-reformAndrew Kelley
2018-05-02Added better support for none pure enums in tranlate CJimmi Holst Christensen
2018-04-30[breaking] delete ptr deref prefix opAndrew Kelley
start using zig-fmt-pointer-reform branch build of zig fmt to fix code to use the new syntax all of test/cases/* are processed, but there are more left to be done - all the std lib used by the behavior tests
2018-04-30support foo.* for ptr derefAndrew Kelley
See #770
2018-04-08*WIP* async/await TCP serverAndrew Kelley
2018-03-24add promise->T syntax parsingAndrew Kelley
closes #857