emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 10d7726 077/271: Use custom JSON parser.


From: Jackson Ray Hamilton
Subject: [elpa] master 10d7726 077/271: Use custom JSON parser.
Date: Thu, 05 Feb 2015 18:29:54 +0000

branch: master
commit 10d77261d796ea1b90c6f7bd5924ad73f5c81c61
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Use custom JSON parser.
---
 context-coloring.el |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index ecebce6..d821f72 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -37,8 +37,6 @@
 
 ;;; Code:
 
-(require 'json)
-
 ;;; Faces
 
 (defface context-coloring-depth--1-face
@@ -224,6 +222,10 @@ buffer."
     (delete-process context-coloring-scopifier-process)
     (setq context-coloring-scopifier-process nil)))
 
+(defun context-coloring-parse-array (input)
+  "Specialized alternative JSON parser."
+  (apply 'vector (mapcar 'string-to-number (split-string (substring input 1 
-1) ","))))
+
 (defun context-coloring-scopify ()
   "Invokes the external scopifier with the current buffer's
 contents, reading the scopifier's response asynchronously and
@@ -253,7 +255,7 @@ applying a parsed list of tokens to
     (set-process-sentinel context-coloring-scopifier-process
                           (lambda (process event)
                             (when (equal "finished\n" event)
-                              (let ((tokens (json-read-from-string output)))
+                              (let ((tokens (context-coloring-parse-array 
output)))
                                 (with-current-buffer buffer
                                   (context-coloring-apply-tokens tokens))
                                 (setq context-coloring-scopifier-process nil)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]