This repository was archived by the owner on Mar 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
encode() and a stub for the load() #89
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,15 @@ | ||
package org.bblfsh.client.v2 | ||
|
||
/** UAST nodes representation on the JVM side. | ||
* | ||
* Mirrors https://godoc.org/github.com/bblfsh/sdk/uast/nodes | ||
*/ | ||
sealed abstract class JNode | ||
bzz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
case class JString(s: String) extends JNode | ||
case class JDouble(num: Double) extends JNode | ||
case class JLong(num: Long) extends JNode | ||
case class JInt(num: BigInt) extends JNode | ||
case class JBool(value: Boolean) extends JNode | ||
case class JObject(obj: List[JField]) extends JNode | ||
case class JArray(arr: List[JNode]) extends JNode | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package org.bblfsh.client.v2 | ||
|
||
case class Node(ctx: Long, handle: Long) { | ||
// TODO(bzz) make sure single string value or an array can also be loaded | ||
@native def load(): Map[String, _] | ||
@native def load(): JNode | ||
} |
This file contains hidden or 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,11 @@ | ||
package org.bblfsh.client | ||
|
||
/** Bblfsh client for protocol v2. | ||
* See https://github.com/bblfsh/sdk/blob/v3.1.0/protocol/driver.proto | ||
* | ||
* The main class to use is [[org.bblfsh.client.v2.BblfshClient]] | ||
*/ | ||
package object v2 { | ||
bzz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/** Key, Value representation of [[org.bblfsh.client.v2.JObject]] */ | ||
type JField = (String, JNode) | ||
} |
2 changes: 0 additions & 2 deletions
2
src/test/scala/org/bblfsh/client/v2/BblfshClientCloseTest.scala
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: Either
const char * const nativeContext = "…"
orconst char nativeContext[] = "…"
is preferable here—to ensure the pointer itself is also const (either works).constexpr char nativeContext[] = "…"
will also work if we assume C++ ≥ 11.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thank you, we do! Was thinking about
constexpr
as well - will replace as part of the next PR.