[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseclj 7fba1624e0 142/185: Update DESIGN.md to name diff
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseclj 7fba1624e0 142/185: Update DESIGN.md to name difference between parseclj and parseedn |
Date: |
Tue, 28 Dec 2021 14:05:29 -0500 (EST) |
branch: elpa/parseclj
commit 7fba1624e0dc9fa01ae0742f944afcb21eba58ef
Author: Daniel Barreto <daniel.barreto.n@gmail.com>
Commit: Daniel Barreto <daniel.barreto.n@gmail.com>
Update DESIGN.md to name difference between parseclj and parseedn
---
DESIGN.md | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/DESIGN.md b/DESIGN.md
index 8e5b88acef..2bf318818b 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -1,8 +1,8 @@
# parseclj Design Goals / Roadmap
-parseclj is an Emacs Lisp library for parsing Clojure code and EDN data. It
-supports several input and output formats, all powered by the same shift-reduce
-parser function.
+parseclj is an Emacs Lisp library for parsing Clojure code and [EDN
+data](https://github.com/edn-format/edn). It supports several input and output
+formats, all powered by the same shift-reduce parser function.
This documents describes the design goals for parseclj, and as such may
describe features which are not implemented yet.
@@ -39,7 +39,7 @@ On the other hand Emacs supports strings/buffers with
arbitrary encoding, on the
## Architecture
-The implementation is implemented in three parts: a lexer, a parser, and
multiple reducers.
+The implementation is implemented in three parts: a lexer, a parser, and
[multiple reducers](#multiple-reducers).
### Lexer
@@ -214,7 +214,17 @@ Unmatched closing delimiter:
In many cases it will be desirable to "fail fast", and raise an error as soon
as a syntax error is encountered. A `reduce-branch` function can do so if it
wishes by checking its input sequence for raw tokens, and raising an error if
any are present.
-## EDN vs Clojure
+## Multiple Reducers
+
+While the shift-reduce parser parses input, it reduces parsed values (leafs
tokens and collections) using "reducing functions". These functions are in
charge of giving actual meaning to the parsed data.
+
+Currently, there are two sets of reducing functions implemented: one set that
reduces parsed values to AST data structures, and another one that reduces to
Emacs Lisp values.
+
+The AST reducing functions are part of
[`parseclj`](https://github.com/clojure-emacs/parseclj), while the Emacs Lisp
reducing functions are separated into a differente package called
[`parseedn`](https://github.com/clojure-emacs/parseedn).
+
+To understand why these two set of reducing functions are separated, it's
important to look at the difference between EDN and Clojure, and also between
Emacs Lisp elements and EDN elements.
+
+### EDN vs Clojure
EDN syntax is a subset of Clojure syntax used for representing data (as
opposed to code).
@@ -223,7 +233,7 @@ Several constructs that are common in Clojure code are not
valid in EDN. This in
- quoting, syntax quoting, syntax quote splicing, etc.
- read time evaluation with `#=(,,,)`
-## Dealing with tagged literals
+### Dealing with tagged literals
EDN/Clojure syntax is extensible. Values can be prefixed with user-provided
tags, which indicates they need to be transformed after reading by a registered
handler function.
@@ -233,7 +243,7 @@ The EDN parser functions will take an optional tag handler
function. This functi
When parsing code to an AST the situation is different, here tags simply
become part of the AST, without caring about their semantics.
-## Representing EDN as Emacs Lisp values
+### Representing EDN as Emacs Lisp values
See also the section at the top regarding differences between Clojure's data
types vs those available in Emacs Lisp.
@@ -246,11 +256,11 @@ These are the choices that the edn.el library has made:
- represent characters as integers, *but* parse `\newline` `\return` `\space`
and `\tab` as the symbols `'newline` `'return` etc.
- parse `true` as `t`, `nil` and `false` as `nil`.
-### Differences with EDN.el
+#### Differences with EDN.el
At the moment the `parseedn-*` copy the parsing behavior of edn.el, *except*
that the character literals `\newline`, `\return`, `\space`, and `\tab` are
parsed to their character code (10, 13, 32, and 9 respectively), instead of to
symbols.
-## AST
+### AST
An AST (abstract syntax tree) is a tree structure made up of nodes. A node
looks like this
@@ -274,6 +284,8 @@ Non-leaf nodes contain a list of `:children`.
## Public API
+> Disclaimer: outdated information -- this API has been deprecated in favor of
[Alternative Package Layout](#alternative-package-layout), and it's only kept
here for historical purposes.
+
parseclj provides three "parse modes"
- `edn` meant for parsing data, it parses EDN to emacs lisp data
@@ -432,7 +444,7 @@ corresponding type in Emacs. `nil' and `false' form a
particularly poignant case, both are converted to `nil'.")
```
-**Package**: parseedn
+**Package**: [parseedn](https://github.com/clojure-emacs/parseedn)
- file: parseedn.el
- [nongnu] elpa/parseclj adbc0cabf5 100/185: Move `parseclj--{leaf, closing}-tokens` to `parseclj-lex` module, (continued)
- [nongnu] elpa/parseclj adbc0cabf5 100/185: Move `parseclj--{leaf, closing}-tokens` to `parseclj-lex` module, ELPA Syncer, 2021/12/28
- [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 <=
- [nongnu] elpa/parseclj 3693dd148f 145/185: Fix Cask file, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj af6102c4a8 146/185: Minor fix to README file, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 91c2ad82af 147/185: Add enough feature to be able to parse clojure.core, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj b40670a561 149/185: Add namespaced maps, fix backquote implementation, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj ff0443c27c 151/185: Add :read-one option, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 40e36c41eb 006/185: alist-get was only introduced in 25.1? :sadpanda:, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 6f36bbf6b4 009/185: Try to set up a build matrix, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj d4286f9071 010/185: Give README the right extension, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj ce7ad0e427 025/185: implement strings, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj a08b85ffa8 032/185: Implement parsing maps, ELPA Syncer, 2021/12/28