summaryrefslogtreecommitdiff
path: root/chess-pgn.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-15 02:07:36 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-15 02:07:36 +0000
commitb24315b28140dac7cf10828394ff347c4ad3e985 (patch)
tree8fa41f8fc2a953f1c9fcf8c9e11cd290299e265f /chess-pgn.el
parent7365cd3c961dece991bc67017afcc917359be69a (diff)
*** no comment ***
Diffstat (limited to 'chess-pgn.el')
-rw-r--r--chess-pgn.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/chess-pgn.el b/chess-pgn.el
index 64b1566..463ea65 100644
--- a/chess-pgn.el
+++ b/chess-pgn.el
@@ -16,9 +16,9 @@
(pgn-parse-error . "Error parsing PGN syntax")))
(defun chess-pgn-read-plies (game position &optional top-level)
- (let ((plies (list t)) prevpos done)
+ (let ((plies (list t)) prevpos)
(catch 'done
- (while (not (or done (eobp)))
+ (while (not (eobp))
(cond
((looking-at "[1-9][0-9]*\\.[. ]*")
(goto-char (match-end 0)))
@@ -37,9 +37,10 @@
(looking-at "\\(\\*\\|1-0\\|0-1\\|1/2-1/2\\)"))
(goto-char (match-end 0))
(chess-game-set-tag game "Result" (match-string-no-properties 0))
- (nconc plies (list (chess-ply-create
- (chess-ply-next-pos (car (last plies))))))
- (setq done t))
+ (unless (eq t (car (last plies)))
+ (nconc plies (list (chess-ply-create
+ (chess-ply-next-pos (car (last plies)))))))
+ (throw 'done t))
((looking-at "{")
(forward-char)
@@ -57,7 +58,7 @@
((and (not top-level)
(looking-at ")"))
(forward-char)
- (setq done t))
+ (throw 'done t))
(t
(nconc plies (list (chess-ply-create