tree-sitter implementation for the confindent configuration language
1"""tree-sitter implementation for the Confindent configuration language"""
2
3from importlib.resources import files as _files
4
5from ._binding import language
6
7
8def _get_query(name, file):
9 query = _files(f"{__package__}.queries") / file
10 globals()[name] = query.read_text()
11 return globals()[name]
12
13
14def __getattr__(name):
15 # NOTE: uncomment these to include any queries that this grammar contains:
16
17 # if name == "HIGHLIGHTS_QUERY":
18 # return _get_query("HIGHLIGHTS_QUERY", "highlights.scm")
19 # if name == "INJECTIONS_QUERY":
20 # return _get_query("INJECTIONS_QUERY", "injections.scm")
21 # if name == "LOCALS_QUERY":
22 # return _get_query("LOCALS_QUERY", "locals.scm")
23 # if name == "TAGS_QUERY":
24 # return _get_query("TAGS_QUERY", "tags.scm")
25
26 raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
27
28
29__all__ = [
30 "language",
31 # "HIGHLIGHTS_QUERY",
32 # "INJECTIONS_QUERY",
33 # "LOCALS_QUERY",
34 # "TAGS_QUERY",
35]
36
37
38def __dir__():
39 return sorted(__all__ + [
40 "__all__", "__builtins__", "__cached__", "__doc__", "__file__",
41 "__loader__", "__name__", "__package__", "__path__", "__spec__",
42 ])