Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language binding: tree-sitter-odin #194

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
[submodule "tree-sitter-ocaml"]
path = tree-sitter-ocaml
url = https://github.com/tree-sitter/tree-sitter-ocaml.git
[submodule "tree-sitter-odin"]
path = tree-sitter-odin
url = https://github.com/tree-sitter-grammars/tree-sitter-odin.git
[submodule "tree-sitter-pascal"]
path = tree-sitter-pascal
url = https://github.com/Isopod/tree-sitter-pascal.git
Expand Down
3 changes: 3 additions & 0 deletions lib/ch_usi_si_seart_treesitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ TSLanguage* tree_sitter_objc();
#ifdef TS_LANGUAGE_OCAML
TSLanguage* tree_sitter_ocaml();
#endif
#ifdef TS_LANGUAGE_ODIN
TSLanguage* tree_sitter_odin();
#endif
#ifdef TS_LANGUAGE_PASCAL
TSLanguage* tree_sitter_pascal();
#endif
Expand Down
9 changes: 9 additions & 0 deletions lib/ch_usi_si_seart_treesitter_Language.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@ JNIEXPORT jlong JNICALL Java_ch_usi_si_seart_treesitter_Language_ocaml(
#endif
}

JNIEXPORT jlong JNICALL Java_ch_usi_si_seart_treesitter_Language_odin(
JNIEnv* env, jclass self) {
#ifdef TS_LANGUAGE_ODIN
return (jlong)tree_sitter_odin();
#else
return (jlong)ch_usi_si_seart_treesitter_Language_INVALID;
#endif
}

JNIEXPORT jlong JNICALL Java_ch_usi_si_seart_treesitter_Language_pascal(
JNIEnv* env, jclass self) {
#ifdef TS_LANGUAGE_PASCAL
Expand Down
8 changes: 8 additions & 0 deletions lib/ch_usi_si_seart_treesitter_Language.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/main/java/ch/usi/si/seart/treesitter/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ public enum Language {
*/
OCAML(ocaml(), "ml", "mli"),

/**
* Odin programming language.
*
* @see <a href="https://github.com/tree-sitter-grammars/tree-sitter-odin">tree-sitter-odin</a>
*/
ODIN(odin(), "odin"),

/**
* Pascal programming language.
*
Expand Down Expand Up @@ -516,6 +523,7 @@ public enum Language {
private static native long nix();
private static native long objectiveC();
private static native long ocaml();
private static native long odin();
private static native long pascal();
private static native long php();
private static native long psv();
Expand Down Expand Up @@ -749,6 +757,7 @@ public String toString() {
case LUA:
case MARKDOWN:
case NIX:
case ODIN:
case PASCAL:
case PYTHON:
case RACKET:
Expand Down
1 change: 1 addition & 0 deletions tree-sitter-odin
Submodule tree-sitter-odin added at e4897c