branch: elpa/parseclj
commit b2e97ecb57dfdfbd7bd6bd61165a5eecb5d52aac
Author: Arne Brasseur <[email protected]>
Commit: Arne Brasseur <[email protected]>
Lets try that again #travis
---
.travis.yml | 22 ++++++++++++----------
clj-parse.el | 26 ++++++++++++++++++--------
2 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 923d739ab5..e704356b7b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,19 +1,21 @@
language: generic
-env:
- - VERSION=24.3.1 EMACS=emacs PPA=ppa:ubuntu-elisp PACKAGE=emacs-snapshot
- - VERSION=25.2.2 EMACS=emacs-25.2 PPA=ppa:kelleyk/emacs PACKAGE=emacs25
- - VERSION=25.2.2 EMACS=emacs-25.2 PPA=ppa:kelleyk/emacs PACKAGE=emacs25
CLJ_PARSE_LINT=true
+dist: trusty
+# env:
+# - VERSION=24.3.1 EMACS=emacs PPA=ppa:ubuntu-elisp PACKAGE=emacs-snapshot
+# - VERSION=25.2.2 EMACS=emacs-25.2 PPA=ppa:kelleyk/emacs PACKAGE=emacs25
+# - VERSION=25.2.2 EMACS=emacs-25.2 PPA=ppa:kelleyk/emacs PACKAGE=emacs25
CLJ_PARSE_LINT=true
-matrix:
- allow_failures:
- - env: VERSION=25.2.1 EMACS=emacs-25.2 PPA=ppa:kelleyk/emacs
PACKAGE=emacs25 CLJ_PARSE_LINT=true
+# matrix:
+# allow_failures:
+# - env: VERSION=25.2.1 EMACS=emacs-25.2 PPA=ppa:kelleyk/emacs
PACKAGE=emacs25 CLJ_PARSE_LINT=true
before_install:
- - sudo add-apt-repository -y $PPA
+ # - sudo add-apt-repository -y $PPA
- sudo apt-get update -qq
- - sudo apt-get install -qq $PACKAGE
+ - sudo apt-get install -qq emacs
script:
+ - apt-cache search emacs
- $EMACS --version
- - $EMACS --version | grep $VERSION
+ # - $EMACS --version | grep $VERSION
- $EMACS -batch -l clj-parse-test-runner.el
diff --git a/clj-parse.el b/clj-parse.el
index e240610c3e..de3828e913 100644
--- a/clj-parse.el
+++ b/clj-parse.el
@@ -32,15 +32,22 @@
(require 'clj-lex)
(defun clj-parse ()
- (clj-parse* 'clj-parse-elisp-reducer))
+ (clj-parse-reduce 'clj-parse-edn-reduce1 'clj-parse-edn-reduceN))
-(defun clj-parse-elisp-reducer (type value)
+(defun clj-parse-edn-reduce1 (stack token)
+ )
+
+(defun clj-parse-edn-reduceN (stack type coll)
(cl-case type
(:whitespace :ws)
- (:number value)
- (:list value)))
+ (:number coll)
+ (:list coll)))
+
+(defun clj-parse-terminal? (token)
+ (cdr (assq ('type token)))
+ )
-(defun clj-parse* (reducer)
+(defun clj-parse-reduce (reduce1 reducer)
(let ((stack nil)
(token (clj-lex-next)))
(while (not (eq (cdr (assq 'type token)) :eof))
@@ -48,11 +55,14 @@
;; (print token)
;; (print stack)
(let-alist token
+ (setf stack
+ (if (clj-parse-terminal? token)
+ ))
(cl-case .type
(:whitespace
- (push (funcall reducer :whitespace .form) stack))
+ (push (funcall reducer stack :whitespace .form) stack))
(:number
- (push (funcall reducer :number .value) stack))
+ (push (funcall reducer stack :number .value) stack))
(:lparen
(push token stack))
(:rparen
@@ -61,7 +71,7 @@
(push (pop stack) list))
(pop stack) ;; :lparen
;; (print list)
- (push (funcall reducer :list list) stack)))))
+ (push (funcall reducer stack :list list) stack)))))
(setq token (clj-lex-next)))
stack))