Basic parsing.

This commit is contained in:
Dominik Pantůček 2023-03-13 21:56:31 +01:00
parent c296d167b5
commit 8764877e40

View file

@ -43,7 +43,8 @@
listing) listing)
;; Specification of known keys for various types of parsing ;; Specification of known keys for various types of parsing
(define known-keys '(nick mail phone name born joined)) (define known-keys '(nick mail phone name born joined destroyed
mail2 ID email suspended tel)) ;; Unknown keys
(define start/stop-keys '(student suspend)) (define start/stop-keys '(student suspend))
(define multi-keys '(card desfire credit)) (define multi-keys '(card desfire credit))
@ -89,7 +90,7 @@
(lines (if (not (null? rest1)) (car rest1) #f)) (lines (if (not (null? rest1)) (car rest1) #f))
(rest2 (if (not (null? rest1)) (cdr rest1) '())) (rest2 (if (not (null? rest1)) (cdr rest1) '()))
(line-number (if (not (null? rest2)) (car rest2) #f)) (line-number (if (not (null? rest2)) (car rest2) #f))
(lc0 (irregex-replace "^[ \\t]*" l "")) (lc0 (irregex-replace "^[ \\t]*" (line-remove-comments l) ""))
(lc (irregex-replace "[ \\t]*$" lc0 ""))) (lc (irregex-replace "[ \\t]*$" lc0 "")))
(if (= (string-length lc) 0) (if (= (string-length lc) 0)
#f #f