Skip to content

Commit

Permalink
feature (languages): c, cpp, go, python, rust
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandhoej committed Mar 9, 2022
1 parent b0b9c14 commit 7e609aa
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
[submodule "vendor/tree-sitter-javascript"]
path = vendor/tree-sitter-javascript
url = https://github.com/tree-sitter/tree-sitter-javascript.git
[submodule "vendor/tree-sitter-c"]
path = vendor/tree-sitter-c
url = https://github.com/tree-sitter/tree-sitter-c
[submodule "vendor/tree-sitter-cpp"]
path = vendor/tree-sitter-cpp
url = https://github.com/tree-sitter/tree-sitter-cpp.git
[submodule "vendor/tree-sitter-python"]
path = vendor/tree-sitter-python
url = https://github.com/tree-sitter/tree-sitter-python
[submodule "vendor/tree-sitter-rust"]
path = vendor/tree-sitter-rust
url = https://github.com/tree-sitter/tree-sitter-rust.git
[submodule "vendor/tree-sitter-go"]
path = vendor/tree-sitter-go
url = https://github.com/tree-sitter/tree-sitter-go.git
Empty file modified src/ts/__init__.py
100644 → 100755
Empty file.
Empty file modified src/ts/test_ts.py
100644 → 100755
Empty file.
33 changes: 29 additions & 4 deletions src/ts/ts.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,36 @@ def full_build_path() -> str:
def build() -> None:
_Language.build_library(
LanguageLibrary.full_build_path(),
[ f'{LanguageLibrary.vendor_path()}/tree-sitter-javascript' ]
[
f'{LanguageLibrary.vendor_path()}/tree-sitter-c',
f'{LanguageLibrary.vendor_path()}/tree-sitter-cpp',
f'{LanguageLibrary.vendor_path()}/tree-sitter-go',
f'{LanguageLibrary.vendor_path()}/tree-sitter-javascript',
f'{LanguageLibrary.vendor_path()}/tree-sitter-python',
f'{LanguageLibrary.vendor_path()}/tree-sitter-rust',
]
)

@staticmethod
def c() -> Language:
return Language(_Language(LanguageLibrary.full_build_path(), 'c'))

@staticmethod
def cpp() -> Language:
return Language(_Language(LanguageLibrary.full_build_path(), 'cpp'))

@staticmethod
def go() -> Language:
return Language(_Language(LanguageLibrary.full_build_path(), 'go'))

@staticmethod
def js() -> Language:
return Language(
_Language(LanguageLibrary.full_build_path(), 'javascript')
)
return Language(_Language(LanguageLibrary.full_build_path(), 'javascript'))

@staticmethod
def python() -> Language:
return Language(_Language(LanguageLibrary.full_build_path(), 'python'))

@staticmethod
def rust() -> Language:
return Language(_Language(LanguageLibrary.full_build_path(), 'rust'))
1 change: 1 addition & 0 deletions vendor/tree-sitter-c
Submodule tree-sitter-c added at e348e8
1 change: 1 addition & 0 deletions vendor/tree-sitter-cpp
Submodule tree-sitter-cpp added at a40396
1 change: 1 addition & 0 deletions vendor/tree-sitter-go
Submodule tree-sitter-go added at 0fa917
1 change: 1 addition & 0 deletions vendor/tree-sitter-python
Submodule tree-sitter-python added at 78c4e9
1 change: 1 addition & 0 deletions vendor/tree-sitter-rust
Submodule tree-sitter-rust added at 0509e4

0 comments on commit 7e609aa

Please sign in to comment.