Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComptimeStringMap replaced with StaticStringMap #186

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions bsp/raspberrypi/rp2040/src/hal/pio/assembler/tokenizer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ pub const Tokenizer = struct {
};
}

const directives = std.ComptimeStringMap(*const fn (*Tokenizer, u32, *?Diagnostics) TokenizeError!Token, .{
const directives = std.StaticStringMap(*const fn (*Tokenizer, u32, *?Diagnostics) TokenizeError!Token).initComptime(.{
.{ "program", get_program },
.{ "define", get_define },
.{ "origin", get_origin },
Expand Down Expand Up @@ -527,7 +527,7 @@ pub const Tokenizer = struct {

fn get_jmp(self: *Tokenizer, diags: *?Diagnostics) TokenizeError!Token.Instruction.Payload {
const Condition = Token.Instruction.Jmp.Condition;
const conditions = std.ComptimeStringMap(Condition, .{
const conditions = std.StaticStringMap(Condition).initComptime(.{
.{ "!x", .x_is_zero },
.{ "x--", .x_dec },
.{ "!y", .y_is_zero },
Expand Down Expand Up @@ -828,7 +828,7 @@ pub const Tokenizer = struct {
};
}

const instructions = std.ComptimeStringMap(*const fn (*Tokenizer, *?Diagnostics) TokenizeError!Token.Instruction.Payload, .{
const instructions = std.StaticStringMap(*const fn (*Tokenizer, *?Diagnostics) TokenizeError!Token.Instruction.Payload).initComptime(.{
.{ "nop", get_nop },
.{ "jmp", get_jmp },
.{ "wait", get_wait },
Expand Down Expand Up @@ -1588,7 +1588,7 @@ test "tokenize.instr.jmp.value" {

test "tokenize.instr.jmp.conditions" {
const Condition = Token.Instruction.Jmp.Condition;
const cases = std.ComptimeStringMap(Condition, .{
const cases = std.StaticStringMap(Condition).initComptime(.{
.{ "!x", .x_is_zero },
.{ "x--", .x_dec },
.{ "!y", .y_is_zero },
Expand Down Expand Up @@ -1762,7 +1762,7 @@ test "tokenize.instr.mov" {
}

const Operation = Token.Instruction.Mov.Operation;
const operations = std.ComptimeStringMap(Operation, .{
const operations = std.StaticStringMap(Operation).initComptime(.{
.{ "!", .invert },
.{ "~", .invert },
.{ "::", .bit_reverse },
Expand Down Expand Up @@ -1792,7 +1792,7 @@ test "tokenize.instr.irq" {
wait: bool,
};

const modes = std.ComptimeStringMap(ClearWait, .{
const modes = std.StaticStringMap(ClearWait).initComptime(.{
.{ "", .{ .clear = false, .wait = false } },
.{ "set", .{ .clear = false, .wait = false } },
.{ "nowait", .{ .clear = false, .wait = false } },
Expand Down
2 changes: 1 addition & 1 deletion tools/regz/src/regzon.zig
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn entity_type_to_string(entity_type: Database.EntityType) []const u8 {
};
}

const string_to_entity_type_map = std.ComptimeStringMap(Database.EntityType, .{
const string_to_entity_type_map = std.StaticStringMap(Database.EntityType).initComptime(.{
.{ "peripherals", .peripheral },
.{ "register_groups", .register_group },
.{ "registers", .register },
Expand Down
2 changes: 1 addition & 1 deletion tools/regz/src/svd.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Context = struct {
}
};

const svd_boolean = std.ComptimeStringMap(bool, .{
const svd_boolean = std.StaticStringMap(bool).initComptime(.{
.{ "true", true },
.{ "1", true },
.{ "false", false },
Expand Down
Loading