[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)
- [elpa] 01/255: parsing properties in SGF files, (continued)
- [elpa] 01/255: parsing properties in SGF files, Eric Schulte, 2014/03/15
- [elpa] 02/255: parse nodes, Eric Schulte, 2014/03/15
- [elpa] 04/255: parse-many macro, Eric Schulte, 2014/03/15
- [elpa] 05/255: parse-nodes, Eric Schulte, 2014/03/15
- [elpa] 03/255: parse-prop -> parse-props, Eric Schulte, 2014/03/15
- [elpa] 08/255: parsing simple trees, Eric Schulte, 2014/03/15
- [elpa] 06/255: passing all tests, Eric Schulte, 2014/03/15
- [elpa] 07/255: some fixes, Eric Schulte, 2014/03/15
- [elpa] 11/255: ignore data directory, Eric Schulte, 2014/03/15
- [elpa] 14/255: processing simple/core properties, Eric Schulte, 2014/03/15
- [elpa] 13/255: splitting into sections & stubbing out parsing,
Eric Schulte <=
- [elpa] 12/255: headers, Eric Schulte, 2014/03/15
- [elpa] 15/255: board display, Eric Schulte, 2014/03/15
- [elpa] 22/255: example sgf file generated using gcoban, Eric Schulte, 2014/03/15
- [elpa] 17/255: not using "I" as an index, Eric Schulte, 2014/03/15
- [elpa] 20/255: alright "i" *is* a valid position identifier, Eric Schulte, 2014/03/15
- [elpa] 16/255: cleaned up board printing, Eric Schulte, 2014/03/15
- [elpa] 09/255: parsing more complex trees, Eric Schulte, 2014/03/15
- [elpa] 19/255: moving games/ -> sgf-files/, Eric Schulte, 2014/03/15
- [elpa] 10/255: helper functions, Eric Schulte, 2014/03/15
- [elpa] 24/255: right and left implemented but buggy, Eric Schulte, 2014/03/15