diff options
| author | Joseph Novakovich <josephnovakovich@gmail.com> | 2021-07-31 12:08:09 -0400 |
|---|---|---|
| committer | Joseph Novakovich <josephnovakovich@gmail.com> | 2021-07-31 12:08:09 -0400 |
| commit | ca1e78798ab515fc687f94c2d4a0cbb3402a0375 (patch) | |
| tree | 3e81d19c4fa0f52643390717a867f845e75e6a0f | |
| parent | 99789e0b9d44ecf7ee683e4954d43ee5b040132a (diff) | |
add ability to parse long algebraic promotions
| -rw-r--r-- | chess-algebraic.el | 6 |
1 files changed, 4 insertions, 2 deletions
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) |
