From b24315b28140dac7cf10828394ff347c4ad3e985 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 15 Apr 2002 02:07:36 +0000 Subject: *** no comment *** --- chess-pgn.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'chess-pgn.el') 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 -- cgit v1.2.3