Skip to content

Commit

Permalink
Merge pull request #601 from mbaechler/atto-module
Browse files Browse the repository at this point in the history
Promote Atto parser as a module
  • Loading branch information
mbaechler authored Jan 17, 2025
2 parents 5acc0ca + ea71d52 commit 74cce1f
Show file tree
Hide file tree
Showing 23 changed files with 928 additions and 353 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
194 changes: 0 additions & 194 deletions bench/src/main/scala/cron4s/atto/package.scala

This file was deleted.

9 changes: 5 additions & 4 deletions bench/src/main/scala/cron4s/bench/ParserBenchmark.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package cron4s.bench

import java.util.concurrent.TimeUnit

import cron4s._

import org.openjdk.jmh.annotations._

import scala.annotation.nowarn

@State(Scope.Thread)
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.MICROSECONDS)
Expand All @@ -37,9 +37,10 @@ class ParserBenchmark {
)
var cronString: String = _

@nowarn("cat=deprecation")
@Benchmark
def parserCombinators() = parsing.parse(cronString)
def parserCombinators() = parsing.Parser.parse(cronString)

@Benchmark
def attoParser() = atto.parse(cronString)
def attoParser() = atto.Parser.parse(cronString)
}
Loading

0 comments on commit 74cce1f

Please sign in to comment.