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

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

[elpa] 13/255: splitting into sections & stubbing out parsing


From: Eric Schulte
Subject: [elpa] 13/255: splitting into sections & stubbing out parsing
Date: Sun, 16 Mar 2014 01:02:10 +0000

eschulte pushed a commit to branch go
in repository elpa.

commit a20277645d3f06fb5bd96b94cbe02f14a9ae968b
Author: Eric Schulte <address@hidden>
Date:   Tue May 15 09:26:44 2012 -0400

    splitting into sections & stubbing out parsing
---
 sgf.el |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/sgf.el b/sgf.el
index 8a66397..1888fed 100644
--- a/sgf.el
+++ b/sgf.el
@@ -70,11 +70,10 @@
 ;; - a board is just one interface into such a tree
 
 ;;; Code:
-(defun char-to-offset (char)
-  (if (< char ?a)
-      (+ 26 (- char ?A))
-    (- char ?a)))
+(require 'cl)
 
+
+;;; Parsing
 (defmacro parse-many (regexp string &rest body)
   (declare (indent 2))
   `(let (res (start 0))
@@ -140,6 +139,26 @@
     (parse-from-buffer (current-buffer))))
 
 
+;;; Processing
+(defvar sgf-property-alist nil
+  "A-list of property names and the function to interpret their values.")
+
+(defun process (raw)
+  (unless (listp raw) (error "sgf: can't process atomic sgf element."))
+  (if (listp (car raw))
+      (mapcar #'process raw)
+    (let ((func (cdr (assoc (car raw) sgf-property-alist))))
+      (if func (cons (car raw) (funcall func (cdr raw))) raw))))
+
+
+;;; Visualization
+;; - define a board format array
+;; - make buffer to show a board, and notes, etc...
+;; - keep a marker in an sgf file
+;; - write functions for building boards from sgf files (forwards and 
backwards)
+;; - sgf movement keys
+
+
 ;;; Tests
 (require 'ert)
 



reply via email to

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