[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseclj 987bd16a57 089/185: Position starts at 1, not at
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseclj 987bd16a57 089/185: Position starts at 1, not at 0 (just like (point)) |
Date: |
Tue, 28 Dec 2021 14:05:21 -0500 (EST) |
branch: elpa/parseclj
commit 987bd16a575c59bf7ed2b3e7476267781fab18ff
Author: Arne Brasseur <arne@arnebrasseur.net>
Commit: Arne Brasseur <arne@arnebrasseur.net>
Position starts at 1, not at 0 (just like (point))
---
parseclj-ast.el | 2 +-
test/parseclj-test-data.el | 32 ++++++++++++++++----------------
test/parseclj-test.el | 8 ++++----
test/parseclj-unparse-test.el | 18 +++++++++---------
4 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/parseclj-ast.el b/parseclj-ast.el
index 43a82bd6e9..88d6654820 100644
--- a/parseclj-ast.el
+++ b/parseclj-ast.el
@@ -84,7 +84,7 @@ Other ATTRIBUTES can be given as a flat list of key-value
pairs. "
(:lbrace :map)
(t type))))
(cl-case type
- (:root (cons (parseclj-ast-node :root 0 :children children) stack))
+ (:root (cons (parseclj-ast-node :root pos :children children) stack))
(:discard stack)
(:tag (list (parseclj-ast-node :tag
pos
diff --git a/test/parseclj-test-data.el b/test/parseclj-test-data.el
index a584b350d4..8ec8a000b6 100644
--- a/test/parseclj-test-data.el
+++ b/test/parseclj-test-data.el
@@ -36,7 +36,7 @@
:source "(1 2 3)"
:edn '((1 2 3))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :number)
@@ -58,7 +58,7 @@
:source "()"
:edn '(())
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . nil))))))
@@ -69,7 +69,7 @@
:source "(1)"
:edn '((1))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :number)
@@ -82,7 +82,7 @@
:source "(nil true false hello-world)"
:edn '((nil t nil hello-world))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :nil)
@@ -108,7 +108,7 @@
:source "clojure.string/join"
:edn '(clojure.string/join)
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :symbol)
(:position . 1)
(:form . "clojure.string/join")
@@ -119,7 +119,7 @@
:source "((.9 abc (true) (hello)))"
:edn '(((0.9 abc (t) (hello))))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :list)
@@ -151,7 +151,7 @@
:source "\"abc hello \\t\\\"x\""
:edn '("abc hello \t\"x")
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :string)
(:position . 1)
(:form . "\"abc hello \\t\\\"x\"")
@@ -162,7 +162,7 @@
:source "(\"---\\f---\\\"-'\\'-\\\\-\\r\\n\")"
:edn '(("---\f---\"-''-\\-\r\n"))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :string)
@@ -175,7 +175,7 @@
:source "(\\newline \\return \\space \\tab \\a \\b \\c \\u0078 \\o171)"
:edn '((?\n ?\r ?\ ?\t ?a ?b ?c ?x ?y))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :character) (:position
. 2) (:form . "\\newline") (:value . ?\n))
@@ -193,7 +193,7 @@
:source "\"\\u0078 \\o171\""
:edn '("x y")
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :string)
(:position . 1)
(:form . "\"\\u0078 \\o171\"")
@@ -205,7 +205,7 @@
:source ":foo-bar"
:edn '(:foo-bar)
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :keyword)
(:position . 1)
(:form . ":foo-bar")
@@ -217,7 +217,7 @@
:source "[123]"
:edn '([123])
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :vector)
(:position . 1)
(:children . (((:node-type . :number)
@@ -231,7 +231,7 @@
:source "{:count 123}"
:edn (list (a-hash-table :count 123))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :map)
(:position . 1)
(:children . (((:node-type . :keyword)
@@ -249,7 +249,7 @@
:source "#{:x}"
:edn '((edn-set (:x)))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :set)
(:position . 1)
(:children . (((:node-type . :keyword)
@@ -262,7 +262,7 @@
:source "(10 #_11 12 #_#_ 13 14)"
:edn '((10 12))
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :number)
@@ -279,7 +279,7 @@
(a-list
:source "#foo/bar [1]"
:ast '((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :tag)
(:position . 1)
(:tag . foo/bar)
diff --git a/test/parseclj-test.el b/test/parseclj-test.el
index 35f563c8ff..ee9eb51b66 100644
--- a/test/parseclj-test.el
+++ b/test/parseclj-test.el
@@ -34,7 +34,7 @@
(should (equal
(parseclj-parse-clojure ";; foo\nbar")
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children ((:node-type . :symbol)
(:position . 8)
(:form . "bar")
@@ -43,7 +43,7 @@
(parseclj-parse-clojure ";; foo\nbar" :lexical-preservation t)
'((:node-type . :root)
(:lexical-preservation . t)
- (:position . 0)
+ (:position . 1)
(:children ((:node-type . :comment)
(:position . 1)
(:form . ";; foo\n"))
@@ -55,7 +55,7 @@
(parseclj-parse-clojure ";; foo\n;;baz\nbar" :lexical-preservation
t)
'((:node-type . :root)
(:lexical-preservation . t)
- (:position . 0)
+ (:position . 1)
(:children ((:node-type . :comment)
(:position . 1)
(:form . ";; foo\n;;baz\n"))
@@ -122,7 +122,7 @@
(should (equal (parseclj-parse-clojure "(1 [2 {3 ( 4}])" :fail-fast nil)
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children ((:node-type . :list)
(:position . 1)
(:children ((:node-type . :number)
diff --git a/test/parseclj-unparse-test.el b/test/parseclj-unparse-test.el
index 37be1631dd..3572567e8f 100644
--- a/test/parseclj-unparse-test.el
+++ b/test/parseclj-unparse-test.el
@@ -37,7 +37,7 @@
(should (equal "(0 1 2)"
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :number)
@@ -57,7 +57,7 @@
(should (equal "()"
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . nil)))))))))
@@ -66,7 +66,7 @@
(should (equal "((.9 abc (true) (hello)))"
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :list)
@@ -96,7 +96,7 @@
(should (equal "\"abc hello \\t\\\"x\""
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :string)
(:position . 1)
(:form . "\"abc hello \\t\\\"x\"")
@@ -106,7 +106,7 @@
(should (equal "(\\newline \\return \\space \\tab \\a \\b \\c \\u0078
\\o171)"
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :list)
(:position . 1)
(:children . (((:node-type . :character)
(:position . 2) (:form . "\\newline") (:value . ?\n))
@@ -124,7 +124,7 @@
(should (equal ":foo-bar"
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :keyword)
(:position . 1)
(:form . ":foo-bar")
@@ -134,7 +134,7 @@
(should (equal "[123]"
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :vector)
(:position . 1)
(:children . (((:node-type . :number)
@@ -146,7 +146,7 @@
(should (equal "{:count 123}"
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :map)
(:position . 1)
(:children . (((:node-type . :keyword)
@@ -162,7 +162,7 @@
(should (equal "#{:x}"
(parseclj-unparse-clojure-to-string
'((:node-type . :root)
- (:position . 0)
+ (:position . 1)
(:children . (((:node-type . :set)
(:position . 1)
(:children . (((:node-type . :keyword)
- [nongnu] elpa/parseclj 553f8618e1 044/185: Rework `clj-parse-deftest` macro, (continued)
- [nongnu] elpa/parseclj 553f8618e1 044/185: Rework `clj-parse-deftest` macro, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj da89bf82a3 050/185: Allow colons inside symbols, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj 81fe979450 051/185: Handle parsing of semicolon-based comments., ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj a424f87c1b 054/185: :#/# is a valid keyword. :::hello is not, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseclj f34b8460a8 055/185: Correctly parse numbers in scientific notation, ELPA Syncer, 2021/12/28
- [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 <=
- [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, 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