[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseclj 9480ae09b3 068/185: push is destructive, in this
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseclj 9480ae09b3 068/185: push is destructive, in this case cons will do |
Date: |
Tue, 28 Dec 2021 14:05:18 -0500 (EST) |
branch: elpa/parseclj
commit 9480ae09b3ee8a5ea02d7d16c86e435f995baaa1
Author: Arne Brasseur <arne@arnebrasseur.net>
Commit: Arne Brasseur <arne@arnebrasseur.net>
push is destructive, in this case cons will do
The reducer should return the new stack, not modify the actual stack (which
in
this case just modifies the local variable before discarding it).
---
clj-ast.el | 6 +++---
clj-edn.el | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/clj-ast.el b/clj-ast.el
index 7454776621..301aacedaa 100644
--- a/clj-ast.el
+++ b/clj-ast.el
@@ -36,7 +36,7 @@
(defun clj-ast--reduce-leaf (stack token)
(if (eq (clj-lex-token-type token) :whitespace)
stack
- (push
+ (cons
(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))
@@ -54,7 +54,7 @@
(cl-case type
(:root (clj-parse--make-node :root 0 ':children children))
(:discard stack)
- (t (push
+ (t (cons
(clj-parse--make-node type pos
':children children)
stack)))))
@@ -78,7 +78,7 @@
(:vector (clj-parse--string-with-delimiters subnodes "[" "]"))
(:set (clj-parse--string-with-delimiters subnodes "#{" "}"))
(:map (clj-parse--string-with-delimiters subnodes "{" "}"))
- ;; tagged literals
+ (:tag )
))))
(provide 'clj-ast)
diff --git a/clj-edn.el b/clj-edn.el
index 34d7fcaf76..24e858eccc 100644
--- a/clj-edn.el
+++ b/clj-edn.el
@@ -44,14 +44,14 @@ 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)))
+ (cons (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
+ (cons
(cl-case token-type
(:lparen children)
(:lbracket (apply #'vector children))
- [nongnu] elpa/parseclj 517a371616 166/185: Use map-elt instead of parseclj-alist-get, (continued)
- [nongnu] elpa/parseclj 517a371616 166/185: Use map-elt instead of parseclj-alist-get, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj ba04dbe334 171/185: Remove remaining a-list call, move a.el to be test-only, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 48abe456c6 155/185: Update the installation instructions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj b234692020 157/185: error on unmatched closing paren/brace, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 1bb3800f8f 162/185: Update CHANGELOG, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj fcebf65075 180/185: Provide parseclj-alist-merge for older Emacsen, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj eff9411268 161/185: Merge pull request #26 from ikappaki/master, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 689ebddbdd 158/185: Add support for shebang and symbolic values, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 1e46607912 015/185: Split files into packages, More test setup, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj a9dba19760 086/185: Clean up node and token types, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 9480ae09b3 068/185: push is destructive, in this case cons will do,
ELPA Syncer <=
- [nongnu] elpa/parseclj f395b9cbcc 097/185: Move `parseclj--leaf-token-value` to `parseedn` module, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 91dd43667c 110/185: Fix `parseclj-ast--reduce-branch` for tags., ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 9a586f267d 103/185: Remove `parseedn` requirement from `parseclj`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj e65eb085ad 114/185: Remove duplicated test, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 811f35e05a 117/185: Loops reduction over the first 2 elements of the stack, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 5b4b222b4f 124/185: Return error token when there's invalid input in `parseclj-lex-next`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj b26fadbc05 128/185: Get rid of `parseclj-lex-error-token` side-effect, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 2ffadc6239 134/185: Mark OPTIONS as unused in `parseedn-reduce-leaf`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 45cd754c32 140/185: Remove parseedn files, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 3e48aa7b40 141/185: Remove mentions to parseedn in README.md, ELPA Syncer, 2021/12/28