[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseclj f6de87fbe6 067/185: Split EDN and AST handling in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseclj f6de87fbe6 067/185: Split EDN and AST handling in separate files |
Date: |
Tue, 28 Dec 2021 14:05:18 -0500 (EST) |
branch: elpa/parseclj
commit f6de87fbe6238b7d6e73acdd8ddaa18ac91541cb
Author: Arne Brasseur <arne@arnebrasseur.net>
Commit: Arne Brasseur <arne@arnebrasseur.net>
Split EDN and AST handling in separate files
This means the top level API can look a bit different:
clj-edn-read
clj-edn-print
clj-ast-parse
clj-ast-unparse
---
benchmark/speed-comparison.el | 2 +-
clj-ast.el | 86 +++++++++++++
clj-edn.el | 88 +++++++++++++
clj-parse-test-runner.el | 2 +
clj-parse.el | 116 +-----------------
tests/clj-parse-test.el | 138 +--------------------
tests/clj-unparse-test.el | 162 ++++++++++++++++++++++++
tests/edn-el-test-suite.el | 278 +++++++++++++++++++++---------------------
8 files changed, 485 insertions(+), 387 deletions(-)
diff --git a/benchmark/speed-comparison.el b/benchmark/speed-comparison.el
index b50a405940..2529e782eb 100644
--- a/benchmark/speed-comparison.el
+++ b/benchmark/speed-comparison.el
@@ -14,7 +14,7 @@
;;(message fn)
(with-current-buffer buff
(let ((start (time-to-seconds (current-time))))
- (clj-parse-edn)
+ (clj-edn-read)
(setq clj-time (+ clj-time (- (time-to-seconds (current-time))
start))))
(goto-char 1)
(let ((start (time-to-seconds (current-time))))
diff --git a/clj-ast.el b/clj-ast.el
new file mode 100644
index 0000000000..7454776621
--- /dev/null
+++ b/clj-ast.el
@@ -0,0 +1,86 @@
+;;; clj-ast.el --- Clojure parser/unparser -*- lexical-binding:
t; -*-
+
+;; Copyright (C) 2017 Arne Brasseur
+
+;; Author: Arne Brasseur <arne@arnebrasseur.net>
+
+;; This file is not part of GNU Emacs.
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; Parse Clojure code to an AST, and unparse back to code.
+
+;;; Code:
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Parser
+
+(defun clj-parse--make-node (type position &rest kvs)
+ (apply 'a-list ':node-type type ':position position kvs))
+
+(defun clj-ast--reduce-leaf (stack token)
+ (if (eq (clj-lex-token-type token) :whitespace)
+ stack
+ (push
+ (clj-parse--make-node (clj-lex-token-type token) (a-get token 'pos)
+ ':form (a-get token 'form)
+ ':value (clj-parse--leaf-token-value token))
+ stack)))
+
+(defun clj-ast--reduce-node (stack opener-token children)
+ (let* ((pos (a-get opener-token 'pos))
+ (type (cl-case (clj-lex-token-type opener-token)
+ (:root :root)
+ (:lparen :list)
+ (:lbracket :vector)
+ (:set :set)
+ (:lbrace :map)
+ (:discard :discard))))
+ (cl-case type
+ (:root (clj-parse--make-node :root 0 ':children children))
+ (:discard stack)
+ (t (push
+ (clj-parse--make-node type pos
+ ':children children)
+ stack)))))
+
+(defun clj-ast-parse ()
+ (clj-parse-reduce #'clj-ast--reduce-leaf #'clj-ast--reduce-node))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Unparser
+
+(defun clj-parse--string-with-delimiters (nodes ld rd)
+ (concat ld (mapconcat #'clj-ast-unparse nodes " ") rd))
+
+(defun clj-ast-unparse (node)
+ (if (clj-parse--is-leaf? node)
+ (alist-get ':form node)
+ (let ((subnodes (alist-get ':children node)))
+ (cl-case (a-get node ':node-type)
+ (:root (clj-parse--string-with-delimiters subnodes "" ""))
+ (:list (clj-parse--string-with-delimiters subnodes "(" ")"))
+ (:vector (clj-parse--string-with-delimiters subnodes "[" "]"))
+ (:set (clj-parse--string-with-delimiters subnodes "#{" "}"))
+ (:map (clj-parse--string-with-delimiters subnodes "{" "}"))
+ ;; tagged literals
+ ))))
+
+(provide 'clj-ast)
+
+;;; clj-ast.el ends here
diff --git a/clj-edn.el b/clj-edn.el
new file mode 100644
index 0000000000..34d7fcaf76
--- /dev/null
+++ b/clj-edn.el
@@ -0,0 +1,88 @@
+;;; clj-edn.el --- EDN reader/writer -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017 Arne Brasseur
+
+;; Author: Arne Brasseur <arne@arnebrasseur.net>
+
+;; This file is not part of GNU Emacs.
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; The EDN <-> Elisp reader and printer
+
+;;; Code:
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Reader
+
+(defvar clj-edn-default-tag-readers
+ (a-list 'inst (lambda (s)
+ (cl-list* 'edn-inst (date-to-time s)))
+ 'uuid (lambda (s)
+ (list 'edn-uuid s)))
+ "Default reader functions for handling tagged literals in EDN.
+These are the ones defined in the EDN spec, #inst and #uuid. It
+is not recommended you change this variable, as this globally
+changes the behavior of the EDN reader. Instead pass your own
+handlers as an optional argument to the reader functions.")
+
+(defun clj-edn-reduce-leaf (stack token)
+ (if (member (clj-lex-token-type token) (list :whitespace :comment))
+ stack
+ (push (clj-parse--leaf-token-value token) stack)))
+
+(defun clj-edn-reduce-node (tag-readers)
+ (lambda (stack opener-token children)
+ (let ((token-type (clj-lex-token-type opener-token)))
+ (if (member token-type '(:root :discard))
+ stack
+ (push
+ (cl-case token-type
+ (:lparen children)
+ (:lbracket (apply #'vector children))
+ (:set (list 'edn-set children))
+ (:lbrace (let* ((kvs (seq-partition children 2))
+ (hash-map (make-hash-table :test 'equal :size
(length kvs))))
+ (seq-do (lambda (pair)
+ (puthash (car pair) (cadr pair) hash-map))
+ kvs)
+ hash-map))
+ (:tag (let* ((tag (intern (substring (a-get opener-token 'form) 1)))
+ (reader (a-get tag-readers tag :missing)))
+ (when (eq :missing reader)
+ (user-error "No reader for tag #%S in %S" tag (a-keys
tag-readers)))
+ (funcall reader (car children)))))
+ stack)))))
+
+(defun clj-edn-read (&optional tag-readers)
+ (clj-parse-reduce #'clj-edn-reduce-leaf
+ (clj-edn-reduce-node (a-merge clj-edn-default-tag-readers
tag-readers))))
+
+(defun clj-edn-read-str (s &optional tag-readers)
+ (with-temp-buffer
+ (insert s)
+ (goto-char 1)
+ (car (clj-edn-read tag-readers))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Printer
+
+
+(provide 'clj-edn)
+
+;;; clj-edn.el ends here
diff --git a/clj-parse-test-runner.el b/clj-parse-test-runner.el
index 4a49138c9a..e10bd27e8f 100644
--- a/clj-parse-test-runner.el
+++ b/clj-parse-test-runner.el
@@ -21,6 +21,8 @@
(setq clj-parse-load-files '("clj-parse.el"
"clj-lex.el"
+ "clj-edn.el"
+ "clj-ast.el"
"tests/clj-parse-test.el"
"tests/clj-lex-test.el"
"tests/edn-el-test-suite.el"))
diff --git a/clj-parse.el b/clj-parse.el
index c3d9a6f3e5..306d6b54e2 100644
--- a/clj-parse.el
+++ b/clj-parse.el
@@ -34,6 +34,8 @@
(require 'dash)
(require 'cl-lib)
(require 'clj-lex)
+(require 'clj-edn)
+(require 'clj-ast)
(defvar clj-parse--leaf-tokens '(:whitespace
:comment
@@ -161,120 +163,6 @@
stack))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Reducer implementations
-
-(defun clj-parse--make-node (type position &rest kvs)
- (apply 'a-list ':node-type type ':position position kvs))
-
-;; AST
-
-(defun clj-parse--ast-reduce-leaf (stack token)
- (if (eq (clj-lex-token-type token) :whitespace)
- stack
- (push
- (clj-parse--make-node (clj-lex-token-type token) (a-get token 'pos)
- ':form (a-get token 'form)
- ':value (clj-parse--leaf-token-value token))
- stack)))
-
-(defun clj-parse--ast-reduce-node (stack opener-token children)
- (let* ((pos (a-get opener-token 'pos))
- (type (cl-case (clj-lex-token-type opener-token)
- (:root :root)
- (:lparen :list)
- (:lbracket :vector)
- (:set :set)
- (:lbrace :map)
- (:discard :discard))))
- (cl-case type
- (:root (clj-parse--make-node :root 0 ':children children))
- (:discard stack)
- (t (push
- (clj-parse--make-node type pos
- ':children children)
- stack)))))
-
-(defun clj-parse-ast ()
- (clj-parse-reduce #'clj-parse--ast-reduce-leaf #'clj-parse--ast-reduce-node))
-
-; Elisp
-
-(defun clj-parse--edn-reduce-leaf (stack token)
- (if (member (clj-lex-token-type token) (list :whitespace :comment))
- stack
- (push (clj-parse--leaf-token-value token) stack)))
-
-(defun clj-parse--edn-reduce-node (tag-readers)
- (lambda (stack opener-token children)
- (let ((token-type (clj-lex-token-type opener-token)))
- (if (member token-type '(:root :discard))
- stack
- (push
- (cl-case token-type
- (:lparen children)
- (:lbracket (apply #'vector children))
- (:set (list 'edn-set children))
- (:lbrace (let* ((kvs (seq-partition children 2))
- (hash-map (make-hash-table :test 'equal :size
(length kvs))))
- (seq-do (lambda (pair)
- (puthash (car pair) (cadr pair) hash-map))
- kvs)
- hash-map))
- (:tag (let* ((tag (intern (substring (a-get opener-token 'form) 1)))
- (reader (a-get tag-readers tag :missing)))
- (when (eq :missing reader)
- (user-error "No reader for tag #%S in %S" tag (a-keys
tag-readers)))
- (funcall reader (car children)))))
- stack)))))
-
-(defvar clj-edn-default-tag-readers
- (a-list 'inst (lambda (s)
- (cl-list* 'edn-inst (date-to-time s)))
- 'uuid (lambda (s)
- (list 'edn-uuid s)))
- "Default reader functions for handling tagged literals in EDN.
-These are the ones defined in the EDN spec, #inst and #uuid. It
-is not recommended you change this variable, as this globally
-changes the behavior of the EDN reader. Instead pass your own
-handlers as an optional argument to the reader functions.")
-
-(defun clj-parse-edn (&optional tag-readers)
- (clj-parse-reduce #'clj-parse--edn-reduce-leaf
- (clj-parse--edn-reduce-node (a-merge
clj-edn-default-tag-readers tag-readers))))
-
-(defun clj-parse-edn-str (s &optional tag-readers)
- (with-temp-buffer
- (insert s)
- (goto-char 1)
- (car (clj-parse-edn tag-readers))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Printer implementations
-
-;; AST
-
-(defun clj-parse--reduce-string-leaf (leaf)
- (alist-get ':form leaf))
-
-(defun clj-parse--string-with-delimiters (nodes ld rd)
- (concat ld
- (mapconcat #'clj-parse-ast-print nodes " ")
- rd))
-
-(defun clj-parse-ast-print (node)
- (if (clj-parse--is-leaf? node)
- (clj-parse--reduce-string-leaf node)
- (let ((subnodes (alist-get ':children node)))
- (cl-case (a-get node ':node-type)
- (:root (clj-parse--string-with-delimiters subnodes "" ""))
- (:list (clj-parse--string-with-delimiters subnodes "(" ")"))
- (:vector (clj-parse--string-with-delimiters subnodes "[" "]"))
- (:set (clj-parse--string-with-delimiters subnodes "#{" "}"))
- (:map (clj-parse--string-with-delimiters subnodes "{" "}"))
- ;; tagged literals
- ))))
-
(provide 'clj-parse)
;;; clj-parse.el ends here
diff --git a/tests/clj-parse-test.el b/tests/clj-parse-test.el
index 726740b545..bfae6fa22b 100644
--- a/tests/clj-parse-test.el
+++ b/tests/clj-parse-test.el
@@ -1,4 +1,4 @@
-;;; clj-parse-test.el --- Clojure/EDN parser
+;;; clj-parse-test.el --- Clojure/EDN parser - tests
;; Copyright (C) 2017 Arne Brasseur
@@ -23,7 +23,7 @@
;;; Commentary:
-;; A reader for EDN data files and parser for Clojure source files.
+;; A reader for EDN data files and parser for Clojure source files - tests
;;; Code:
@@ -41,7 +41,9 @@
(t (equal a b))))
(defun clj-parse--deftest-mode (mode test-name test-string expected)
- (let* ((parse-fn (intern (concat "clj-parse-" mode)))
+ (let* ((parse-fn (if (equal mode "edn")
+ #'clj-edn-read
+ #'clj-ast-parse))
(test-name (intern (concat (symbol-name parse-fn) "-" (symbol-name
test-name)))))
`(ert-deftest ,test-name ()
(with-temp-buffer
@@ -269,136 +271,6 @@
(:value . 12)))))))))))
-;;; Printer modes
-;; ----------------------------------------------------------------------------
-
-(ert-deftest clj-parse-ast-print-list ()
- (should (equal "(0 1 2)"
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :list)
- (:position . 1)
- (:children .
(((:node-type . :number)
-
(:position . 2)
- (:form .
"0")
- (:value
. 0))
-
((:node-type . :number)
-
(:position . 4)
- (:form .
"1")
- (:value
. 1))
-
((:node-type . :number)
-
(:position . 6)
- (:form .
"2")
- (:value
. 2))))))))))))
-
-(ert-deftest clj-parse-ast-print-empty-list ()
- (should (equal "()"
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :list)
- (:position . 1)
- (:children .
nil)))))))))
-
-(ert-deftest clj-parse-ast-print-nested-list ()
- (should (equal "((.9 abc (true) (hello)))"
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :list)
- (:position . 1)
- (:children .
(((:node-type . :list)
-
(:position . 2)
-
(:children ((:node-type . :number)
-
(:position . 3)
-
(:form . ".9")
-
(:value . 0.9))
-
((:node-type . :symbol)
-
(:position . 6)
-
(:form . "abc")
-
(:value . abc))
-
((:node-type . :list)
-
(:position . 10)
-
(:children ((:node-type . :true)
-
(:position . 11)
-
(:form . "true")
-
(:value . t))))
-
((:node-type . :list)
-
(:position . 17)
-
(:children ((:node-type . :symbol)
-
(:position . 18)
-
(:form . "hello")
-
(:value . hello))))))))))))))))
-
-(ert-deftest clj-parse-ast-print-string ()
- (should (equal "\"abc hello \\t\\\"x\""
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :string)
- (:position . 1)
- (:form . "\"abc hello
\\t\\\"x\"")
- (:value . "abc hello
\t\"x")))))))))
-
-(ert-deftest clj-parse-ast-print-chars ()
- (should (equal "(\\newline \\return \\space \\tab \\a \\b \\c \\u0078
\\o171)"
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :list)
- (:position . 1)
- (:children .
(((:node-type . :character) (:position . 2) (:form . "\\newline") (:value .
?\n))
-
((:node-type . :character) (:position . 11) (:form . "\\return") (:value . ?\r))
-
((:node-type . :character) (:position . 19) (:form . "\\space") (:value . 32))
-
((:node-type . :character) (:position . 26) (:form . "\\tab") (:value . ?\t))
-
((:node-type . :character) (:position . 31) (:form . "\\a") (:value . ?a))
-
((:node-type . :character) (:position . 34) (:form . "\\b") (:value . ?b))
-
((:node-type . :character) (:position . 37) (:form . "\\c") (:value . ?c))
-
((:node-type . :character) (:position . 40) (:form . "\\u0078") (:value . ?x))
-
((:node-type . :character) (:position . 47) (:form . "\\o171") (:value .
?y))))))))))))
-
-(ert-deftest clj-parse-ast-print-keyword ()
- (should (equal ":foo-bar"
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :keyword)
- (:position . 1)
- (:form . ":foo-bar")
- (:value .
:foo-bar)))))))))
-
-(ert-deftest clj-parse-ast-print-vector ()
- (should (equal "[123]"
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :vector)
- (:position . 1)
- (:children .
(((:node-type . :number)
-
(:position . 2)
- (:form .
"123")
- (:value
. 123))))))))))))
-
-(ert-deftest clj-parse-ast-print-map ()
- (should (equal "{:count 123}"
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :map)
- (:position . 1)
- (:children .
(((:node-type . :keyword)
-
(:position . 2)
- (:form .
":count")
- (:value
. :count))
-
((:node-type . :number)
-
(:position . 9)
- (:form .
"123")
- (:value
. 123))))))))))))
-
-(ert-deftest clj-parse-ast-print-set ()
- (should (equal "#{:x}"
- (clj-parse-ast-print '((:node-type . :root)
- (:position . 0)
- (:children . (((:node-type . :set)
- (:position . 1)
- (:children .
(((:node-type . :keyword)
-
(:position . 3)
- (:form .
":x")
- (:value
. :x))))))))))))
-
(provide 'clj-parse-test)
;;; clj-parse-test.el ends here
diff --git a/tests/clj-unparse-test.el b/tests/clj-unparse-test.el
new file mode 100644
index 0000000000..60cf658e73
--- /dev/null
+++ b/tests/clj-unparse-test.el
@@ -0,0 +1,162 @@
+;;; clj-unparse-test.el --- Print Clojure AST back to code - tests
+
+;; Copyright (C) 2017 Arne Brasseur
+
+;; Author: Arne Brasseur <arne@arnebrasseur.net>
+
+;; This file is not part of GNU Emacs.
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; Print Clojure AST back to code - tests
+
+;;; Code:
+
+;;; Printer modes
+;; ----------------------------------------------------------------------------
+
+(ert-deftest clj-ast-unparse-list ()
+ (should (equal "(0 1 2)"
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :list)
+ (:position . 1)
+ (:children . (((:node-type
. :number)
+ (:position .
2)
+ (:form . "0")
+ (:value . 0))
+ ((:node-type
. :number)
+ (:position .
4)
+ (:form . "1")
+ (:value . 1))
+ ((:node-type
. :number)
+ (:position .
6)
+ (:form . "2")
+ (:value .
2))))))))))))
+
+(ert-deftest clj-ast-unparse-empty-list ()
+ (should (equal "()"
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :list)
+ (:position . 1)
+ (:children . nil)))))))))
+
+(ert-deftest clj-ast-unparse-nested-list ()
+ (should (equal "((.9 abc (true) (hello)))"
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :list)
+ (:position . 1)
+ (:children . (((:node-type
. :list)
+ (:position .
2)
+ (:children
((:node-type . :number)
+
(:position . 3)
+
(:form . ".9")
+
(:value . 0.9))
+
((:node-type . :symbol)
+
(:position . 6)
+
(:form . "abc")
+
(:value . abc))
+
((:node-type . :list)
+
(:position . 10)
+
(:children ((:node-type . :true)
+
(:position . 11)
+
(:form . "true")
+
(:value . t))))
+
((:node-type . :list)
+
(:position . 17)
+
(:children ((:node-type . :symbol)
+
(:position . 18)
+
(:form . "hello")
+
(:value . hello))))))))))))))))
+
+(ert-deftest clj-ast-unparse-string ()
+ (should (equal "\"abc hello \\t\\\"x\""
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :string)
+ (:position . 1)
+ (:form . "\"abc hello
\\t\\\"x\"")
+ (:value . "abc hello
\t\"x")))))))))
+
+(ert-deftest clj-ast-unparse-chars ()
+ (should (equal "(\\newline \\return \\space \\tab \\a \\b \\c \\u0078
\\o171)"
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :list)
+ (:position . 1)
+ (:children . (((:node-type
. :character) (:position . 2) (:form . "\\newline") (:value . ?\n))
+ ((:node-type
. :character) (:position . 11) (:form . "\\return") (:value . ?\r))
+ ((:node-type
. :character) (:position . 19) (:form . "\\space") (:value . 32))
+ ((:node-type
. :character) (:position . 26) (:form . "\\tab") (:value . ?\t))
+ ((:node-type
. :character) (:position . 31) (:form . "\\a") (:value . ?a))
+ ((:node-type
. :character) (:position . 34) (:form . "\\b") (:value . ?b))
+ ((:node-type
. :character) (:position . 37) (:form . "\\c") (:value . ?c))
+ ((:node-type
. :character) (:position . 40) (:form . "\\u0078") (:value . ?x))
+ ((:node-type
. :character) (:position . 47) (:form . "\\o171") (:value . ?y))))))))))))
+
+(ert-deftest clj-ast-unparse-keyword ()
+ (should (equal ":foo-bar"
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :keyword)
+ (:position . 1)
+ (:form . ":foo-bar")
+ (:value . :foo-bar)))))))))
+
+(ert-deftest clj-ast-unparse-vector ()
+ (should (equal "[123]"
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :vector)
+ (:position . 1)
+ (:children . (((:node-type
. :number)
+ (:position .
2)
+ (:form .
"123")
+ (:value .
123))))))))))))
+
+(ert-deftest clj-ast-unparse-map ()
+ (should (equal "{:count 123}"
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :map)
+ (:position . 1)
+ (:children . (((:node-type
. :keyword)
+ (:position .
2)
+ (:form .
":count")
+ (:value .
:count))
+ ((:node-type
. :number)
+ (:position .
9)
+ (:form .
"123")
+ (:value .
123))))))))))))
+
+(ert-deftest clj-ast-unparse-set ()
+ (should (equal "#{:x}"
+ (clj-ast-unparse '((:node-type . :root)
+ (:position . 0)
+ (:children . (((:node-type . :set)
+ (:position . 1)
+ (:children . (((:node-type
. :keyword)
+ (:position .
3)
+ (:form .
":x")
+ (:value .
:x))))))))))))
+
+(provide 'clj-unparse-test)
+
+;;; clj-unparse-test.el ends here
diff --git a/tests/edn-el-test-suite.el b/tests/edn-el-test-suite.el
index f2dc7e387b..8aacb168b4 100644
--- a/tests/edn-el-test-suite.el
+++ b/tests/edn-el-test-suite.el
@@ -27,126 +27,126 @@
(require 'edn)
(ert-deftest whitespace ()
- (should (null (clj-parse-edn-str "")))
- (should (null (clj-parse-edn-str " ")))
- (should (null (clj-parse-edn-str " ")))
- (should (null (clj-parse-edn-str " ")))
- (should (null (clj-parse-edn-str " ")))
- (should (null (clj-parse-edn-str ",")))
- (should (null (clj-parse-edn-str ",,,,")))
- (should (null (clj-parse-edn-str " , ,
+ (should (null (clj-edn-read-str "")))
+ (should (null (clj-edn-read-str " ")))
+ (should (null (clj-edn-read-str " ")))
+ (should (null (clj-edn-read-str " ")))
+ (should (null (clj-edn-read-str " ")))
+ (should (null (clj-edn-read-str ",")))
+ (should (null (clj-edn-read-str ",,,,")))
+ (should (null (clj-edn-read-str " , ,
")))
- (should (null (clj-parse-edn-str"
+ (should (null (clj-edn-read-str"
,, ")))
- (should (equal [a b c d] (clj-parse-edn-str "[a ,,,,,, b,,,,,c ,d]"))))
+ (should (equal [a b c d] (clj-edn-read-str "[a ,,,,,, b,,,,,c ,d]"))))
(ert-deftest symbols ()
:tags '(edn symbol)
- (should (equal 'foo (clj-parse-edn-str "foo")))
- (should (equal 'foo\. (clj-parse-edn-str "foo.")))
- (should (equal '%foo\. (clj-parse-edn-str "%foo.")))
- (should (equal 'foo/bar (clj-parse-edn-str "foo/bar")))
- (equal 'some\#sort\#of\#symbol (clj-parse-edn-str "some#sort#of#symbol"))
- (equal 'truefalse (clj-parse-edn-str "truefalse"))
- (equal 'true. (clj-parse-edn-str "true."))
- (equal '/ (clj-parse-edn-str "/"))
- (should (equal '.true (clj-parse-edn-str ".true")))
- (should (equal 'some:sort:of:symbol (clj-parse-edn-str
"some:sort:of:symbol")))
- (equal 'foo-bar (clj-parse-edn-str "foo-bar"))
- (should (equal '+some-symbol (clj-parse-edn-str "+some-symbol")))
- (should (equal '-symbol (clj-parse-edn-str "-symbol"))))
+ (should (equal 'foo (clj-edn-read-str "foo")))
+ (should (equal 'foo\. (clj-edn-read-str "foo.")))
+ (should (equal '%foo\. (clj-edn-read-str "%foo.")))
+ (should (equal 'foo/bar (clj-edn-read-str "foo/bar")))
+ (equal 'some\#sort\#of\#symbol (clj-edn-read-str "some#sort#of#symbol"))
+ (equal 'truefalse (clj-edn-read-str "truefalse"))
+ (equal 'true. (clj-edn-read-str "true."))
+ (equal '/ (clj-edn-read-str "/"))
+ (should (equal '.true (clj-edn-read-str ".true")))
+ (should (equal 'some:sort:of:symbol (clj-edn-read-str
"some:sort:of:symbol")))
+ (equal 'foo-bar (clj-edn-read-str "foo-bar"))
+ (should (equal '+some-symbol (clj-edn-read-str "+some-symbol")))
+ (should (equal '-symbol (clj-edn-read-str "-symbol"))))
(ert-deftest booleans ()
:tags '(edn boolean)
- (should (equal t (clj-parse-edn-str "true")))
- (should (equal nil (clj-parse-edn-str "false "))))
+ (should (equal t (clj-edn-read-str "true")))
+ (should (equal nil (clj-edn-read-str "false "))))
(ert-deftest characters ()
:tags '(edn characters)
- (should (equal 97 (clj-parse-edn-str "\\a")))
- (should (equal 960 (clj-parse-edn-str "\\u03C0")))
- ;;(should (equal 'newline (clj-parse-edn-str "\\newline")))
+ (should (equal 97 (clj-edn-read-str "\\a")))
+ (should (equal 960 (clj-edn-read-str "\\u03C0")))
+ ;;(should (equal 'newline (clj-edn-read-str "\\newline")))
)
(ert-deftest elision ()
:tags '(edn elision)
- (should-not (clj-parse-edn-str "#_foo"))
- (should-not (clj-parse-edn-str "#_ 123"))
- (should-not (clj-parse-edn-str "#_:foo"))
- (should-not (clj-parse-edn-str "#_ \\a"))
- (should-not (clj-parse-edn-str "#_
+ (should-not (clj-edn-read-str "#_foo"))
+ (should-not (clj-edn-read-str "#_ 123"))
+ (should-not (clj-edn-read-str "#_:foo"))
+ (should-not (clj-edn-read-str "#_ \\a"))
+ (should-not (clj-edn-read-str "#_
\"foo\""))
- (should-not (clj-parse-edn-str "#_ (1 2 3)"))
- (should (equal '(1 3) (clj-parse-edn-str "(1 #_ 2 3)")))
- (should (equal '[1 2 3 4] (clj-parse-edn-str "[1 2 #_[4 5 6] 3 4]")))
+ (should-not (clj-edn-read-str "#_ (1 2 3)"))
+ (should (equal '(1 3) (clj-edn-read-str "(1 #_ 2 3)")))
+ (should (equal '[1 2 3 4] (clj-edn-read-str "[1 2 #_[4 5 6] 3 4]")))
(should (map-equal (make-seeded-hash-table :foo :bar)
- (clj-parse-edn-str "{:foo #_elided :bar}")))
+ (clj-edn-read-str "{:foo #_elided :bar}")))
(should (equal (edn-list-to-set '(1 2 3 4))
- (clj-parse-edn-str "#{1 2 #_[1 2 3] 3 #_ (1 2) 4}")))
- (should (equal [a d] (clj-parse-edn-str "[a #_ ;we are discarding what comes
next
+ (clj-edn-read-str "#{1 2 #_[1 2 3] 3 #_ (1 2) 4}")))
+ (should (equal [a d] (clj-edn-read-str "[a #_ ;we are discarding what comes
next
c d]"))))
(ert-deftest string ()
:tags '(edn string)
- (should (equal "this is a string" (clj-parse-edn-str "\"this is a
string\"")))
+ (should (equal "this is a string" (clj-edn-read-str "\"this is a string\"")))
(should (equal "this has an escaped \"quote in it"
- (clj-parse-edn-str "\"this has an escaped \\\"quote in
it\"")))
- (should (equal "foo\tbar" (clj-parse-edn-str "\"foo\\tbar\"")))
- (should (equal "foo\nbar" (clj-parse-edn-str "\"foo\\nbar\"")))
+ (clj-edn-read-str "\"this has an escaped \\\"quote in it\"")))
+ (should (equal "foo\tbar" (clj-edn-read-str "\"foo\\tbar\"")))
+ (should (equal "foo\nbar" (clj-edn-read-str "\"foo\\nbar\"")))
(should (equal "this is a string \\ that has an escaped backslash"
- (clj-parse-edn-str "\"this is a string \\\\ that has an
escaped backslash\"")))
- (should (equal "[" (clj-parse-edn-str "\"[\""))))
+ (clj-edn-read-str "\"this is a string \\\\ that has an
escaped backslash\"")))
+ (should (equal "[" (clj-edn-read-str "\"[\""))))
(ert-deftest keywords ()
:tags '(edn keywords)
(should (equal :namespace\.of\.some\.length/keyword-name
- (clj-parse-edn-str ":namespace.of.some.length/keyword-name")))
- (should (equal :\#/\# (clj-parse-edn-str ":#/#")))
- (should (equal :\#/:a (clj-parse-edn-str ":#/:a")))
- (should (equal :\#foo (clj-parse-edn-str ":#foo"))))
+ (clj-edn-read-str ":namespace.of.some.length/keyword-name")))
+ (should (equal :\#/\# (clj-edn-read-str ":#/#")))
+ (should (equal :\#/:a (clj-edn-read-str ":#/:a")))
+ (should (equal :\#foo (clj-edn-read-str ":#foo"))))
(ert-deftest integers ()
:tags '(edn integers)
- (should (= 0 (clj-parse-edn-str "0")))
- (should (= 0 (clj-parse-edn-str "+0")))
- (should (= 0 (clj-parse-edn-str "-0")))
- (should (= 100 (clj-parse-edn-str "100")))
- (should (= -100 (clj-parse-edn-str "-100"))))
+ (should (= 0 (clj-edn-read-str "0")))
+ (should (= 0 (clj-edn-read-str "+0")))
+ (should (= 0 (clj-edn-read-str "-0")))
+ (should (= 100 (clj-edn-read-str "100")))
+ (should (= -100 (clj-edn-read-str "-100"))))
(ert-deftest floats ()
:tags '(edn floats)
- (should (= 12.32 (clj-parse-edn-str "12.32")))
- (should (= -12.32 (clj-parse-edn-str "-12.32")))
- (should (= 9923.23 (clj-parse-edn-str "+9923.23")))
- (should (= 4.5e+044 (clj-parse-edn-str "45e+43")))
- (should (= -4.5e-042 (clj-parse-edn-str "-45e-43")))
- (should (= 4.5e+044 (clj-parse-edn-str "45E+43"))))
+ (should (= 12.32 (clj-edn-read-str "12.32")))
+ (should (= -12.32 (clj-edn-read-str "-12.32")))
+ (should (= 9923.23 (clj-edn-read-str "+9923.23")))
+ (should (= 4.5e+044 (clj-edn-read-str "45e+43")))
+ (should (= -4.5e-042 (clj-edn-read-str "-45e-43")))
+ (should (= 4.5e+044 (clj-edn-read-str "45E+43"))))
(ert-deftest lists ()
:tags '(edn lists)
- (should-not (clj-parse-edn-str "()"))
- (should (equal '(1 2 3) (clj-parse-edn-str "( 1 2 3)")))
- (should (equal '(12.1 ?a foo :bar) (clj-parse-edn-str "(12.1 \\a foo
:bar)")))
- (should (equal '((:foo bar :bar 12)) (clj-parse-edn-str "( (:foo bar :bar
12))")))
+ (should-not (clj-edn-read-str "()"))
+ (should (equal '(1 2 3) (clj-edn-read-str "( 1 2 3)")))
+ (should (equal '(12.1 ?a foo :bar) (clj-edn-read-str "(12.1 \\a foo :bar)")))
+ (should (equal '((:foo bar :bar 12)) (clj-edn-read-str "( (:foo bar :bar
12))")))
(should (equal
'(defproject com\.thortech/data\.edn "0.1.0-SNAPSHOT")
- (clj-parse-edn-str "(defproject com.thortech/data.edn
\"0.1.0-SNAPSHOT\")"))))
+ (clj-edn-read-str "(defproject com.thortech/data.edn
\"0.1.0-SNAPSHOT\")"))))
(ert-deftest vectors ()
:tags '(edn vectors)
- (should (equal [] (clj-parse-edn-str "[]")))
- (should (equal [] (clj-parse-edn-str "[ ]")))
- (should (equal '[1 2 3] (clj-parse-edn-str "[ 1 2 3 ]")))
- (should (equal '[12.1 ?a foo :bar] (clj-parse-edn-str "[ 12.1 \\a foo
:bar]")))
- (should (equal '[[:foo bar :bar 12]] (clj-parse-edn-str "[[:foo bar :bar
12]]")))
+ (should (equal [] (clj-edn-read-str "[]")))
+ (should (equal [] (clj-edn-read-str "[ ]")))
+ (should (equal '[1 2 3] (clj-edn-read-str "[ 1 2 3 ]")))
+ (should (equal '[12.1 ?a foo :bar] (clj-edn-read-str "[ 12.1 \\a foo
:bar]")))
+ (should (equal '[[:foo bar :bar 12]] (clj-edn-read-str "[[:foo bar :bar
12]]")))
(should (equal '[( :foo bar :bar 12 ) "foo"]
- (clj-parse-edn-str "[(:foo bar :bar 12) \"foo\"]")))
+ (clj-edn-read-str "[(:foo bar :bar 12) \"foo\"]")))
(should (equal '[/ \. * ! _ \? $ % & = - +]
- (clj-parse-edn-str "[/ . * ! _ ? $ % & = - +]")))
+ (clj-edn-read-str "[/ . * ! _ ? $ % & = - +]")))
(should (equal
;;[99 newline return space tab]
[99 10 13 32 9]
- (clj-parse-edn-str "[\\c \\newline \\return \\space \\tab]"))))
+ (clj-edn-read-str "[\\c \\newline \\return \\space \\tab]"))))
(defun map-equal (m1 m2)
(and (and (hash-table-p m1) (hash-table-p m2))
@@ -163,32 +163,32 @@
(ert-deftest maps ()
:tags '(edn maps)
- (should (hash-table-p (clj-parse-edn-str "{ }")))
- (should (hash-table-p (clj-parse-edn-str "{}")))
+ (should (hash-table-p (clj-edn-read-str "{ }")))
+ (should (hash-table-p (clj-edn-read-str "{}")))
(should (map-equal (make-seeded-hash-table :foo :bar :baz :qux)
- (clj-parse-edn-str "{ :foo :bar :baz :qux}")))
+ (clj-edn-read-str "{ :foo :bar :baz :qux}")))
(should (map-equal (make-seeded-hash-table 1 "123" 'vector [1 2 3])
- (clj-parse-edn-str "{ 1 \"123\" vector [1 2 3]}")))
+ (clj-edn-read-str "{ 1 \"123\" vector [1 2 3]}")))
(should (map-equal (make-seeded-hash-table [1 2 3] "some numbers")
- (clj-parse-edn-str "{[1 2 3] \"some numbers\"}"))))
+ (clj-edn-read-str "{[1 2 3] \"some numbers\"}"))))
(ert-deftest sets ()
:tags '(edn sets)
- (should (edn-set-p (clj-parse-edn-str "#{}")))
- (should (edn-set-p (clj-parse-edn-str "#{ }")))
- (should (equal (edn-list-to-set '(1 2 3)) (clj-parse-edn-str "#{1 2 3}")))
- (should (equal (edn-list-to-set '(1 [1 2 3] 3)) (clj-parse-edn-str "#{1 [1 2
3] 3}"))))
+ (should (edn-set-p (clj-edn-read-str "#{}")))
+ (should (edn-set-p (clj-edn-read-str "#{ }")))
+ (should (equal (edn-list-to-set '(1 2 3)) (clj-edn-read-str "#{1 2 3}")))
+ (should (equal (edn-list-to-set '(1 [1 2 3] 3)) (clj-edn-read-str "#{1 [1 2
3] 3}"))))
(ert-deftest comment ()
:tags '(edn comments)
- (should-not (clj-parse-edn-str ";nada"))
- (should (equal 1 (clj-parse-edn-str ";; comment
+ (should-not (clj-edn-read-str ";nada"))
+ (should (equal 1 (clj-edn-read-str ";; comment
1")))
- (should (equal [1 2 3] (clj-parse-edn-str "[1 2 ;comment to eol
+ (should (equal [1 2 3] (clj-edn-read-str "[1 2 ;comment to eol
3]")))
- (should (equal '[valid more items] (clj-parse-edn-str "[valid;touching
trailing comment
+ (should (equal '[valid more items] (clj-edn-read-str "[valid;touching
trailing comment
more items]")))
- (should (equal [valid vector more vector items] (clj-parse-edn-str "[valid
vector
+ (should (equal [valid vector more vector items] (clj-edn-read-str "[valid
vector
;;comment in vector
more vector items]"))))
@@ -205,24 +205,24 @@
(ert-deftest tags ()
:tags '(edn tags)
- (should-error (clj-parse-edn-str "#my/type value"
clj-edn-test-extra-handlers))
- (should (= 1 (clj-parse-edn-str "#my/type (1 2)"
clj-edn-test-extra-handlers)))
- (should (= 2 (clj-parse-edn-str "#my/other-type {:foo :bar}"
clj-edn-test-extra-handlers))))
+ (should-error (clj-edn-read-str "#my/type value"
clj-edn-test-extra-handlers))
+ (should (= 1 (clj-edn-read-str "#my/type (1 2)"
clj-edn-test-extra-handlers)))
+ (should (= 2 (clj-edn-read-str "#my/other-type {:foo :bar}"
clj-edn-test-extra-handlers))))
(ert-deftest roundtrip ()
:tags '(edn roundtrip)
(let ((data [1 2 3 :foo (4 5) qux "quux"]))
- (should (equal data (clj-parse-edn-str (edn-print-string data))))
+ (should (equal data (clj-edn-read-str (edn-print-string data))))
(should (map-equal (make-seeded-hash-table :foo :bar)
- (clj-parse-edn-str (edn-print-string
(make-seeded-hash-table :foo :bar)))))
+ (clj-edn-read-str (edn-print-string
(make-seeded-hash-table :foo :bar)))))
(should (equal (edn-list-to-set '(1 2 3 [3 1.11]))
- (clj-parse-edn-str (edn-print-string (edn-list-to-set '(1 2
3 [3 1.11]))))))
- (should-error (clj-parse-edn-str "#myapp/Person {:first \"Fred\" :last
\"Mertz\"}"))))
+ (clj-edn-read-str (edn-print-string (edn-list-to-set '(1 2
3 [3 1.11]))))))
+ (should-error (clj-edn-read-str "#myapp/Person {:first \"Fred\" :last
\"Mertz\"}"))))
(ert-deftest inst ()
:tags '(edn inst)
(let* ((inst-str "#inst \"1985-04-12T23:20:50.52Z\"")
- (inst (clj-parse-edn-str inst-str))
+ (inst (clj-edn-read-str inst-str))
(time (date-to-time "1985-04-12T23:20:50.52Z")))
(should (edn-inst-p inst))
(should (equal time (edn-inst-to-time inst)))))
@@ -230,52 +230,52 @@
(ert-deftest uuid ()
:tags '(edn uuid)
(let* ((str "f81d4fae-7dec-11d0-a765-00a0c91e6bf6")
- (uuid (clj-parse-edn-str (concat "#uuid \"" str "\""))))
+ (uuid (clj-edn-read-str (concat "#uuid \"" str "\""))))
(should (edn-uuid-p uuid))))
;; (ert-deftest invalid-edn ()
-;; (should-error (clj-parse-edn-str "///"))
-;; (should-error (clj-parse-edn-str "~cat"))
-;; (should-error (clj-parse-edn-str "foo/bar/baz/qux/quux"))
-;; (should-error (clj-parse-edn-str "#foo/"))
-;; (should-error (clj-parse-edn-str "foo/"))
-;; (should-error (clj-parse-edn-str ":foo/"))
-;; (should-error (clj-parse-edn-str "#/foo"))
-;; (should-error (clj-parse-edn-str "/symbol"))
-;; (should-error (clj-parse-edn-str ":/foo"))
-;; (should-error (clj-parse-edn-str "+5symbol"))
-;; (should-error (clj-parse-edn-str ".\\newline"))
-;; (should-error (clj-parse-edn-str "0cat"))
-;; (should-error (clj-parse-edn-str "-4cats"))
-;; (should-error (clj-parse-edn-str ".9"))
-;; (should-error (clj-parse-edn-str ":keyword/with/too/many/slashes"))
-;; (should-error (clj-parse-edn-str ":a.b.c/"))
-;; (should-error (clj-parse-edn-str "\\itstoolong"))
-;; (should-error (clj-parse-edn-str ":#/:"))
-;; (should-error (clj-parse-edn-str "/foo//"))
-;; (should-error (clj-parse-edn-str "///foo"))
-;; (should-error (clj-parse-edn-str ":{}"))
-;; (should-error (clj-parse-edn-str "//"))
-;; (should-error (clj-parse-edn-str "##"))
-;; (should-error (clj-parse-edn-str "::"))
-;; (should-error (clj-parse-edn-str "::a"))
-;; (should-error (clj-parse-edn-str ".5symbol"))
-;; (should-error (clj-parse-edn-str "{ \"foo\""))
-;; (should-error (clj-parse-edn-str "{ \"foo\" :bar"))
-;; (should-error (clj-parse-edn-str "{"))
-;; (should-error (clj-parse-edn-str ":{"))
-;; (should-error (clj-parse-edn-str "{{"))
-;; (should-error (clj-parse-edn-str "}"))
-;; (should-error (clj-parse-edn-str ":}"))
-;; (should-error (clj-parse-edn-str "}}"))
-;; (should-error (clj-parse-edn-str "#:foo"))
-;; (should-error (clj-parse-edn-str "\\newline."))
-;; (should-error (clj-parse-edn-str "\\newline0.1"))
-;; (should-error (clj-parse-edn-str "^"))
-;; (should-error (clj-parse-edn-str ":^"))
-;; (should-error (clj-parse-edn-str "_:^"))
-;; (should-error (clj-parse-edn-str "#{{[}}"))
-;; (should-error (clj-parse-edn-str "[}"))
-;; (should-error (clj-parse-edn-str "@cat")))
+;; (should-error (clj-edn-read-str "///"))
+;; (should-error (clj-edn-read-str "~cat"))
+;; (should-error (clj-edn-read-str "foo/bar/baz/qux/quux"))
+;; (should-error (clj-edn-read-str "#foo/"))
+;; (should-error (clj-edn-read-str "foo/"))
+;; (should-error (clj-edn-read-str ":foo/"))
+;; (should-error (clj-edn-read-str "#/foo"))
+;; (should-error (clj-edn-read-str "/symbol"))
+;; (should-error (clj-edn-read-str ":/foo"))
+;; (should-error (clj-edn-read-str "+5symbol"))
+;; (should-error (clj-edn-read-str ".\\newline"))
+;; (should-error (clj-edn-read-str "0cat"))
+;; (should-error (clj-edn-read-str "-4cats"))
+;; (should-error (clj-edn-read-str ".9"))
+;; (should-error (clj-edn-read-str ":keyword/with/too/many/slashes"))
+;; (should-error (clj-edn-read-str ":a.b.c/"))
+;; (should-error (clj-edn-read-str "\\itstoolong"))
+;; (should-error (clj-edn-read-str ":#/:"))
+;; (should-error (clj-edn-read-str "/foo//"))
+;; (should-error (clj-edn-read-str "///foo"))
+;; (should-error (clj-edn-read-str ":{}"))
+;; (should-error (clj-edn-read-str "//"))
+;; (should-error (clj-edn-read-str "##"))
+;; (should-error (clj-edn-read-str "::"))
+;; (should-error (clj-edn-read-str "::a"))
+;; (should-error (clj-edn-read-str ".5symbol"))
+;; (should-error (clj-edn-read-str "{ \"foo\""))
+;; (should-error (clj-edn-read-str "{ \"foo\" :bar"))
+;; (should-error (clj-edn-read-str "{"))
+;; (should-error (clj-edn-read-str ":{"))
+;; (should-error (clj-edn-read-str "{{"))
+;; (should-error (clj-edn-read-str "}"))
+;; (should-error (clj-edn-read-str ":}"))
+;; (should-error (clj-edn-read-str "}}"))
+;; (should-error (clj-edn-read-str "#:foo"))
+;; (should-error (clj-edn-read-str "\\newline."))
+;; (should-error (clj-edn-read-str "\\newline0.1"))
+;; (should-error (clj-edn-read-str "^"))
+;; (should-error (clj-edn-read-str ":^"))
+;; (should-error (clj-edn-read-str "_:^"))
+;; (should-error (clj-edn-read-str "#{{[}}"))
+;; (should-error (clj-edn-read-str "[}"))
+;; (should-error (clj-edn-read-str "@cat")))
;;; edn-el-test-suite.el ends here
- [nongnu] elpa/parseclj ced0b91c08 029/185: "Support" namespaces symbols, (continued)
- [nongnu] elpa/parseclj ced0b91c08 029/185: "Support" namespaces symbols, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 1eef0b62c8 034/185: Support #_discard forms, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 0974b56833 035/185: Stick to non CL functions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj f8822bb43c 040/185: Add support for tags in lexer, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 43f59dcb91 043/185: Avoid dropping whitespaces, handling them while reducing, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 7733985037 047/185: DESIGN.md-related adjustments, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj c906de33a1 048/185: Rewrite all tests, and add new tests for the AST "printer", ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 697618dbb1 049/185: Merge pull request #1 from volrath/master, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj e7686c49ed 052/185: Greater parity with edn.el, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 2da47798d9 057/185: Enable more edn.el tests, document how time/uuid are stored, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj f6de87fbe6 067/185: Split EDN and AST handling in separate files,
ELPA Syncer <=
- [nongnu] elpa/parseclj d410a1530e 096/185: Add code-checking defaults to `dir-locals.el`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 3a92eafce9 079/185: Rename reduce-node to reduce-branch, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 7beff77b15 083/185: Introduce parseclj-parse-clojure, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 3d261f5d3c 072/185: Bump version of a, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 47cf208a91 091/185: Fix parsing of tags/discard with :lexical-preservation, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj da4bacb5f5 078/185: Rename parseclj-reduce to parseclj-parse, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 2a42dcb6fa 066/185: Update License info in README, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj ba9f4d723f 076/185: Document proposal for alternative package organization, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj a8e1de0d62 075/185: Merge pull request #4 from lambdaisland/edn-ast-split, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 6fdf22a553 062/185: Update license, fix dependencies, ELPA Syncer, 2021/12/28