Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Oct 30, 2024
1 parent b986240 commit eca1719
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ trait TreeSitterAPI {

object TreeSitterAPI {

def make(language: (ts: TreeSitter) => ts.Language): TreeSitterAPI = {
def make(language: String): TreeSitterAPI = {
val ts = TreeSitter.instance
val lang = language(ts)
val lang = ts.Language(language)

internal.Facade.make(ts, lang)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.polyvariant.treesitter4s.TreeSitterAPI
object Demo {

def main(args: Array[String]): Unit = {
val ts = TreeSitterAPI.make(_.Language("python"))
val ts = TreeSitterAPI.make("python")

System.out.println(ts.parse("""def main = print("hello world")""").rootNode.map(_.tpe))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import weaver._
import org.polyvariant.treesitter4s.TreeSitterAPI

object BindingTests extends FunSuite {
val ts = TreeSitterAPI.make(_.Language("python"))
val ts = TreeSitterAPI.make("python")
def parseExample(s: String): Tree = ts.parse(s)

test("root node child count") {
Expand Down

0 comments on commit eca1719

Please sign in to comment.