From 414a012ea7795d7216ca6d80a4013b57ab4855f5 Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Mon, 17 Aug 2020 09:44:40 +0300 Subject: [PATCH] Add string escapes to character-name table --- character-name.scm | 6 ++++++ generate.scm | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/character-name.scm b/character-name.scm index 1623f5d..4f20591 100644 --- a/character-name.scm +++ b/character-name.scm @@ -1,7 +1,9 @@ (id alarm) +(string-escape "\\a") (description "U+0007 [R6RS, R7RS]") (id backspace) +(string-escape "\\b") (description "U+0008 [R6RS, R7RS]") (id delete) @@ -14,9 +16,11 @@ (description "U+001B [R7RS]") (id linefeed) +(string-escape "\\n") (description "U+000A [R6RS]") (id newline) +(string-escape "\\n") (description "U+000A [R6RS, R7RS]") (id nul) @@ -29,12 +33,14 @@ (description "U+000C [R6RS]") (id return) +(string-escape "\\r") (description "U+000D [R6RS, R7RS]") (id space) (description "U+0020 [R6RS, R7RS]") (id tab) +(string-escape "\\t") (description "U+0009 [R6RS, R7RS]") (id vtab) diff --git a/generate.scm b/generate.scm index cba9ed4..4978bd5 100644 --- a/generate.scm +++ b/generate.scm @@ -196,8 +196,13 @@ "character-name" '(p) (tabulate - '("ID" "Description") - (map the-usual (sort-by-id (group-file 'id "character-name.scm")))))) + '("ID" "Escape" "Description") + (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) (registry