diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a843e56..412148e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Cron4s Change Log +## 0.8.0 + +Breaking changes: + +* In previous versions, Cron expression parsing was using [Scala Parser Combinators](https://github.com/scala/scala-parser-combinators). + Parsing is now achieved using [Atto library](https://tpolecat.github.io/atto/) by default on all targets except Native. + Both parsers should behave the same way and the API didn't change. They will be kept in sync for the time being. + In case you notice any change in behavior, please open an issue with your input. + You can always fall back to the Parser Combinator version by adding `cron4s-parserc` as a dependency of your project and + use `Cron.withParser(cron4s.parsing.Parser)` instead of `Cron` instance. + ## 0.6.1 Bug fixes diff --git a/docs/src/main/mdoc/userguide/ast.md b/docs/src/main/mdoc/userguide/ast.md index e54cd703..17b2d5a3 100644 --- a/docs/src/main/mdoc/userguide/ast.md +++ b/docs/src/main/mdoc/userguide/ast.md @@ -162,8 +162,8 @@ assert(minutesRange.implies(fixedMinute) == fixedMinute.impliedBy(minutesRange)) It's important to notice that when using either the `implies` or `impliedBy` operation, if the two nodes are not parameterized by the same field type, the code won't compile: - -```scala mdoc:fail + +```scala //mdoc:fail disabled because it breaks mdoc minutesRange.implies(eachSecond) ``` diff --git a/docs/src/main/mdoc/userguide/index.md b/docs/src/main/mdoc/userguide/index.md index b34c3be9..680f20c1 100644 --- a/docs/src/main/mdoc/userguide/index.md +++ b/docs/src/main/mdoc/userguide/index.md @@ -102,3 +102,26 @@ a `NonEmptyList` with all the validation errors that the expression had. To demo ```scala mdoc failsValidation.swap.foreach { err => err.asInstanceOf[InvalidCron].reason.toList.mkString("\n") } ``` + +## Using a specific parser implementation + +Cron4s has two parser implementation. Since 0.8.0, it uses the [Atto](https://tpolecat.github.io/atto/) implementation +by default for JS and JVM targets and [Scala Parser Combinators](https://github.com/scala/scala-parser-combinators) +for Native. + +You can choose to use the Parser Combinators version by importing cron4s-parserc + +```scala +libraryDependencies += "com.github.alonsodomin.cron4s" %%% "cron4s-parserc" % "{{site.cron4sVersion}}" +``` + +Then you need to specify the parser you want + +```scala mdoc:invisible +import scala.annotation.nowarn +``` + +```scala mdoc:silent +@nowarn("cat=deprecation") +val parser = Cron.withParser(cron4s.parsing.Parser) +``` \ No newline at end of file