Skip to content

Commit

Permalink
ignore NAGS in PGN parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 10, 2013
1 parent ca964b7 commit 387c12a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/scala/format/pgn/Parser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ object Parser {
val result: Parser[String] = space ~> ("*" | "1/2-1/2" | "0-1" | "1-0")

def move: Parser[San] =
(number?) ~> (castle | standard) <~ (comment?)
(number?) ~> (castle | standard) <~ (nag?) <~ (comment?)

val comment: Parser[String] = space ~> "{" ~> """[^\}]+""".r <~ "}"
def nag: Parser[String] = """[^\s]*""".r

def comment: Parser[String] = space ~> "{" ~> """[^\}]+""".r <~ "}"

def castle = (qCastle | kCastle) ~ suffixes ^^ {
case side ~ suf Castle(side) withSuffixes suf
Expand Down

0 comments on commit 387c12a

Please sign in to comment.