Returns true if there exists a line comment between any of the tokens from
start_token to end_token. This is used to determine if e.g. a
fn_proto should be wrapped and have a trailing comma inserted even if
there is none in the source.
fn hasComment(tree: Ast, start_token: Ast.TokenIndex, end_token: Ast.TokenIndex) bool
fn hasComment(tree: Ast, start_token: Ast.TokenIndex, end_token: Ast.TokenIndex) bool {
for (start_token..end_token) |i| {
const token: Ast.TokenIndex = @intCast(i);
const start = tree.tokenStart(token) + tree.tokenSlice(token).len;
const end = tree.tokenStart(token + 1);
if (mem.findScalar(u8, tree.source[start..end], '/') != null) return true;
}
return false;
}