[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseclj adbc0cabf5 100/185: Move `parseclj--{leaf, closin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseclj adbc0cabf5 100/185: Move `parseclj--{leaf, closing}-tokens` to `parseclj-lex` module |
Date: |
Tue, 28 Dec 2021 14:05:24 -0500 (EST) |
branch: elpa/parseclj
commit adbc0cabf59a4fd7d4a9d76bc18c84fe2e2f4a09
Author: Daniel Barreto <daniel.barreto.n@gmail.com>
Commit: Daniel Barreto <daniel.barreto.n@gmail.com>
Move `parseclj--{leaf,closing}-tokens` to `parseclj-lex` module
---
parseclj-ast.el | 5 +++--
parseclj-lex.el | 24 +++++++++++++++++++++---
parseclj.el | 17 -----------------
3 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/parseclj-ast.el b/parseclj-ast.el
index 873bb49648..190c3e6a75 100644
--- a/parseclj-ast.el
+++ b/parseclj-ast.el
@@ -27,6 +27,7 @@
;;; Code:
+(require 'parseclj-lex)
(require 'parseedn)
;; AST helper functions
@@ -48,11 +49,11 @@ Other ATTRIBUTES can be given as a flat list of key-value
pairs."
(defun parseclj-ast-leaf-node? (node)
"Return t if the given ast NODE is a leaf node."
- (member (parseclj-ast-node-type node) parseclj--leaf-tokens))
+ (member (parseclj-ast-node-type node) parseclj-lex--leaf-tokens))
;; Parse/reduce strategy functions
-(defun parseclj-ast--reduce-leaf (stack token options)
+(defun parseclj-ast--reduce-leaf (stack token &optional options)
"Put into the STACK an AST leaf node based on TOKEN.
Ignores white spaces and comments.
diff --git a/parseclj-lex.el b/parseclj-lex.el
index df59881f67..5831933e7b 100644
--- a/parseclj-lex.el
+++ b/parseclj-lex.el
@@ -25,7 +25,25 @@
;; A reader for EDN data files and parser for Clojure source files.
-;;; Code
+;;; Code:
+
+(defvar parseclj-lex--leaf-tokens '(:whitespace
+ :comment
+ :number
+ :nil
+ :true
+ :false
+ :symbol
+ :keyword
+ :string
+ :character)
+ "Types of tokens that represent leaf nodes in the AST.")
+
+(defvar parseclj-lex--closing-tokens '(:rparen
+ :rbracket
+ :rbrace)
+ "Types of tokens that mark the end of a non-atomic form.")
+
(defun parseclj-lex-token (type form pos &rest attributes)
"Create a lexer token with the specified attributes.
@@ -53,11 +71,11 @@ A token is an association list with :token-type as its
first key. "
(defun parseclj-lex-leaf-token? (token)
"Return `t' if the given ast TOKEN is a leaf node."
- (member (parseclj-lex-token-type token) parseclj--leaf-tokens))
+ (member (parseclj-lex-token-type token) parseclj-lex--leaf-tokens))
(defun parseclj-lex-closing-token? (token)
"Return `t' if the given ast TOKEN is a closing toking."
- (member (parseclj-lex-token-type token) parseclj--closing-tokens))
+ (member (parseclj-lex-token-type token) parseclj-lex--closing-tokens))
(defun parseclj-lex-at-whitespace? ()
(let ((char (char-after (point))))
diff --git a/parseclj.el b/parseclj.el
index ef59a4153b..8d60df3b89 100644
--- a/parseclj.el
+++ b/parseclj.el
@@ -38,23 +38,6 @@
(require 'parseclj-ast)
(require 'parseclj-unparse)
-(defvar parseclj--leaf-tokens '(:whitespace
- :comment
- :number
- :nil
- :true
- :false
- :symbol
- :keyword
- :string
- :character)
- "Types of tokens that represent leaf nodes in the AST.")
-
-(defvar parseclj--closing-tokens '(:rparen
- :rbracket
- :rbrace)
- "Types of tokens that mark the end of a non-atomic form.")
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Shift-Reduce Parser
- [nongnu] elpa/parseclj 6fe4ce6095 058/185: Add script to compare speed of edn.el and clj-parse.el, (continued)
- [nongnu] elpa/parseclj 6fe4ce6095 058/185: Add script to compare speed of edn.el and clj-parse.el, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 7d70ee4c38 059/185: Add support for tagged literals, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 4367db07aa 061/185: Move tests to tests/, bench to benchmark/, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 46570ce843 060/185: A # can be part of a symbol, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj fcd1a086f6 081/185: Rename clj-ast to parseclj-ast, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 987bd16a57 089/185: Position starts at 1, not at 0 (just like (point)), ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 313fc4e630 077/185: Rename to parseclj, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 7f8bcd405e 095/185: Make checkdoc happy with parseclj.el, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 0f16fcf2fa 084/185: Implement parsing with lexical preservation (keep whitespace, comments), ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj ca854455f6 099/185: Add missing requirement to `parseedn`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj adbc0cabf5 100/185: Move `parseclj--{leaf, closing}-tokens` to `parseclj-lex` module,
ELPA Syncer <=
- [nongnu] elpa/parseclj 7794d9ee59 101/185: Add docstrings for `parseclj-lex` module, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 296a093132 102/185: Remove `parseclj-unparse`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj d6525d30c6 111/185: Merge pull request #10 from lambdaisland/fix-ast-reduce-tag, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 0ef32ad912 120/185: Add support for having single quotes in symbols/keywords, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 0afb8c5f09 123/185: Add `parseclj-lex-error-token` helper, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj b2588ce0fb 126/185: Use EVM to setup Travis CI, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 46cfcd3120 129/185: Merge pull request #16 from lambdaisland/parseclj-lex-error-token, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 61577603f2 136/185: Update README.md with installation and usage information, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj a82f229014 139/185: Ignore *.elc files, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 7fba1624e0 142/185: Update DESIGN.md to name difference between parseclj and parseedn, ELPA Syncer, 2021/12/28