aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
AgeCommit message (Collapse)Author
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-19Updated parser to newest grammarJimmi Holst Christensen
2019-02-28remove namespace type; files are empty structsAndrew Kelley
closes #1047
2019-02-17Deduplicate compile log statement warningsMatthew McAllister
2019-02-10langref: update grammar with c pointersAndrew Kelley
See #1059
2019-02-10added C pointer type and implicit int-to-ptr for this typeAndrew 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.
2019-01-29simpler implementation of `&&` and `||` hintsAndrew Kelley
This accomplishes the same goal, but with less changes, so that I can backport copy elision stuff easier.
2019-01-25Hint at use of and/or when &&/|| is improperly used (#1886)kristopher tate
2018-11-17Updated comments in parser.cppJimmi HC
2018-11-17rename `section` keyword to `linksection`Andrew Kelley
add zig fmt support for this syntax closes #1152
2018-11-13Fixed error where we didn't expect the return type of a functionJimmi Holst Christensen
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-02pull request fixupsAndrew Kelley
* clean up parser code * fix stage2 parse and render code * remove redundant test * make stage1 compile tests leaner
2018-08-02src/parser.cpp: fix typo from rebase;kristopher tate
2018-08-02src/parser.cpp: remove promise_symbol from suspend;kristopher tate
Tracking Issue #1296 ;
2018-07-27remove ability to break from suspend blocksAndrew Kelley
closes #803
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-06-02introduce [*] for unknown length pointersAndrew Kelley
See #770 Currently it does not have any different behavior than `*` but it is now recommended to use `[*]` for unknown length pointers to be future-proof. Instead of [ * ] being separate tokens as the proposal suggested, this commit implements `[*]` as a single token.
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-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-18support break in suspend blocksAndrew Kelley
* you can label suspend blocks * labeled break supports suspend blocks See #803
2018-04-08fixups from rebaseAndrew Kelley
2018-04-08*WIP* async/await TCP serverAndrew Kelley
2018-03-24add promise->T syntax parsingAndrew Kelley
closes #857
2018-03-22ability to use async function pointersAndrew Kelley
closes #817
2018-03-21change async function call syntaxAndrew Kelley
* instead of `async(allocator) call()`, now it is `async<allocator> call()`. * Fixes syntax ambiguity when leaving off the allocator * Fixes parse failure when call is a field access This sets a precedent for using `<` to pass arguments to a keyword. This will affect `enum`, `union`, and `fn` (see #661)
2018-03-07Ast Render no longer outputs erroneous semicolonJimmi Holst Christensen
closes #813
2018-03-06var is no longer a pseudo-type, it is syntaxAndrew Kelley
closes #779
2018-02-28implement coroutine resumeAndrew Kelley
2018-02-26parse await and suspend syntaxAndrew Kelley
See #727
2018-02-21implement IR analysis for async function callsAndrew Kelley
See #727
2018-02-20parse async fn definitionsAndrew Kelley
See #727
2018-02-20parse async fn calls and cancel expressionsAndrew Kelley
2018-02-08syntax: parse `?error!i32` as `?(error!i32)`Andrew Kelley
2018-02-03*WIP* error sets - support fns called at comptimeAndrew Kelley
2018-02-02*WIP* error sets - correctly resolve inferred error setsAndrew Kelley
2018-01-31*WIP* error sets converting std libAndrew Kelley
2018-01-31*WIP* error setsAndrew Kelley
2018-01-25syntax: functions require return type. remove `->`Andrew Kelley
The purpose of this is: * Only one way to do things * Changing a function with void return type to return a possible error becomes a 1 character change, subtly encouraging people to use errors. See #632 Here are some imperfect sed commands for performing this update: remove arrow: ``` sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig") ``` add void: ``` sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig") ``` Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-23replace %defer with errdeferAndrew Kelley
See #632 now we have 1 less sigil
2018-01-22add new kind of test: generating .h files. and moreAndrew Kelley
* docgen supports obj_err code kind for demonstrating errors without explicit test cases * add documentation for `extern enum`. See #367 * remove coldcc keyword and add @setIsCold. See #661 * add compile errors for non-extern struct, enum, unions in function signatures * add .h file generation for extern struct, enum, unions
2018-01-09remove %% prefix operatorAndrew Kelley
See #632 closes #545 closes #510 this makes #651 higher priority