Skip to content

Commit

Permalink
Fix anonymous struct usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bobf authored and lukewilson2002 committed Feb 14, 2025
1 parent 9d1f4ea commit 969993c
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/zmd/tokens.zig
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,12 @@ pub const elements = [_]Element{
.{ .type = .ordered_list_item, .syntax = "1. ", .close = .linebreak, .clear = true },
};

pub const toggles = if (@hasDecl(std, "ComptimeStringMap"))
std.ComptimeStringMap(
Element,
.{
.{ "code", .{ .type = .code_close, .syntax = "`" } },
.{ "block", .{ .type = .block_close, .syntax = "```" } },
},
)
else if (@hasDecl(std, "StaticStringMap"))
std.StaticStringMap(Element).initComptime(
.{
.{ "code", .{ .type = .code_close, .syntax = "`" } },
.{ "block", .{ .type = .block_close, .syntax = "```" } },
},
)
else
unreachable;
pub const toggles = std.StaticStringMap(Element).initComptime(
.{
.{ "code", Element{ .type = .code_close, .syntax = "`" } },
.{ "block", Element{ .type = .block_close, .syntax = "```" } },
},
);

pub const formatters = [_]Element{
.{ .type = .bold, .syntax = "**", .close = .bold_close },
Expand Down

0 comments on commit 969993c

Please sign in to comment.