summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-03-19 23:04:20 +0100
committertv <tv@krebsco.de>2026-03-19 23:04:20 +0100
commit7a9ba1533ecb3e6ccdf140fbb6bcb72fddb7b06c (patch)
tree6ac8b976244535b6b770796f3e40d8c40c13a1c9
parenta77acbcc13f8eb50e1277d07cf2a10004b58af71 (diff)
drop `one` parserHEADmaster
-rw-r--r--src/Scanner.hs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/Scanner.hs b/src/Scanner.hs
index 0364dda..993793c 100644
--- a/src/Scanner.hs
+++ b/src/Scanner.hs
@@ -46,12 +46,12 @@ scanESC h =
-- XXX M-F1 and other crazy chords may cause
-- \ESC\ESC... on wu, so we just recurse here...
scanESC h
- | c == 'O' -> -- 04/15
+ | c == 'O' -> do -- 04/15
-- XXX Non-CSI SS3
-- XXX finalByte is maybe calles somehow else here, but it's
-- the same range
- one h finalByte ['O','\ESC'] >>=
- return . ScanKey . reverse
+ final <- expectChar h finalByte
+ return (ScanKey (reverse (final : ['O','\ESC'])))
| otherwise ->
return $ ScanKey ['\ESC',c]
@@ -120,11 +120,6 @@ zeroOrMore h p buf =
return buf
-one :: Handle -> (Char -> Bool) -> [Char] -> IO [Char]
-one h p buf =
- expectChar h p >>= \c -> return (c : buf)
-
-
expectChar :: Handle -> (Char -> Bool) -> IO Char
expectChar h p =
hWaitGetChar timeout h >>= \case