diff --git a/modules/study/src/main/CommentParser.scala b/modules/study/src/main/CommentParser.scala index 27866a161a..93490b17ae 100644 --- a/modules/study/src/main/CommentParser.scala +++ b/modules/study/src/main/CommentParser.scala @@ -12,6 +12,8 @@ private[study] object CommentParser { private val arrowsRemoveRegex = """\[\%cal[\s\r\n]+((?:\w{5}[,\s]*)+)\]""".r private val clockRegex = """(?s).*\[\%clk[\s\r\n]+([\d:\.]+)\].*""".r private val clockRemoveRegex = """\[\%clk[\s\r\n]+[\d:\.]+\]""".r + private val tcecClockRegex = """(?s).*tl=([\d:\.]+).*""".r + private val tcecClockRemoveRegex = """tl=[\d:\.]+""".r case class ParsedComment( shapes: Shapes, @@ -45,6 +47,7 @@ private[study] object CommentParser { private def parseClock(comment: String): ClockAndComment = comment match { case clockRegex(str) => readCentis(str) -> clockRemoveRegex.replaceAllIn(comment, "").trim + case tcecClockRegex(str) => readCentis(str) -> tcecClockRemoveRegex.replaceAllIn(comment, "").trim case _ => None -> comment } diff --git a/modules/study/src/test/CommentParserTest.scala b/modules/study/src/test/CommentParserTest.scala index 157972b2a7..8af3726aeb 100644 --- a/modules/study/src/test/CommentParserTest.scala +++ b/modules/study/src/test/CommentParserTest.scala @@ -65,6 +65,10 @@ class CommentParserTest extends Specification { "alt format" in { C("Hello there [%clk 2:10.33] something else").clock must_== Some(Centis(783300)) } + "TCEC" in { + C("d=29, pd=Bb7, mt=00:01:01, tl=00:37:47, s=27938 kN/s, n=1701874274, pv=e4 Bb7 exf5 exf5 d5 Qf6 Rab1 Rae8 g3 Bc8 Kg2 Rxe1 Rxe1, tb=0, R50=49, wv=0.45,").clock must_== + Some(Centis(100 * 47 + 37 * 60 * 100)) + } } "parse shapes" should { "empty" in {