branch: elpa/parseclj
commit 2781f0cd7fc35626c133bfd744b897a6b9ccf5b9
Author: Arne Brasseur <[email protected]>
Commit: Arne Brasseur <[email protected]>
Vocab chage: closer/opener => closing-token/opening-token
---
parseclj-ast.el | 8 ++++----
parseclj.el | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/parseclj-ast.el b/parseclj-ast.el
index afa91f8fc2..43a82bd6e9 100644
--- a/parseclj-ast.el
+++ b/parseclj-ast.el
@@ -75,9 +75,9 @@ Other ATTRIBUTES can be given as a flat list of key-value
pairs. "
stack))
(parseclj-ast--reduce-leaf stack token))))
-(defun parseclj-ast--reduce-branch (stack opener-token children)
- (let* ((pos (a-get opener-token :pos))
- (type (parseclj-lex-token-type opener-token))
+(defun parseclj-ast--reduce-branch (stack opening-token children)
+ (let* ((pos (a-get opening-token :pos))
+ (type (parseclj-lex-token-type opening-token))
(type (cl-case type
(:lparen :list)
(:lbracket :vector)
@@ -88,7 +88,7 @@ Other ATTRIBUTES can be given as a flat list of key-value
pairs. "
(:discard stack)
(:tag (list (parseclj-ast-node :tag
pos
- :tag (intern (substring (a-get
opener-token :form) 1))
+ :tag (intern (substring (a-get
opening-token :form) 1))
:children children)))
(t (cons
(parseclj-ast-node type pos :children children)
diff --git a/parseclj.el b/parseclj.el
index 1720f32fdf..6119058514 100644
--- a/parseclj.el
+++ b/parseclj.el
@@ -116,8 +116,8 @@ Takes a FORMAT string and optional ARGS to be passed to
can be handled with `condition-case'."
(signal 'parseclj-parse-error (list (apply #'format-message format args))))
-(defun parseclj--find-opener (stack closer-token)
- (cl-case (parseclj-lex-token-type closer-token)
+(defun parseclj--find-opening-token (stack closing-token)
+ (cl-case (parseclj-lex-token-type closing-token)
(:rparen :lparen)
(:rbracket :lbracket)
(:rbrace (parseclj-lex-token-type
@@ -126,15 +126,15 @@ can be handled with `condition-case'."
'(:lbrace :set)))
stack)))))
-(defun parseclj--reduce-coll (stack closer-token reduce-branch options)
+(defun parseclj--reduce-coll (stack closing-token reduce-branch options)
"Reduce collection based on the top of the stack"
- (let ((opener-type (parseclj--find-opener stack closer-token))
+ (let ((opening-token-type (parseclj--find-opening-token stack closing-token))
(fail-fast (a-get options :fail-fast t))
(coll nil))
- (while (and stack (not (eq (parseclj-lex-token-type (car stack))
opener-type)))
+ (while (and stack (not (eq (parseclj-lex-token-type (car stack))
opening-token-type)))
(push (pop stack) coll))
- (if (eq (parseclj-lex-token-type (car stack)) opener-type)
+ (if (eq (parseclj-lex-token-type (car stack)) opening-token-type)
(let ((node (pop stack)))
(when fail-fast
(when-let ((token (seq-find #'parseclj-lex-token? coll)))
@@ -145,8 +145,8 @@ can be handled with `condition-case'."
(if fail-fast
(parseclj--error "parseclj: Syntax Error at position %s, unmatched
%S"
- (a-get closer-token :pos)
- (parseclj-lex-token-type closer-token))
+ (a-get closing-token :pos)
+ (parseclj-lex-token-type closing-token))
;; Unwound the stack without finding a matching paren: return the
original stack and continue parsing
(reverse coll)))))