-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #340 from lolgab/support-scala-native
Support Scala Native
- Loading branch information
Showing
11 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.typelevel.jawn | ||
package ast | ||
|
||
private[jawn] trait JParserPlatform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.typelevel.jawn | ||
package ast | ||
|
||
private[jawn] trait AstCheckPlatform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.typelevel.jawn | ||
package ast | ||
|
||
private[jawn] trait AstTestPlatform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
parser/native/src/main/scala/jawn/ParserCompanionPlatform.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.typelevel.jawn | ||
|
||
private[jawn] trait ParserCompanionPlatform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.typelevel.jawn | ||
|
||
import java.nio.ByteBuffer | ||
import scala.util.Try | ||
|
||
trait SupportParser[J] { | ||
implicit def facade: Facade[J] | ||
|
||
def parseUnsafe(s: String): J = | ||
new StringParser(s).parse() | ||
|
||
def parseFromString(s: String): Try[J] = | ||
Try(new StringParser[J](s).parse()) | ||
|
||
def parseFromCharSequence(cs: CharSequence): Try[J] = | ||
Try(new CharSequenceParser[J](cs).parse()) | ||
|
||
def parseFromByteBuffer(buf: ByteBuffer): Try[J] = | ||
Try(new ByteBufferParser[J](buf).parse()) | ||
|
||
def parseFromByteArray(src: Array[Byte]): Try[J] = | ||
Try(new ByteArrayParser[J](src).parse()) | ||
|
||
def async(mode: AsyncParser.Mode): AsyncParser[J] = | ||
AsyncParser[J](mode) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.typelevel.jawn | ||
|
||
private[jawn] trait SyntaxPlatform |
4 changes: 4 additions & 0 deletions
4
parser/native/src/test/scala/jawn/JNumIndexCheckPlatform.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.typelevel.jawn | ||
package parser | ||
|
||
private[jawn] trait JNumIndexCheckPlatform |
12 changes: 12 additions & 0 deletions
12
parser/native/src/test/scala/jawn/SyntaxCheckPlatform.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.typelevel.jawn | ||
package parser | ||
|
||
import org.scalacheck.Prop | ||
|
||
private[jawn] trait SyntaxCheckPlatform { self: SyntaxCheck => | ||
|
||
def isValidSyntaxPlatform(s: String): Boolean = true | ||
|
||
def testErrorLocPlatform(json: String, line: Int, col: Int): Prop = Prop(true) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
util/native/src/test/scala/jawn/util/SliceCheckPlatform.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.typelevel.jawn | ||
package util | ||
|
||
private[jawn] trait SliceCheckPlatform |