Skip to content

Commit

Permalink
feat(mojo): add mojo language
Browse files Browse the repository at this point in the history
Copy over Python queries and extend with Mojo specific syntax.
  • Loading branch information
austincummings committed Apr 13, 2024
1 parent f08a9d9 commit 1551060
Show file tree
Hide file tree
Showing 8 changed files with 864 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [ ] [mermaid](https://github.com/monaqa/tree-sitter-mermaid) (experimental)
- [x] [meson](https://github.com/Decodetalkers/tree-sitter-meson) (maintained by @Decodetalkers)
- [x] [mlir](https://github.com/artagnon/tree-sitter-mlir) (experimental, maintained by @artagnon)
- [x] [mojo](https://github.com/austincummings/tree-sitter-mojo) (maintained by @austincummings)
- [x] [muttrc](https://github.com/neomutt/tree-sitter-muttrc) (maintained by @Freed-Wu)
- [x] [nasm](https://github.com/naclsn/tree-sitter-nasm) (maintained by @ObserverOfTime)
- [ ] [nickel](https://github.com/nickel-lang/tree-sitter-nickel)
Expand Down
3 changes: 3 additions & 0 deletions lockfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@
"mlir": {
"revision": "c2845c1c0b23e2faf6febfa72a042e5346374ebf"
},
"mojo": {
"revision": "d8292d6963dec20d7ea1e43e0cd5f55b393bbca1"
},
"muttrc": {
"revision": "ce5b31451b3c0f90be884571b2ff4f569182f1d8"
},
Expand Down
9 changes: 9 additions & 0 deletions lua/nvim-treesitter/parsers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,15 @@ list.mlir = {
maintainers = { "@artagnon" },
}

list.mojo = {
install_info = {
url = "https://github.com/austincummings/tree-sitter-mojo",
files = { "src/parser.c", "src/scanner.c" },
branch = "main",
},
maintainers = { "@austincummings" },
}

list.muttrc = {
install_info = {
url = "https://github.com/neomutt/tree-sitter-muttrc",
Expand Down
23 changes: 23 additions & 0 deletions queries/mojo/folds.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
(function_definition)
(class_definition)
(while_statement)
(for_statement)
(if_statement)
(with_statement)
(try_statement)
(match_statement)
(import_from_statement)
(parameters)
(argument_list)
(parenthesized_expression)
(generator_expression)
(list_comprehension)
(set_comprehension)
(dictionary_comprehension)
(tuple)
(list)
(set)
(dictionary)
(string)
] @fold
Loading

0 comments on commit 1551060

Please sign in to comment.