Skip to content

Commit bc9599c

Browse files
committed
resolve conflict
2 parents 8a4c6e6 + 8816125 commit bc9599c

9 files changed

Lines changed: 903 additions & 448 deletions

File tree

bench/src/main/scala/cats/parse/bench/StringInBench.scala

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ private[parse] class StringInBenchmarks {
3939

4040
var radixNode: RadixNode = _
4141

42-
var stringIn: Parser[Unit] = _
42+
var stringInV: Parser[Unit] = _
43+
44+
var stringInS: Parser[String] = _
4345

4446
var oneOf: Parser[Unit] = _
4547

@@ -60,13 +62,18 @@ private[parse] class StringInBenchmarks {
6062
}
6163

6264
radixNode = RadixNode.fromStrings(stringsToMatch)
63-
stringIn = Parser.stringIn(stringsToMatch).void
65+
stringInS = Parser.stringIn(stringsToMatch)
66+
stringInV = stringInS.void
6467
oneOf = Parser.oneOf(stringsToMatch.map(Parser.string(_)))
6568
}
6669

6770
@Benchmark
68-
def stringInParse(): Unit =
69-
inputs.foreach(stringIn.parseAll(_))
71+
def stringInVParse(): Unit =
72+
inputs.foreach(stringInV.parseAll(_))
73+
74+
@Benchmark
75+
def stringInSParse(): Unit =
76+
inputs.foreach(stringInS.parseAll(_))
7077

7178
@Benchmark
7279
def oneOfParse(): Unit =

build.sbt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,27 +136,23 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
136136
if (isScala211) Set.empty else mimaPreviousArtifacts.value
137137
},
138138
mimaBinaryIssueFilters ++= {
139+
/*
140+
* It is okay to filter anything in Impl or RadixNode which are private
141+
*/
139142
if (tlIsScala3.value)
140143
List(
141-
ProblemFilters.exclude[IncompatibleResultTypeProblem]("cats.parse.Parser#State.error"),
142-
ProblemFilters.exclude[IncompatibleMethTypeProblem]("cats.parse.Parser#State.error_="),
143-
ProblemFilters.exclude[IncompatibleMethTypeProblem]("cats.parse.RadixNode.this"),
144+
ProblemFilters.exclude[DirectMissingMethodProblem]("cats.parse.RadixNode.children"),
144145
ProblemFilters.exclude[DirectMissingMethodProblem]("cats.parse.RadixNode.fsts"),
145146
ProblemFilters.exclude[DirectMissingMethodProblem]("cats.parse.RadixNode.prefixes"),
146-
ProblemFilters.exclude[DirectMissingMethodProblem]("cats.parse.RadixNode.children"),
147147
ProblemFilters.exclude[DirectMissingMethodProblem]("cats.parse.RadixNode.word"),
148-
ProblemFilters.exclude[FinalClassProblem]("cats.parse.RadixNode")
148+
ProblemFilters.exclude[FinalClassProblem]("cats.parse.RadixNode"),
149+
ProblemFilters.exclude[IncompatibleMethTypeProblem]("cats.parse.Parser#State.error_="),
150+
ProblemFilters.exclude[IncompatibleMethTypeProblem]("cats.parse.RadixNode.this"),
151+
ProblemFilters.exclude[IncompatibleResultTypeProblem]("cats.parse.Parser#State.error")
149152
)
150153
else Nil
151154
} ++ MimaExclusionRules.ParserImpl
152155
)
153-
.jvmSettings(
154-
Test / sourceGenerators += Def.task {
155-
val file = (Test / sourceManaged).value / testUtilsFileName
156-
IO.write(file, testUtilsTemplate(2000, 20000))
157-
Seq(file)
158-
}.taskValue
159-
)
160156
.jsSettings(
161157
crossScalaVersions := (ThisBuild / crossScalaVersions).value.filterNot(_.startsWith("2.11")),
162158
coverageEnabled := false,

core/shared/src/main/scala/cats/parse/Numbers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ object Numbers {
3030

3131
/** zero or more digit chars
3232
*/
33-
val digits0: Parser0[String] = digit.rep0.string
33+
val digits0: Parser0[String] = digit.repAs0
3434

3535
/** one or more digit chars
3636
*/
37-
val digits: Parser[String] = digit.rep.string
37+
val digits: Parser[String] = digit.repAs
3838

3939
/** a single base 10 digit excluding 0
4040
*/

0 commit comments

Comments
 (0)