[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 06/255: passing all tests
From: |
Eric Schulte |
Subject: |
[elpa] 06/255: passing all tests |
Date: |
Sun, 16 Mar 2014 01:02:08 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 5cb84444831cf1c4b323cf4c8ed8af48b1a02989
Author: Eric Schulte <address@hidden>
Date: Tue May 15 07:25:19 2012 -0400
passing all tests
---
sgf.el | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/sgf.el b/sgf.el
index d9e42ba..39683e9 100644
--- a/sgf.el
+++ b/sgf.el
@@ -61,15 +61,18 @@
(nreverse res))))
(def-edebug-spec parse-many (regexp string body))
-(defvar prop-val-re
+(defvar parse-prop-val-re
"\\[\\(.*?[^\\]\\)\\]")
(defvar parse-prop-re
- (format "[[:space:]]*\\([[:alpha:]]+\\(%s\\)+\\)" prop-val-re))
+ (format "[[:space:]]*\\([[:alpha:]]+\\(%s\\)+\\)" parse-prop-val-re))
(defvar parse-node-re
(format "[[:space:]]*;\\(%s\\)+" parse-prop-re))
+(defvar parse-tree-part-re
+ (format "[[:space:]]*(\\(%s\\)[[:space:]]*\\([()]\\)" parse-node-re))
+
(defun parse-prop-ident (str)
(let ((end (if (and (<= ?A (aref str 1))
(< (aref str 1) ?Z))
@@ -78,9 +81,13 @@
(substring str end))))
(defun parse-prop-vals (str)
- (parse-many parse-prop-re str
+ (parse-many parse-prop-val-re str
(collect (match-string 1 str))))
+(defun parse-prop (str)
+ (multiple-value-bind (id rest) (parse-prop-ident str)
+ (cons id (parse-prop-vals rest))))
+
(defun parse-props (str)
(parse-many parse-prop-re str
(multiple-value-bind (id rest) (parse-prop-ident (match-string 1 str))
- [elpa] branch go created (now a5154e6), Eric Schulte, 2014/03/15
- [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 <=
- [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, 2014/03/15
- [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