Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote Atto parser as a module #601

Merged
merged 12 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading