authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-07-11 20:35:00+03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-12 07:35:34+00:00
logbfe9d4184fb9b4d0cfd0964f18bb3789f3023939
tree5f945985b4cf4df78e1bd86831eb3545bbe8eaaf
parentfe08a4d0654b4d73b78f65cf1a31a037002e2243

fix alignment parsing in stage1


2 files changed, 2 insertions(+), 2 deletions(-)

src/parser.cpp+1-1
...@@ -2679,7 +2679,7 @@ static AstNode *ast_parse_prefix_type_op(ParseContext *pc) {...@@ -2679,7 +2679,7 @@ static AstNode *ast_parse_prefix_type_op(ParseContext *pc) {
26792679
2680 if (eat_token_if(pc, TokenIdKeywordAlign) != nullptr) {2680 if (eat_token_if(pc, TokenIdKeywordAlign) != nullptr) {
2681 expect_token(pc, TokenIdLParen);2681 expect_token(pc, TokenIdLParen);
2682 AstNode *align_expr = ast_parse_expr(pc);2682 AstNode *align_expr = ast_expect(pc, ast_parse_expr);
2683 child->data.pointer_type.align_expr = align_expr;2683 child->data.pointer_type.align_expr = align_expr;
2684 if (eat_token_if(pc, TokenIdColon) != nullptr) {2684 if (eat_token_if(pc, TokenIdColon) != nullptr) {
2685 Token *bit_offset_start = expect_token(pc, TokenIdIntLiteral);2685 Token *bit_offset_start = expect_token(pc, TokenIdIntLiteral);
test/stage1/behavior/eval.zig+1-1
...@@ -758,7 +758,7 @@ test "comptime bitwise operators" {...@@ -758,7 +758,7 @@ test "comptime bitwise operators" {
758test "*align(1) u16 is the same as *align(1:0:2) u16" {758test "*align(1) u16 is the same as *align(1:0:2) u16" {
759 comptime {759 comptime {
760 expect(*align(1:0:2) u16 == *align(1) u16);760 expect(*align(1:0:2) u16 == *align(1) u16);
761 expect(*align(:0:2) u16 == *u16);761 expect(*align(2:0:2) u16 == *u16);
762 }762 }
763}763}
764764