[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseclj e1cb9e5514 113/185: Add a few more node accessors
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseclj e1cb9e5514 113/185: Add a few more node accessors. |
Date: |
Tue, 28 Dec 2021 14:05:26 -0500 (EST) |
branch: elpa/parseclj
commit e1cb9e551458f57f398b27f75d2e3dcaf3cd3e70
Author: Daniel Barreto <daniel.barreto.n@gmail.com>
Commit: Daniel Barreto <daniel.barreto.n@gmail.com>
Add a few more node accessors.
---
parseclj-ast.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/parseclj-ast.el b/parseclj-ast.el
index 72793fdc57..26adeced61 100644
--- a/parseclj-ast.el
+++ b/parseclj-ast.el
@@ -44,14 +44,30 @@ Other ATTRIBUTES can be given as a flat list of key-value
pairs."
(consp (car node))
(eq :node-type (caar node))))
+(defun parseclj-ast-node-attr (node attr)
+ "Return NODE's ATTR, or nil."
+ (a-get node attr))
+
(defun parseclj-ast-node-type (node)
"Return the type of the AST node NODE."
(a-get node :node-type))
+(defun parseclj-ast-children (node)
+ "Return children for the AST NODE."
+ (a-get node :children))
+
+(defun parseclj-ast-value (node)
+ "Return the value of NODE as another AST node."
+ (a-get node :value))
+
(defun parseclj-ast-leaf-node-p (node)
"Return t if the given ast NODE is a leaf node."
(member (parseclj-ast-node-type node) parseclj-lex--leaf-tokens))
+(defun parseclj-ast-branch-node-p (node)
+ "Return t if the given AST NODE is a branch node."
+ (not (parseclj-ast-leaf-node-p node)))
+
;; Parse/reduce strategy functions
- [nongnu] elpa/parseclj 47cf208a91 091/185: Fix parsing of tags/discard with :lexical-preservation, (continued)
- [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
- [nongnu] elpa/parseclj 5fbe901cba 071/185: Parse/unparse :tag, rountrip AST, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 6e0dc9516c 093/185: Add missing require, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj b79b3a5438 098/185: Add documentation to `parseclj-ast.el`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 1b071d7775 104/185: Add documentation to `parseedn` module, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj e1cb9e5514 113/185: Add a few more node accessors.,
ELPA Syncer <=
- [nongnu] elpa/parseclj 80e92cdf9f 001/185: Move into its own repo, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 2588470302 116/185: Merge pull request #9 from lambdaisland/docstrings-and-conventions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 92396d11cf 127/185: Merge pull request #17 from lambdaisland/travis-evm, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj f87278a70e 135/185: Merge pull request #18 from clojure-emacs/doc-&-style-fixes-part-2, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj eedc0d812e 168/185: Update docstring and metion Emacs 27 alternative, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 815ba87a77 137/185: Merge pull request #19 from clojure-emacs/update-readme, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 9e0b51e39c 160/185: revert tabs to spaces, address minor review comments, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj bdd6489128 003/185: add travis badge, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj f6b8ad665c 004/185: Fix .travis.yml, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 3ec632ed66 008/185: Travis show Emacs version, ELPA Syncer, 2021/12/28