From 23c30a6213c913ad6fd685bf69d83fab2e9c270d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Arenaza?= Date: Tue, 5 Apr 2022 10:39:01 +0200 Subject: [PATCH] Make the library compatible with babashka interpreter There is no need to use the .toMatchResult method to get the matching start and end. Those methods are alreay available in the Matcher class. They return the exact same values and they don't need to use an inner class. This access is not allowed when using the babashka Clojure(Script) interpreter. Babashka is statically compiled using GraalVM, and GraalVM is fairly restrictive with access to classes. Unless you specifically list them in the build configuration, the access is denied. Potentially even it can completely strip the classes out, if it thinks they are not used (it performs some static analysis to determine it, but it can fail depending on how the classes are used). --- src/cljstache/core.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cljstache/core.cljc b/src/cljstache/core.cljc index e6a5676..4a30545 100644 --- a/src/cljstache/core.cljc +++ b/src/cljstache/core.cljc @@ -256,7 +256,7 @@ matcher (re-matcher regex s)] (if (nil? (re-find matcher)) -1 - (+ index (.start (.toMatchResult matcher))))))))) + (+ index (.start matcher)))))))) #?(:cljs (defn- next-index