Skip to content

Commit

Permalink
Upgrade to FastParse 0.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
newca12 committed Dec 26, 2015
1 parent b4e3236 commit a4485f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ libraryDependencies ++= Seq(
//http://harrah.github.io/xsbt/latest/sxr/Ivy.scala.html
//"org.scala-lang.modules" %% "scala-xml" % "1.0.4",
"org.parboiled" %% "parboiled" % "2.2.0-SNAPSHOT",
"com.lihaoyi" %% "fastparse" % "0.2.1",
"com.lihaoyi" %% "fastparse" % "0.3.4",
"org.scalatest" %% "scalatest" % "2.2.5" % "test",
"com.twitter" % "util-core_2.11" % "6.24.0"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object OrderDsl {
val unicodeEscape = P("u" ~ hexDigit ~ hexDigit ~ hexDigit ~ hexDigit)
val escape = P("\\" ~ (CharIn("\"/\\bfnrt") | unicodeEscape))
val strChars = P(CharsWhile(!"\"\\".contains(_)))
val stringLit = P("\"" ~! (strChars | escape).rep.! ~ "\"")
val stringLit = P("\"" ~/ (strChars | escape).rep.! ~ "\"")
val ident = P(CharsWhile(('a' to 'z') ++ ('A' to 'Z') contains (_)))

val order: Parser[Order] = P(items ~ account_spec).map { case (a: Items, b: AccountSpec) Order(a, b) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.edla.study.parsing.fastparse.semantic.{ OrderDsl ⇒ OrderDslFastPars
import org.edla.study.parsing.parboiled.semantic.{ OrderDsl OrderDslParboiled }
import org.scalatest.{ Finders, FunSuite }

import _root_.fastparse.core.Result
import _root_.fastparse.core.Parsed

class OrderDslParserSpec extends FunSuite {

Expand Down Expand Up @@ -35,12 +35,12 @@ class OrderDslParserSpec extends FunSuite {
}

test("FastParse AccountSpec Parser") {
val Result.Success(value, index) = OrderDslFastParse.account_spec.parse(accountSample)
val Parsed.Success(value, index) = OrderDslFastParse.account_spec.parse(accountSample)
assert(value === accountAST)
}

test("FastParse Order Parser") {
val Result.Success(value, index) = OrderDslFastParse.order.parse(orderSample)
val Parsed.Success(value, index) = OrderDslFastParse.order.parse(orderSample)
assert(value === orderAST)
}

Expand Down

0 comments on commit a4485f9

Please sign in to comment.