std: add "get_quirk(key: u32) u64"

This commit is contained in:
Nigel Tao committed 2023-07-16 12:04:09 +10:00
1 parent 84d1aa0d79
commit 4dfd70928b
20 files changed
+879

No files matched your search

+14
View File
@@ -61,6 +61,20 @@ pub struct decoder? implements base.token_decoder(
stack : array[1024 / 32] base.u32,
)
pub func decoder.get_quirk(key: base.u32) base.u64 {
var key : base.u32
if args.key >= QUIRKS_BASE {
key = args.key - QUIRKS_BASE
if key < QUIRKS_COUNT {
if this.quirks[key] {
return 1
}
}
}
return 0
}
pub func decoder.set_quirk!(key: base.u32, value: base.u64) base.status {
if args.key >= QUIRKS_BASE {
args.key -= QUIRKS_BASE