fn eatDocComments(p: *Parse) Error!?TokenIndex p: *Parse3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355fn eatDocComments(p: *Parse) Error!?TokenIndex {
if (p.eatToken(.doc_comment)) |tok| {
var first_line = tok;
if (tok > 0 and tokensOnSameLine(p, tok - 1, tok)) {
try p.warnMsg(.{
.tag = .same_line_doc_comment,
.token = tok,
});
first_line = p.eatToken(.doc_comment) orelse return null;
}
while (p.eatToken(.doc_comment)) |_| {}
return first_line;
}
return null;
}
Skips over doc comment tokens. Returns the first one, if any.