Add string escapes to character-name table

This commit is contained in:
Lassi Kortela 2020-08-17 09:44:40 +03:00
parent 7efd5b4122
commit 414a012ea7
2 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,9 @@
(id alarm) (id alarm)
(string-escape "\\a")
(description "U+0007 [R6RS, R7RS]") (description "U+0007 [R6RS, R7RS]")
(id backspace) (id backspace)
(string-escape "\\b")
(description "U+0008 [R6RS, R7RS]") (description "U+0008 [R6RS, R7RS]")
(id delete) (id delete)
@ -14,9 +16,11 @@
(description "U+001B [R7RS]") (description "U+001B [R7RS]")
(id linefeed) (id linefeed)
(string-escape "\\n")
(description "U+000A [R6RS]") (description "U+000A [R6RS]")
(id newline) (id newline)
(string-escape "\\n")
(description "U+000A [R6RS, R7RS]") (description "U+000A [R6RS, R7RS]")
(id nul) (id nul)
@ -29,12 +33,14 @@
(description "U+000C [R6RS]") (description "U+000C [R6RS]")
(id return) (id return)
(string-escape "\\r")
(description "U+000D [R6RS, R7RS]") (description "U+000D [R6RS, R7RS]")
(id space) (id space)
(description "U+0020 [R6RS, R7RS]") (description "U+0020 [R6RS, R7RS]")
(id tab) (id tab)
(string-escape "\\t")
(description "U+0009 [R6RS, R7RS]") (description "U+0009 [R6RS, R7RS]")
(id vtab) (id vtab)

View File

@ -196,8 +196,13 @@
"character-name" "character-name"
'(p) '(p)
(tabulate (tabulate
'("ID" "Description") '("ID" "Escape" "Description")
(map the-usual (sort-by-id (group-file 'id "character-name.scm")))))) (map (lambda (entry)
(cons (assoc? 'class entry)
`((code ,(symbol->string (assoc1 'id entry)))
(code ,(or (assoc? 'string-escape entry) ""))
,(assoc1 'description entry))))
(sort-by-id (group-file 'id "character-name.scm"))))))
(define (hash-syntax) (define (hash-syntax)
(registry (registry