diff --git a/README.md b/README.md index 58f72784..17e4e545 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ while introducing support for those that were completely absent from the origina Highlights include: - Incremental abstract syntax tree edits +- Parser and lexer debugging through loggers - APIs for querying parsed abstract syntax trees - Support for both macOS and Linux out of the box - A wide range of languages [supported](.gitmodules) out of the box @@ -51,10 +52,10 @@ For it to work, you must have the following installed: | Dependency | Version | |:-----------|--------:| -| Java | 11+ | -| Maven | 3.9+ | -| Python | 3.9 | -| Docker | 23+ | +| Java | 11 | +| Maven | 3.9 | +| Python | 3.10 | +| Docker | 23 | ## Adding dependency to project @@ -64,7 +65,7 @@ To use in your own Maven project, include the following in your POM file: ch.usi.si.seart java-tree-sitter - 1.11.0 + 1.12.0 ``` @@ -205,5 +206,27 @@ public class Example { } ``` +If you would like to debug the parsing process, you can attach loggers directly to a `Parser`: + +```java +import ch.usi.si.seart.treesitter.*; +import org.slf4j.*; + +public class Example { + + // init omitted... + + public static void main(String[] args) { + Logger logger = LoggerFactory.getLogger(Example.class); + try (Parser parser = Parser.getFor(Language.PYTHON)) { + parser.setLogger(logger); + parser.parse("pass").close(); + } catch (Exception ex) { + // ... + } + } +} +``` + For more usage examples, take a look at the [tests](src/test/java/ch/usi/si/seart/treesitter). You can also refer to the full documentation [here](https://javadoc.io/doc/ch.usi.si.seart/java-tree-sitter/latest/index.html). diff --git a/pom.xml b/pom.xml index 35fdad2f..b6caa006 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ ch.usi.si.seart java-tree-sitter - 1.12.0-SNAPSHOT + 1.12.0 ${project.groupId}:${project.artifactId} Java bindings for tree-sitter @@ -56,7 +56,7 @@ - HEAD + v1.12.0 https://github.com/seart-group/java-tree-sitter/tree/master scm:git:https://github.com/seart-group/java-tree-sitter.git scm:git:git@github.com:seart-group/java-tree-sitter.git