From 7ea8ce3a97ec274ebf43a3382c857e12e83c07b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owski?= Date: Wed, 30 Oct 2024 17:01:35 +0100 Subject: [PATCH] updates --- build.sbt | 2 +- flake.nix | 2 -- .../smithyql/parser/ParserTreeSitterDemo.scala | 2 +- .../parser/SmithyQLLanguageBindings.java | 18 ------------------ 4 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 modules/parser/src/main/scala/playground/smithyql/parser/SmithyQLLanguageBindings.java diff --git a/build.sbt b/build.sbt index 2cb7e6f6..f270e95b 100644 --- a/build.sbt +++ b/build.sbt @@ -117,7 +117,7 @@ lazy val parser = module("parser") "io.circe" %% "circe-generic" % "0.14.10" % Test, "io.circe" %% "circe-parser" % "0.14.10" % Test, "co.fs2" %% "fs2-io" % "3.11.0" % Test, - "org.polyvariant.treesitter4s" %% "core" % "0.3-1ab76c4-SNAPSHOT", + "org.polyvariant.treesitter4s" %% "core" % "0.3-4028f07-SNAPSHOT", ) ) .dependsOn( diff --git a/flake.nix b/flake.nix index da251984..a37386c1 100644 --- a/flake.nix +++ b/flake.nix @@ -29,10 +29,8 @@ src = ./tree-sitter-smithyql; buildInputs = [pkgs.tree-sitter pkgs.nodejs]; buildPhase = '' - ls -ll tree-sitter generate make - ls -ll ''; installPhase = if system == "x86_64-darwin" || system == "aarch64-darwin" then '' cp libtree-sitter-smithyql.dylib $out diff --git a/modules/parser/src/main/scala/playground/smithyql/parser/ParserTreeSitterDemo.scala b/modules/parser/src/main/scala/playground/smithyql/parser/ParserTreeSitterDemo.scala index 8a950a9d..b9263527 100644 --- a/modules/parser/src/main/scala/playground/smithyql/parser/ParserTreeSitterDemo.scala +++ b/modules/parser/src/main/scala/playground/smithyql/parser/ParserTreeSitterDemo.scala @@ -5,7 +5,7 @@ import org.polyvariant.treesitter4s.TreeSitterAPI object ParserTreeSitterDemo extends App { def parse(s: String) = { - val p = TreeSitterAPI.make(_.Language(SmithyQLLanguageBindings.SmithyQL)) + val p = TreeSitterAPI.make("smithyql") val tree = p.parse(s) println(tree.rootNode.get.fields.keySet) } diff --git a/modules/parser/src/main/scala/playground/smithyql/parser/SmithyQLLanguageBindings.java b/modules/parser/src/main/scala/playground/smithyql/parser/SmithyQLLanguageBindings.java deleted file mode 100644 index 6a0d7ebc..00000000 --- a/modules/parser/src/main/scala/playground/smithyql/parser/SmithyQLLanguageBindings.java +++ /dev/null @@ -1,18 +0,0 @@ -package playground.smithyql; - -import com.sun.jna.Library; -import com.sun.jna.NativeLibrary; -import com.sun.jna.Native; -import org.polyvariant.treesitter4s.Language; - -public class SmithyQLLanguageBindings { - - private static interface Bindings extends Library { - Language tree_sitter_smithyql(); - } - - private static final Bindings LIBRARY = Language.loadLanguageLibrary("smithyql", Bindings.class); - - public static final Language SmithyQL = LIBRARY.tree_sitter_smithyql(); - -}