@@ -286,7 +286,7 @@ const Parser = struct {
|
||||
.keyword_comptime => switch (p.token_tags[p.tok_i + 1]) {
|
||||
.l_brace => {
|
||||
if (doc_comment) |some| {
|
||||
try p.warnMsg(.{ .tag = .test_doc_comment, .token = some });
|
||||
try p.warnMsg(.{ .tag = .comptime_doc_comment, .token = some });
|
||||
}
|
||||
const comptime_token = p.nextToken();
|
||||
const block = p.parseBlock() catch |err| switch (err) {
|
||||
|
||||
@@ -4210,6 +4210,18 @@ test "zig fmt: remove newlines surrounding doc comment within container decl" {
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: invalid else branch statement" {
|
||||
try testError(
|
||||
\\/// This is a doc comment for a comptime block.
|
||||
\\comptime {}
|
||||
\\/// This is a doc comment for a test
|
||||
\\test "This is my test" {}
|
||||
, &[_]Error{
|
||||
.comptime_doc_comment,
|
||||
.test_doc_comment,
|
||||
});
|
||||
}
|
||||
|
||||
test "zig fmt: invalid else branch statement" {
|
||||
try testError(
|
||||
\\comptime {
|
||||
|
||||
Reference in New Issue
Block a user