Simplify a bit
This commit is contained in:
parent
4a76b5d5e9
commit
2e9ef77b32
|
@ -318,14 +318,13 @@
|
|||
(and (ignore (and (? "#") (? (or "x" "0x"))))
|
||||
hex-chars))
|
||||
|
||||
(define (str->channel str)
|
||||
(let ((v (locale-string->integer str 16)))
|
||||
(define (terminal->channel term)
|
||||
(let* ((str (second term))
|
||||
(val (locale-string->integer str 16)))
|
||||
;; If one character we act as if it was doubled
|
||||
(if (= 1 (string-length str))
|
||||
(+ v (* v 16))
|
||||
v)))
|
||||
|
||||
(define (terminal->channel t) (str->channel (second t)))
|
||||
(+ val (* val 16))
|
||||
val)))
|
||||
|
||||
(let* ((tree (peg:tree (match-pattern hex-string hex)))
|
||||
(chs (and tree (map terminal->channel tree))))
|
||||
|
|
Loading…
Reference in New Issue