feat: remove stuff
This commit is contained in:
15
bindings/go/binding.go
generated
15
bindings/go/binding.go
generated
@@ -1,15 +0,0 @@
|
||||
package tree_sitter_noil
|
||||
|
||||
// #cgo CFLAGS: -std=c11 -fPIC
|
||||
// #include "../../src/parser.c"
|
||||
// #if __has_include("../../src/scanner.c")
|
||||
// #include "../../src/scanner.c"
|
||||
// #endif
|
||||
import "C"
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// Get the tree-sitter Language for this grammar.
|
||||
func Language() unsafe.Pointer {
|
||||
return unsafe.Pointer(C.tree_sitter_noil())
|
||||
}
|
15
bindings/go/binding_test.go
generated
15
bindings/go/binding_test.go
generated
@@ -1,15 +0,0 @@
|
||||
package tree_sitter_noil_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
tree_sitter "github.com/tree-sitter/go-tree-sitter"
|
||||
tree_sitter_noil "git.front.kjuulh.io/kjuulh/tree-sitter-noil/bindings/go"
|
||||
)
|
||||
|
||||
func TestCanLoadGrammar(t *testing.T) {
|
||||
language := tree_sitter.NewLanguage(tree_sitter_noil.Language())
|
||||
if language == nil {
|
||||
t.Errorf("Error loading Noil grammar")
|
||||
}
|
||||
}
|
12
bindings/python/tests/test_binding.py
generated
12
bindings/python/tests/test_binding.py
generated
@@ -1,12 +0,0 @@
|
||||
from unittest import TestCase
|
||||
|
||||
import tree_sitter
|
||||
import tree_sitter_noil
|
||||
|
||||
|
||||
class TestLanguage(TestCase):
|
||||
def test_can_load_grammar(self):
|
||||
try:
|
||||
tree_sitter.Language(tree_sitter_noil.language())
|
||||
except Exception:
|
||||
self.fail("Error loading Noil grammar")
|
42
bindings/python/tree_sitter_noil/__init__.py
generated
42
bindings/python/tree_sitter_noil/__init__.py
generated
@@ -1,42 +0,0 @@
|
||||
"""Noil treats your file like any buffer"""
|
||||
|
||||
from importlib.resources import files as _files
|
||||
|
||||
from ._binding import language
|
||||
|
||||
|
||||
def _get_query(name, file):
|
||||
query = _files(f"{__package__}.queries") / file
|
||||
globals()[name] = query.read_text()
|
||||
return globals()[name]
|
||||
|
||||
|
||||
def __getattr__(name):
|
||||
# NOTE: uncomment these to include any queries that this grammar contains:
|
||||
|
||||
# if name == "HIGHLIGHTS_QUERY":
|
||||
# return _get_query("HIGHLIGHTS_QUERY", "highlights.scm")
|
||||
# if name == "INJECTIONS_QUERY":
|
||||
# return _get_query("INJECTIONS_QUERY", "injections.scm")
|
||||
# if name == "LOCALS_QUERY":
|
||||
# return _get_query("LOCALS_QUERY", "locals.scm")
|
||||
# if name == "TAGS_QUERY":
|
||||
# return _get_query("TAGS_QUERY", "tags.scm")
|
||||
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||
|
||||
|
||||
__all__ = [
|
||||
"language",
|
||||
# "HIGHLIGHTS_QUERY",
|
||||
# "INJECTIONS_QUERY",
|
||||
# "LOCALS_QUERY",
|
||||
# "TAGS_QUERY",
|
||||
]
|
||||
|
||||
|
||||
def __dir__():
|
||||
return sorted(__all__ + [
|
||||
"__all__", "__builtins__", "__cached__", "__doc__", "__file__",
|
||||
"__loader__", "__name__", "__package__", "__path__", "__spec__",
|
||||
])
|
10
bindings/python/tree_sitter_noil/__init__.pyi
generated
10
bindings/python/tree_sitter_noil/__init__.pyi
generated
@@ -1,10 +0,0 @@
|
||||
from typing import Final
|
||||
|
||||
# NOTE: uncomment these to include any queries that this grammar contains:
|
||||
|
||||
# HIGHLIGHTS_QUERY: Final[str]
|
||||
# INJECTIONS_QUERY: Final[str]
|
||||
# LOCALS_QUERY: Final[str]
|
||||
# TAGS_QUERY: Final[str]
|
||||
|
||||
def language() -> object: ...
|
35
bindings/python/tree_sitter_noil/binding.c
generated
35
bindings/python/tree_sitter_noil/binding.c
generated
@@ -1,35 +0,0 @@
|
||||
#include <Python.h>
|
||||
|
||||
typedef struct TSLanguage TSLanguage;
|
||||
|
||||
TSLanguage *tree_sitter_noil(void);
|
||||
|
||||
static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {
|
||||
return PyCapsule_New(tree_sitter_noil(), "tree_sitter.Language", NULL);
|
||||
}
|
||||
|
||||
static struct PyModuleDef_Slot slots[] = {
|
||||
#ifdef Py_GIL_DISABLED
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
#endif
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
static PyMethodDef methods[] = {
|
||||
{"language", _binding_language, METH_NOARGS,
|
||||
"Get the tree-sitter language for this grammar."},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
static struct PyModuleDef module = {
|
||||
.m_base = PyModuleDef_HEAD_INIT,
|
||||
.m_name = "_binding",
|
||||
.m_doc = NULL,
|
||||
.m_size = 0,
|
||||
.m_methods = methods,
|
||||
.m_slots = slots,
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC PyInit__binding(void) {
|
||||
return PyModuleDef_Init(&module);
|
||||
}
|
0
bindings/python/tree_sitter_noil/py.typed
generated
0
bindings/python/tree_sitter_noil/py.typed
generated
16
bindings/swift/TreeSitterNoil/noil.h
generated
16
bindings/swift/TreeSitterNoil/noil.h
generated
@@ -1,16 +0,0 @@
|
||||
#ifndef TREE_SITTER_NOIL_H_
|
||||
#define TREE_SITTER_NOIL_H_
|
||||
|
||||
typedef struct TSLanguage TSLanguage;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
const TSLanguage *tree_sitter_noil(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // TREE_SITTER_NOIL_H_
|
@@ -1,12 +0,0 @@
|
||||
import XCTest
|
||||
import SwiftTreeSitter
|
||||
import TreeSitterNoil
|
||||
|
||||
final class TreeSitterNoilTests: XCTestCase {
|
||||
func testCanLoadGrammar() throws {
|
||||
let parser = Parser()
|
||||
let language = Language(language: tree_sitter_noil())
|
||||
XCTAssertNoThrow(try parser.setLanguage(language),
|
||||
"Error loading Noil grammar")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user