aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
AgeCommit message (Collapse)Author
2018-01-03enum tag values are expressions so no parentheses neededAndrew Kelley
2017-12-22explicitly return from blocksAndrew Kelley
instead of last statement being expression value closes #629
2017-12-20add labeled loops, labeled break, labeled continue. remove gotoAndrew Kelley
closes #346 closes #630 regression: translate-c can no longer translate switch statements. after #629 we can ressurect and modify the code to utilize arbitrarily returning from blocks.
2017-12-19bring back code that uses export and fix testsAndrew Kelley
partial revert of 1fdebc1dc4881a00766f7c2b4b2d8ee6ad6e79b6
2017-12-19export keyword works againAndrew Kelley
2017-12-19wip bring back export keywordAndrew Kelley
2017-12-18wip export rewriteAndrew Kelley
2017-12-03rework enums and unions and their relationship to each otherAndrew Kelley
* @enumTagName renamed to @tagName and it works on enums and union-enums * Remove the EnumTag type. Now there is only enum and union, and the tag type of a union is always an enum. * unions support specifying the tag enum type, and they support inferring an enum tag type. * Enums no longer support field types but they do support setting the tag values. Likewise union-enums when inferring an enum tag type support setting the tag values. * It is now an error for enums and unions to have 0 fields. * switch statements support union-enums closes #618
2017-12-02ability to set tag values of enumsAndrew Kelley
also remove support for enums with 0 values closes #305
2017-11-30ability to specify tag type of enumsAndrew Kelley
see #305
2017-09-13fix up msvc stuff to make it work on linux and macos tooAndrew Kelley
2017-09-11Add support for MSVCJonathan Marler
2017-09-05fix parseh bugsAndrew Kelley
2017-09-01c-to-zig: return statementAndrew Kelley
2017-08-30align syntax: align(4) instead of align 4Andrew Kelley
closes #37
2017-08-29introduce align keywordAndrew Kelley
* remove `@setGlobalAlign` * add align keyword for setting alignment on functions and variables. * loads and stores use alignment from pointer * memcpy, memset use alignment from pointer * add syntax for pointer alignment * slices can have volatile * add u2, i2 primitives * ignore preferred align and use abi align everywhere * back to only having alignOf builtin. preferredAlignOf is too tricky to be useful. See #432. Partial revert of e726925e802eddab53cbfd9aacbc5eefe95c356f. See #37
2017-08-14fix tokenization error pointing to wrong characterAndrew Kelley
closes #401
2017-08-09more intuitive left shift and right shift operatorsAndrew Kelley
Before: * << is left shift, not allowed to shift 1 bits out * <<% is left shift, allowed to shift 1 bits out * >> is right shift, allowed to shift 1 bits out After: * << is left shift, allowed to shift 1 bits out * >> is right shift, allowed to shift 1 bits out * @shlExact is left shift, not allowed to shift 1 bits out * @shrExact is right shift, not allowed to shift 1 bits out Closes #413
2017-07-08better bigint/bigfloat implementationAndrew Kelley
2017-06-17allow trailing commasscurest
closes #392
2017-06-14progress toward windows hello world workingAndrew Kelley
2017-05-19change slicing syntax from ... to ..Andrew Kelley
See #359
2017-05-09inline function call with builtin function instead...Andrew Kelley
...of special syntax. partially reverts 41144a8566a6fbd779403f6b69424bb640c94a7f closes #306
2017-05-04implement else on loops and break can give an expressionAndrew Kelley
closes #357
2017-05-04implement while for nullables and error unionsAndrew Kelley
See #357
2017-05-03change while syntaxAndrew Kelley
Old: ``` while (condition; expression) {} ``` New: ``` while (condition) : (expression) {} ``` This is in preparation to allow nullable and error union types as the condition. See #357
2017-05-03remove test and try expressions in favor of if expressionsAndrew Kelley
See #357
2017-04-22slicing now returns correct const-nessAndrew Kelley
also remove the ability to override constness when slicing closes #334
2017-04-21update syntax for try and nullable unwrappingAndrew Kelley
closes #285
2017-04-21remove `?return` and `?defer`Andrew Kelley
closes #309
2017-04-14comptime ({}) should not get an implicit semicolonJosh Wolfe
closes #292.
2017-04-13Merge remote-tracking branch 'origin/parser'Andrew Kelley
2017-04-13typedefpocalypseAndrew Kelley
closes #314
2017-04-12block statement lists never get fake expressionsJosh Wolfe
instead blocks have a field that encodes whether the last statement ended with a semicolon.
2017-04-13ability to inline at function callsiteAndrew Kelley
closes #306
2017-04-02fix else-if parsingJosh Wolfe
implicit semicolon rules apply recursively to the "else" clause of if and try if (a) {} else {} // implicit semicolon if (a) {} else if (a) {} // implicit semicolon if (a) {} else while (a) {} // implicit semicolon
2017-04-02defer without a block body requires a following semicolonJosh Wolfe
2017-04-02add secret void expression after defer statement if it's the last statement ↵Josh Wolfe
in a block
2017-04-02allow implicit semicolon after defer {}Josh Wolfe
2017-04-02variable declarations must be followed by semicolonJosh Wolfe
2017-04-02fix confusion in block expression parsingJosh Wolfe
closes #292 * if, try, while, for, comptime, defer are "greedy" with {} blocks, meaning if their bodies are blocks, then no suffix operator is allowed after the block. The {} block gets "built into" the containing statement, like the body of a switch statement. * the Expression syntactic element is no longer "greedy" with {} blocks, meaning it's possible to have suffix operators after {} blocks without needing the {} block to be an rhs operand first.
2017-04-02Require top-level-declaration comptime use {}Josh Wolfe
This forbids `comptime 1 comptime 1` at top-level scope.
2017-03-31clean up analysis of {blocks}Josh Wolfe
* Don't insert void statements all over the place. {} now stays as {} instead of {{}}, and {;} becomes {} instead of {{};{}}. * Ensure final statement is always the return value statement, or the block is empty. This means {label:} becomes {label:{}}.
2017-03-26replace "&&" and "||" with "and" and "or"Andrew Kelley
closes #272
2017-03-26new unreachable syntaxAndrew Kelley
* `noreturn` is the primitive type. * `unreachable` is a control flow keyword. * `@unreachable()` builtin function is deleted. closes #214
2017-03-26add comptime top level declarationAndrew Kelley
closes #255
2017-03-16introduce new test syntaxAndrew Kelley
* remove setFnTest builtin * add test "name" { ... } syntax * remove --check-unused argument. functions are always lazy now.
2017-02-07inline assembly allows clobbers with no inputAndrew Kelley
2017-02-05try expression can omit variable assignmentsAndrew Kelley
2017-02-04inline assembly supports `%=` syntaxAndrew Kelley
it outputs a number that is unique to each instance of the asm statement in the entire compilation. useful when creating local labels and referring to them multiple times in a single template that generates multiple assembler instructions