branch: elpa/parseclj
commit b2550e64560b301f87d2b3b17cca329d85707c7f
Author: Daniel Barreto <[email protected]>
Commit: Daniel Barreto <[email protected]>
Add docstring for `parseclj-lex--string-value`
---
parseclj-lex.el | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/parseclj-lex.el b/parseclj-lex.el
index ea11d3f60b..2f5f8f57b4 100644
--- a/parseclj-lex.el
+++ b/parseclj-lex.el
@@ -93,11 +93,18 @@ A token is an association list with :token-type as its
first key."
;; Elisp values from tokens
(defun parseclj-lex--string-value (s)
- ""
+ "Parse an EDN string S into a regular string.
+S goes through three transformations:
+- Escaped characters in S are transformed into Elisp escaped
+ characters.
+- Unicode escaped characters are decoded into its corresponding
+ unicode character counterpart.
+- Octal escaped characters are decoded into its corresponding
+ character counterpart."
(replace-regexp-in-string
"\\\\o[0-8]\\{3\\}"
(lambda (x)
- (make-string 1 (string-to-number (substring x 2) 8) ))
+ (make-string 1 (string-to-number (substring x 2) 8)))
(replace-regexp-in-string
"\\\\u[0-9a-fA-F]\\{4\\}"
(lambda (x)
@@ -115,7 +122,7 @@ A token is an association list with :token-type as its
first key."
(substring s 1 -1)))))
(defun parseclj-lex--character-value (c)
- "Parse a EDN character C into an Emacs Lisp character."
+ "Parse an EDN character C into an Emacs Lisp character."
(let ((first-char (elt c 1)))
(cond
((equal c "\\newline") ?\n)