Skip to content

Commit

Permalink
expect up to 2 trap binlog lines in combat
Browse files Browse the repository at this point in the history
  • Loading branch information
samualtnorman committed Jan 8, 2025
1 parent e0531c5 commit 7e250d3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/parseBinlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,16 @@ export function* parseBinlog(binlog: string[]): Generator<BinlogEntry, void, und

binlog.shift()

if (binlog[0][7] == `@`) {
assert(
/^`n--` [ad]@ \/ (?:[2-9a@*?>][&%+!^#] )+x[a0-5]$/.test(binlog[0]),
() => `${HERE} ${JSON.stringify(binlog[0])}`
)
for (let times = 2; times--;) {
if (binlog[0][7] == `@`) {
assert(
/^`n--` [ad]@ \/ (?:[2-9a@*?>][&%+!^#] )+x[a0-5]$/.test(binlog[0]),
() => `${HERE} ${JSON.stringify(binlog[0])}`
)

binlog.shift()
assert(binlog[0], HERE)
binlog.shift()
assert(binlog[0], HERE)
}
}

for (let times = 2; times--;) {
Expand Down

0 comments on commit 7e250d3

Please sign in to comment.