-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: compile each language individually
- Loading branch information
1 parent
ad3519c
commit 3cc7a64
Showing
17 changed files
with
212 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,5 @@ indent_size = 3 | |
[*.md] | ||
indent_size = 2 | ||
|
||
[*.yml] | ||
[*.{yml,json}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
include tree_sitter_languages/languages.h | ||
include languages.json | ||
|
||
prune tree_sitter_languages/repos | ||
recursive-include tree_sitter_languages/repos src/**/*.[ch] | ||
prune vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"dot": { | ||
"repo": "https://github.com/rydesun/tree-sitter-dot" | ||
}, | ||
"elisp": { | ||
"repo": "https://github.com/Wilfred/tree-sitter-elisp" | ||
}, | ||
"elm": { | ||
"repo": "https://github.com/elm-tooling/tree-sitter-elm" | ||
}, | ||
"fixed_form_fortran": { | ||
"repo": "https://github.com/ZedThree/tree-sitter-fixed-form-fortran", | ||
"branch": "f77" | ||
}, | ||
"fortran": { | ||
"repo": "https://github.com/stadelmanma/tree-sitter-fortran" | ||
}, | ||
"gomod": { | ||
"repo": "https://github.com/camdencheek/tree-sitter-go-mod" | ||
}, | ||
"hack": { | ||
"repo": "https://github.com/slackhq/tree-sitter-hack" | ||
}, | ||
"hcl": { | ||
"repo": "https://github.com/tree-sitter-grammars/tree-sitter-hcl", | ||
"languages": { | ||
"hcl": "", | ||
"terraform": "dialects/terraform" | ||
} | ||
}, | ||
"kotlin": { | ||
"repo": "https://github.com/fwcd/tree-sitter-kotlin" | ||
}, | ||
"make": { | ||
"repo": "https://github.com/tree-sitter-grammars/tree-sitter-make" | ||
}, | ||
"objc": { | ||
"repo": "https://github.com/tree-sitter-grammars/tree-sitter-objc" | ||
}, | ||
"rst": { | ||
"repo": "https://github.com/stsewd/tree-sitter-rst" | ||
}, | ||
"scala": { | ||
"repo": "https://github.com/tree-sitter/tree-sitter-scala" | ||
}, | ||
"sql": { | ||
"repo": "https://github.com/derekstride/tree-sitter-sql", | ||
"branch": "gh-pages" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <Python.h> | ||
|
||
typedef struct TSLanguage TSLanguage; | ||
|
||
#ifndef TS_LANGUAGE_NAME | ||
#error TS_LANGUAGE_NAME must be defined | ||
#endif | ||
|
||
#define _str(s) #s | ||
#define str(s) _str(s) | ||
#define _cat(a, b) a##b | ||
#define cat(a, b) _cat(a, b) | ||
|
||
#define TS_LANGUAGE_FUNC cat(tree_sitter_, TS_LANGUAGE_NAME) | ||
#define TS_LANGUAGE_METHOD cat(TS_LANGUAGE_NAME, _language) | ||
#define TS_LANGUAGE_MODULE cat(PyInit_, TS_LANGUAGE_NAME) | ||
|
||
TSLanguage *TS_LANGUAGE_FUNC(void); | ||
|
||
static PyObject* TS_LANGUAGE_METHOD(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) { | ||
return PyLong_FromVoidPtr(TS_LANGUAGE_FUNC()); | ||
} | ||
|
||
static PyMethodDef methods[] = { | ||
{"language", TS_LANGUAGE_METHOD, METH_NOARGS, NULL}, | ||
{NULL, NULL, 0, NULL} | ||
}; | ||
|
||
static struct PyModuleDef module = { | ||
.m_base = PyModuleDef_HEAD_INIT, | ||
.m_name = str(TS_LANGUAGE_NAME), | ||
.m_doc = NULL, | ||
.m_size = -1, | ||
.m_methods = methods | ||
}; | ||
|
||
PyMODINIT_FUNC TS_LANGUAGE_MODULE(void) { | ||
return PyModule_Create(&module); | ||
} |
Oops, something went wrong.