Skip to content

Commit

Permalink
Add Kotlin language
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 committed Jan 16, 2023
1 parent 92646bb commit c392147
Show file tree
Hide file tree
Showing 19 changed files with 790 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ walkdir = "^2.3"

tree-sitter = "=0.20.9"
tree-sitter-java = "=0.20.0"
tree-sitter-kotlin = "0.2.11"
tree-sitter-typescript = "=0.20.1"
tree-sitter-javascript = "=0.20.0"
tree-sitter-python = "=0.20.2"
Expand Down
1 change: 1 addition & 0 deletions src/alterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ impl Alterator for CppCode {
impl Alterator for PythonCode {}

impl Alterator for JavaCode {}
impl Alterator for KotlinCode {}

impl Alterator for MozjsCode {
fn alterate(node: &Node, code: &[u8], span: bool, children: Vec<AstNode>) -> AstNode {
Expand Down
10 changes: 10 additions & 0 deletions src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@ impl Checker for JavaCode {
mk_checker!(is_non_arg,);
}

impl Checker for KotlinCode {
mk_checker!(is_comment,);
mk_checker!(is_string,);
mk_checker!(is_call,);
mk_checker!(is_func,);
mk_checker!(is_closure,);
mk_checker!(is_func_space,);
mk_checker!(is_non_arg,);
}

impl Checker for MozjsCode {
mk_checker!(is_comment, Comment);
mk_checker!(is_string, String, TemplateString);
Expand Down
2 changes: 2 additions & 0 deletions src/getter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,5 @@ impl Getter for JavaCode {

get_operator!(Java);
}

impl Getter for KotlinCode {}
10 changes: 10 additions & 0 deletions src/langs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ mk_langs!(
[java],
["java"]
),
(
Kotlin,
"The `Kotlin` language",
"kotlin",
KotlinCode,
KotlinParser,
tree_sitter_kotlin,
[kt, kts],
["kotlin"]
),
(
Rust,
"The `Rust` language",
Expand Down
Loading

0 comments on commit c392147

Please sign in to comment.