Finish the major refactoring.
This commit is contained in:
parent
0c6b421bc5
commit
785d4bd411
3 changed files with 21 additions and 3 deletions
2
Makefile
2
Makefile
|
@ -198,7 +198,7 @@ member-parser.import.scm: $(MEMBER-PARSER-SOURCES)
|
||||||
|
|
||||||
MEMBER-PRINT-SOURCES=member-print.scm dictionary.import.scm \
|
MEMBER-PRINT-SOURCES=member-print.scm dictionary.import.scm \
|
||||||
member-record.import.scm month.import.scm utils.import.scm \
|
member-record.import.scm month.import.scm utils.import.scm \
|
||||||
table.import.scm
|
table.import.scm listing.import.scm ansi.import.scm
|
||||||
|
|
||||||
member-print.so: member-print.o
|
member-print.so: member-print.o
|
||||||
member-print.o: member-print.import.scm
|
member-print.o: member-print.import.scm
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
(
|
(
|
||||||
print-member-info
|
print-member-info
|
||||||
print-member-table
|
print-member-table
|
||||||
|
print-member-source
|
||||||
)
|
)
|
||||||
|
|
||||||
(import scheme
|
(import scheme
|
||||||
|
@ -42,7 +43,9 @@
|
||||||
member-record
|
member-record
|
||||||
month
|
month
|
||||||
utils
|
utils
|
||||||
table)
|
table
|
||||||
|
listing
|
||||||
|
ansi)
|
||||||
|
|
||||||
;; Prints human-readable information
|
;; Prints human-readable information
|
||||||
(define (print-member-info mr)
|
(define (print-member-info mr)
|
||||||
|
@ -116,4 +119,19 @@
|
||||||
(result (filter identity (append head body))))
|
(result (filter identity (append head body))))
|
||||||
(print (table->string result #:table-border #t #:row-border #t #:col-border #t))))
|
(print (table->string result #:table-border #t #:row-border #t #:col-border #t))))
|
||||||
|
|
||||||
|
;; Nicely prints the member source with any errors recorded.
|
||||||
|
(define (print-member-source mr)
|
||||||
|
(let* ((lines (dict-ref mr 'source mr))
|
||||||
|
(file-name (dict-ref mr 'file-name))
|
||||||
|
(hls (dict-ref mr 'highlights)))
|
||||||
|
(print file-name ":")
|
||||||
|
(print-source-listing
|
||||||
|
lines
|
||||||
|
hls
|
||||||
|
-1
|
||||||
|
a:error a:default
|
||||||
|
"" "" ; Not used
|
||||||
|
"..." ; Not used
|
||||||
|
)))
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -244,7 +244,7 @@
|
||||||
((#\I) (number->string (member-record-info mr 'id)))
|
((#\I) (number->string (member-record-info mr 'id)))
|
||||||
((#\S) (number->string (member-suspended-months mr)))
|
((#\S) (number->string (member-suspended-months mr)))
|
||||||
((#\E)
|
((#\E)
|
||||||
(let ((n (length (member-record-info mr 'highlights '()))))
|
(let ((n (length (dict-ref mr 'highlights '()))))
|
||||||
(if (<= n 2)
|
(if (<= n 2)
|
||||||
""
|
""
|
||||||
(sprintf "[~A]" (- n 2)))))
|
(sprintf "[~A]" (- n 2)))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue