key: fix evalquota for name_map

This commit is contained in:
Tim Culverhouse 2024-04-03 12:25:34 -05:00
parent 12ea1bb1e1
commit 8f53700302

View file

@ -259,7 +259,9 @@ pub const right_meta: u21 = 57452;
pub const iso_level_3_shift: u21 = 57453; pub const iso_level_3_shift: u21 = 57453;
pub const iso_level_5_shift: u21 = 57454; pub const iso_level_5_shift: u21 = 57454;
pub const name_map = std.ComptimeStringMap(u21, .{ pub const name_map = blk: {
@setEvalBranchQuota(2000);
break :blk std.ComptimeStringMap(u21, .{
// common names // common names
.{ "plus", '+' }, .{ "plus", '+' },
.{ "minus", '-' }, .{ "minus", '-' },
@ -375,7 +377,8 @@ pub const name_map = std.ComptimeStringMap(u21, .{
.{ "right_meta", right_meta }, .{ "right_meta", right_meta },
.{ "iso_level_3_shift", iso_level_3_shift }, .{ "iso_level_3_shift", iso_level_3_shift },
.{ "iso_level_5_shift", iso_level_5_shift }, .{ "iso_level_5_shift", iso_level_5_shift },
}); });
};
test "matches 'a'" { test "matches 'a'" {
const key: Key = .{ const key: Key = .{
@ -420,3 +423,7 @@ test "matches 'shift+;'" {
}; };
try testing.expect(colon.matches(':', .{})); try testing.expect(colon.matches(':', .{}));
} }
test "name_map" {
try testing.expectEqual(insert, name_map.get("insert"));
}