fix infinite loop with invalid comptime

This commit is contained in:
Vexu
2020-05-16 19:23:59 +03:00
parent 5ac684ec50
commit 081ffe24cf
3 changed files with 18 additions and 0 deletions

View File

@@ -231,6 +231,12 @@ fn parseContainerMembers(arena: *Allocator, it: *TokenIterator, tree: *Tree, top
const next = it.peek().?.id;
switch (next) {
.Eof => break,
.Keyword_comptime => {
_ = nextToken(it);
try tree.errors.push(.{
.ExpectedBlockOrField = .{ .token = it.index },
});
},
else => {
const index = it.index;
if (next == .RBrace) {