key: fix evalquota for name_map
This commit is contained in:
parent
12ea1bb1e1
commit
8f53700302
1 changed files with 123 additions and 116 deletions
11
src/Key.zig
11
src/Key.zig
|
@ -259,7 +259,9 @@ pub const right_meta: u21 = 57452;
|
|||
pub const iso_level_3_shift: u21 = 57453;
|
||||
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
|
||||
.{ "plus", '+' },
|
||||
.{ "minus", '-' },
|
||||
|
@ -375,7 +377,8 @@ pub const name_map = std.ComptimeStringMap(u21, .{
|
|||
.{ "right_meta", right_meta },
|
||||
.{ "iso_level_3_shift", iso_level_3_shift },
|
||||
.{ "iso_level_5_shift", iso_level_5_shift },
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
test "matches 'a'" {
|
||||
const key: Key = .{
|
||||
|
@ -420,3 +423,7 @@ test "matches 'shift+;'" {
|
|||
};
|
||||
try testing.expect(colon.matches(':', .{}));
|
||||
}
|
||||
|
||||
test "name_map" {
|
||||
try testing.expectEqual(insert, name_map.get("insert"));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue