From ca1e78798ab515fc687f94c2d4a0cbb3402a0375 Mon Sep 17 00:00:00 2001 From: Joseph Novakovich Date: Sat, 31 Jul 2021 12:08:09 -0400 Subject: add ability to parse long algebraic promotions --- chess-algebraic.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chess-algebraic.el') diff --git a/chess-algebraic.el b/chess-algebraic.el index 8fb4fa0..b27be1a 100644 --- a/chess-algebraic.el +++ b/chess-algebraic.el @@ -65,7 +65,9 @@ (group (optional (char "a-h")) (optional (char "1-8"))) (optional (group (char ?- ?x))) (group (char "a-h") (char "1-8")) - (optional (group ?= (group (char ?N ?B ?R ?Q ?K))))))) + (optional + (group (optional ?=) + (group (char ?N ?B ?R ?Q ?n ?b ?r ?q))))))) (optional (group (char ?+ ?#)))) "A regular expression that matches all possible algebraic moves. This regexp handles both long and short form.") @@ -136,7 +138,7 @@ This regexp handles both long and short form.") (list which target)))) (chess-error 'no-candidates move)))))) (when promotion - (nconc changes (list :promote (aref promotion 0)))))) + (nconc changes (list :promote (upcase (aref promotion 0))))))) (when changes (if (and trust mate) -- cgit v1.2.3