Skip to content

Commit 161997f

Browse files
committed
Update to FastParse 3.x in preparation to usage of kaitai-yaml
1 parent 3270e5f commit 161997f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ lazy val compiler = crossProject(JSPlatform, JVMPlatform).
7171

7272
libraryDependencies ++= Seq(
7373
"com.github.scopt" %%% "scopt" % "4.1.0",
74-
"com.lihaoyi" %%% "fastparse" % "2.3.3",
74+
"com.lihaoyi" %%% "fastparse" % "3.1.1",
7575
"org.yaml" % "snakeyaml" % "2.0"
7676
)
7777
).

shared/src/main/scala/io/kaitai/struct/exprlang/Expressions.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ import Lexical.kw
2424
*/
2525
object Expressions {
2626
// Implicit rule which consume input in `~` and `.rep` operators
27-
implicit val whitespace: P[_] => P[Unit] = { implicit ctx: ParsingRun[_] => Lexical.wscomment }
27+
implicit object whitespace extends fastparse.Whitespace {
28+
def apply(ctx: ParsingRun[_]): P[Unit] = {
29+
implicit val ctx0: ParsingRun[_] = ctx
30+
Lexical.wscomment
31+
}
32+
}
2833

2934
def NAME[$: P]: P[Ast.identifier] = Lexical.identifier
3035
def TYPE_NAME[$: P]: P[Ast.typeId] = P("::".!.? ~ NAME.rep(1, "::") ~ ("[" ~ "]").!.?).map {

0 commit comments

Comments
 (0)