Skip to content

Commit

Permalink
ignore token if it's "+"
Browse files Browse the repository at this point in the history
  • Loading branch information
rooklift committed Oct 31, 2022
1 parent dbb722b commit bce3b73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/61_pgn_parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,15 @@ function LoadPGNRecord(o) { // This can throw!
token.reset(); // For the next round.

// The above conditional means "." can only appear as the first character.
// Strings like "..." get decomposed to a series of "." tokens since each one terminates the token in front of it.

if (s[0] === ".") {
s = s.slice(1);
s = s.slice(1); // s is now guaranteed not to start with "."
}

// Parse s.

if (s === "" || s.startsWith("$") || StringIsNumeric(s)) {
if (s === "" || s === "+" || s.startsWith("$") || StringIsNumeric(s)) {
// Useless token.
continue;
}
Expand Down

0 comments on commit bce3b73

Please sign in to comment.