tree-sitter-muttrc 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +20 -15
- package/bindings/node/binding.cc +14 -22
- package/bindings/node/index.d.ts +28 -0
- package/bindings/node/index.js +3 -15
- package/package.json +35 -10
- package/src/grammar.json +0 -1
- package/src/parser.c +488 -1124
- package/src/tree_sitter/alloc.h +54 -0
- package/src/tree_sitter/array.h +290 -0
- package/src/tree_sitter/parser.h +11 -5
- package/.cmake-format.yaml +0 -2
- package/.cmakelintrc +0 -1
- package/.github/FUNDING.yml +0 -6
- package/.github/workflows/main.yml +0 -152
- package/.gitlint +0 -5
- package/.pre-commit-config.yaml +0 -112
- package/.yamllint.yaml +0 -8
- package/CMakeLists.txt +0 -38
- package/Cargo.toml +0 -26
- package/bindings/python/tree_sitter_muttrc/__init__.py +0 -42
- package/bindings/python/tree_sitter_muttrc/__main__.py +0 -60
- package/bindings/python/tree_sitter_muttrc/py.typed +0 -0
- package/bindings/rust/build.rs +0 -40
- package/bindings/rust/lib.rs +0 -52
- package/pyproject.toml +0 -124
- package/queries/highlights.scm +0 -53
- package/queries/injections.scm +0 -8
- package/requirements/colorize.txt +0 -3
- package/requirements/dev.txt +0 -4
- package/requirements.txt +0 -3
- package/scripts/build.sh +0 -8
- package/templates/class.txt +0 -2
- package/templates/def.txt +0 -12
- package/templates/noarg.txt +0 -1
- package/test/corpus/example.txt +0 -82
- package/tests/neomuttrc +0 -18
- package/tests/test___init__.py +0 -22
package/CMakeLists.txt
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
cmake_minimum_required(VERSION 3.10)
|
|
2
|
-
string(REGEX MATCH [[[0-9](\.[0-9])*]] VERSION "$ENV{GITHUB_REF_NAME}")
|
|
3
|
-
if(NOT VERSION)
|
|
4
|
-
set(VERSION 0.0.0.0)
|
|
5
|
-
endif()
|
|
6
|
-
if(ENV{GITHUB_REPOSITORY})
|
|
7
|
-
set(HOMEPAGE_URL "https://github.com/$ENV{GITHUB_REPOSITORY}")
|
|
8
|
-
string(REGEX REPLACE ".*/tree-sitter-([^/]*)$" "\\1" LANGUAGE $ENV{GITHUB_REPOSITORY})
|
|
9
|
-
else()
|
|
10
|
-
set(HOMEPAGE_URL "")
|
|
11
|
-
file(GLOB LANGUAGE "${CMAKE_CURRENT_SOURCE_DIR}/bindings/python/*")
|
|
12
|
-
string(REGEX REPLACE ".*/tree_sitter_([^/]*)$" "\\1" LANGUAGE ${LANGUAGE})
|
|
13
|
-
endif()
|
|
14
|
-
project(
|
|
15
|
-
tree-sitter-${LANGUAGE}
|
|
16
|
-
VERSION ${VERSION}
|
|
17
|
-
DESCRIPTION tree-sitter-${LANGUAGE}
|
|
18
|
-
HOMEPAGE_URL "${HOMEPAGE_URL}")
|
|
19
|
-
include_directories(src)
|
|
20
|
-
add_library(${LANGUAGE} SHARED src/parser.c)
|
|
21
|
-
set_target_properties(${LANGUAGE} PROPERTIES PREFIX "")
|
|
22
|
-
if(DEFINED SKBUILD_DATA_DIR)
|
|
23
|
-
set(CMAKE_INSTALL_FULL_LIBDIR ${SKBUILD_DATA_DIR}/lib)
|
|
24
|
-
endif()
|
|
25
|
-
if(NOT DEFINED CMAKE_INSTALL_FULL_LIBDIR)
|
|
26
|
-
include(GNUInstallDirs)
|
|
27
|
-
endif()
|
|
28
|
-
install(TARGETS ${LANGUAGE} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/parser)
|
|
29
|
-
|
|
30
|
-
set(CPACK_PACKAGE_CONTACT ${HOMEPAGE_URL}/issues)
|
|
31
|
-
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Wu Zhenyu <wuzhenyu@ustc.edu>")
|
|
32
|
-
set(CPACK_RPM_PACKAGE_LICENSE GPL3)
|
|
33
|
-
set(CPACK_RPM_PACKAGE_URL ${HOMEPAGE_URL})
|
|
34
|
-
include(CPack)
|
|
35
|
-
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
|
36
|
-
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
|
|
37
|
-
set(CPACK_ARCHIVE_THREADS 0)
|
|
38
|
-
set(CPACK_THREADS 0)
|
package/Cargo.toml
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "tree-sitter-muttrc"
|
|
3
|
-
description = "muttrc grammar for the tree-sitter parsing library"
|
|
4
|
-
version = "0.0.2"
|
|
5
|
-
keywords = ["incremental", "parsing", "muttrc"]
|
|
6
|
-
categories = ["parsing", "text-editors"]
|
|
7
|
-
repository = "https://github.com/Freed-Wu/tree-sitter-muttrc"
|
|
8
|
-
edition = "2018"
|
|
9
|
-
license = "GPL-3.0-or-later"
|
|
10
|
-
|
|
11
|
-
build = "bindings/rust/build.rs"
|
|
12
|
-
include = [
|
|
13
|
-
"bindings/rust/*",
|
|
14
|
-
"grammar.js",
|
|
15
|
-
"queries/*",
|
|
16
|
-
"src/*",
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
[lib]
|
|
20
|
-
path = "bindings/rust/lib.rs"
|
|
21
|
-
|
|
22
|
-
[dependencies]
|
|
23
|
-
tree-sitter = "~0.20.10"
|
|
24
|
-
|
|
25
|
-
[build-dependencies]
|
|
26
|
-
cc = "1.0"
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
r"""Tree sitter
|
|
2
|
-
===============
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import os
|
|
6
|
-
import sysconfig
|
|
7
|
-
|
|
8
|
-
from tree_sitter import Language, Parser
|
|
9
|
-
|
|
10
|
-
from . import __name__ as NAME
|
|
11
|
-
|
|
12
|
-
NAME = NAME.split("_")[-1]
|
|
13
|
-
DLL = sysconfig.get_config_var("SHLIB_SUFFIX")
|
|
14
|
-
if DLL is None:
|
|
15
|
-
DLL = ".dll"
|
|
16
|
-
|
|
17
|
-
try:
|
|
18
|
-
from ._version import __version__, __version_tuple__ # type: ignore
|
|
19
|
-
except ImportError: # for setuptools-generate
|
|
20
|
-
__version__ = "rolling"
|
|
21
|
-
__version_tuple__ = (0, 0, 0, __version__, "")
|
|
22
|
-
|
|
23
|
-
paths = [
|
|
24
|
-
os.path.join(
|
|
25
|
-
os.path.join(
|
|
26
|
-
os.path.join(sysconfig.get_path("data", scheme), "lib"), "parser"
|
|
27
|
-
),
|
|
28
|
-
NAME + DLL,
|
|
29
|
-
)
|
|
30
|
-
for scheme in [
|
|
31
|
-
sysconfig.get_preferred_scheme("user"),
|
|
32
|
-
sysconfig.get_default_scheme(),
|
|
33
|
-
]
|
|
34
|
-
]
|
|
35
|
-
for path in paths:
|
|
36
|
-
if os.path.isfile(path):
|
|
37
|
-
break
|
|
38
|
-
else:
|
|
39
|
-
raise FileNotFoundError(paths)
|
|
40
|
-
language = Language(path, NAME)
|
|
41
|
-
parser = Parser()
|
|
42
|
-
parser.set_language(language)
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
r"""This module can be called by
|
|
2
|
-
`python -m <https://docs.python.org/3/library/__main__.html>`_.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from argparse import ArgumentParser, RawDescriptionHelpFormatter
|
|
6
|
-
from contextlib import suppress
|
|
7
|
-
from datetime import datetime
|
|
8
|
-
|
|
9
|
-
from . import __name__ as NAME
|
|
10
|
-
from . import __version__
|
|
11
|
-
|
|
12
|
-
NAME = NAME.replace("_", "-")
|
|
13
|
-
VERSION = rf"""{NAME} {__version__}
|
|
14
|
-
Copyright (C) {datetime.now().year}
|
|
15
|
-
Written by Wu Zhenyu
|
|
16
|
-
"""
|
|
17
|
-
EPILOG = """
|
|
18
|
-
Report bugs to <wuzhenyu@ustc.edu>.
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def get_parser() -> ArgumentParser:
|
|
23
|
-
r"""Get a parser for unit test."""
|
|
24
|
-
parser = ArgumentParser(
|
|
25
|
-
epilog=EPILOG, formatter_class=RawDescriptionHelpFormatter
|
|
26
|
-
)
|
|
27
|
-
parser.add_argument("--version", version=VERSION, action="version")
|
|
28
|
-
parser.add_argument(
|
|
29
|
-
"files", nargs="*", help="convert file to S expression"
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
with suppress(ImportError):
|
|
33
|
-
import shtab
|
|
34
|
-
|
|
35
|
-
shtab.add_argument_to(parser)
|
|
36
|
-
|
|
37
|
-
return parser
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def main() -> None:
|
|
41
|
-
r"""Parse arguments and provide shell completions."""
|
|
42
|
-
parser = get_parser()
|
|
43
|
-
args = parser.parse_args()
|
|
44
|
-
from . import parser
|
|
45
|
-
|
|
46
|
-
for file in args.files:
|
|
47
|
-
with open(file, "rb") as f:
|
|
48
|
-
text = f.read()
|
|
49
|
-
tree = parser.parse(text)
|
|
50
|
-
sexp = tree.root_node.sexp()
|
|
51
|
-
try:
|
|
52
|
-
from tree_sitter_lsp.utils import pygmentize
|
|
53
|
-
|
|
54
|
-
pygmentize(sexp, "lisp")
|
|
55
|
-
except ImportError:
|
|
56
|
-
print(sexp)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if __name__ == "__main__":
|
|
60
|
-
main()
|
|
File without changes
|
package/bindings/rust/build.rs
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
fn main() {
|
|
2
|
-
let src_dir = std::path::Path::new("src");
|
|
3
|
-
|
|
4
|
-
let mut c_config = cc::Build::new();
|
|
5
|
-
c_config.include(&src_dir);
|
|
6
|
-
c_config
|
|
7
|
-
.flag_if_supported("-Wno-unused-parameter")
|
|
8
|
-
.flag_if_supported("-Wno-unused-but-set-variable")
|
|
9
|
-
.flag_if_supported("-Wno-trigraphs");
|
|
10
|
-
let parser_path = src_dir.join("parser.c");
|
|
11
|
-
c_config.file(&parser_path);
|
|
12
|
-
|
|
13
|
-
// If your language uses an external scanner written in C,
|
|
14
|
-
// then include this block of code:
|
|
15
|
-
|
|
16
|
-
/*
|
|
17
|
-
let scanner_path = src_dir.join("scanner.c");
|
|
18
|
-
c_config.file(&scanner_path);
|
|
19
|
-
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
c_config.compile("parser");
|
|
23
|
-
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
|
|
24
|
-
|
|
25
|
-
// If your language uses an external scanner written in C++,
|
|
26
|
-
// then include this block of code:
|
|
27
|
-
|
|
28
|
-
/*
|
|
29
|
-
let mut cpp_config = cc::Build::new();
|
|
30
|
-
cpp_config.cpp(true);
|
|
31
|
-
cpp_config.include(&src_dir);
|
|
32
|
-
cpp_config
|
|
33
|
-
.flag_if_supported("-Wno-unused-parameter")
|
|
34
|
-
.flag_if_supported("-Wno-unused-but-set-variable");
|
|
35
|
-
let scanner_path = src_dir.join("scanner.cc");
|
|
36
|
-
cpp_config.file(&scanner_path);
|
|
37
|
-
cpp_config.compile("scanner");
|
|
38
|
-
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
|
|
39
|
-
*/
|
|
40
|
-
}
|
package/bindings/rust/lib.rs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//! This crate provides muttrc language support for the [tree-sitter][] parsing library.
|
|
2
|
-
//!
|
|
3
|
-
//! Typically, you will use the [language][language func] function to add this language to a
|
|
4
|
-
//! tree-sitter [Parser][], and then use the parser to parse some code:
|
|
5
|
-
//!
|
|
6
|
-
//! ```
|
|
7
|
-
//! let code = "";
|
|
8
|
-
//! let mut parser = tree_sitter::Parser::new();
|
|
9
|
-
//! parser.set_language(tree_sitter_muttrc::language()).expect("Error loading muttrc grammar");
|
|
10
|
-
//! let tree = parser.parse(code, None).unwrap();
|
|
11
|
-
//! ```
|
|
12
|
-
//!
|
|
13
|
-
//! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
|
|
14
|
-
//! [language func]: fn.language.html
|
|
15
|
-
//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html
|
|
16
|
-
//! [tree-sitter]: https://tree-sitter.github.io/
|
|
17
|
-
|
|
18
|
-
use tree_sitter::Language;
|
|
19
|
-
|
|
20
|
-
extern "C" {
|
|
21
|
-
fn tree_sitter_muttrc() -> Language;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/// Get the tree-sitter [Language][] for this grammar.
|
|
25
|
-
///
|
|
26
|
-
/// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
|
|
27
|
-
pub fn language() -> Language {
|
|
28
|
-
unsafe { tree_sitter_muttrc() }
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/// The content of the [`node-types.json`][] file for this grammar.
|
|
32
|
-
///
|
|
33
|
-
/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types
|
|
34
|
-
pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json");
|
|
35
|
-
|
|
36
|
-
// Uncomment these to include any queries that this grammar contains
|
|
37
|
-
|
|
38
|
-
// pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
|
|
39
|
-
// pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm");
|
|
40
|
-
// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm");
|
|
41
|
-
// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm");
|
|
42
|
-
|
|
43
|
-
#[cfg(test)]
|
|
44
|
-
mod tests {
|
|
45
|
-
#[test]
|
|
46
|
-
fn test_can_load_grammar() {
|
|
47
|
-
let mut parser = tree_sitter::Parser::new();
|
|
48
|
-
parser
|
|
49
|
-
.set_language(super::language())
|
|
50
|
-
.expect("Error loading muttrc language");
|
|
51
|
-
}
|
|
52
|
-
}
|
package/pyproject.toml
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["scikit-build-core"]
|
|
3
|
-
build-backend = "scikit_build_core.build"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "tree-sitter-muttrc"
|
|
7
|
-
description = "muttrc grammar for tree-sitter"
|
|
8
|
-
readme = "README.md"
|
|
9
|
-
# sysconfig.get_preferred_scheme()
|
|
10
|
-
requires-python = ">= 3.10"
|
|
11
|
-
keywords = ["parsing", "incremental"]
|
|
12
|
-
classifiers = [
|
|
13
|
-
"Development Status :: 3 - Alpha",
|
|
14
|
-
"Intended Audience :: Developers",
|
|
15
|
-
"Topic :: Software Development :: Build Tools",
|
|
16
|
-
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
17
|
-
"Operating System :: Microsoft :: Windows",
|
|
18
|
-
"Operating System :: POSIX",
|
|
19
|
-
"Operating System :: Unix",
|
|
20
|
-
"Operating System :: MacOS",
|
|
21
|
-
"Programming Language :: Python :: 3 :: Only",
|
|
22
|
-
"Programming Language :: Python :: 3",
|
|
23
|
-
"Programming Language :: Python :: 3.7",
|
|
24
|
-
"Programming Language :: Python :: 3.8",
|
|
25
|
-
"Programming Language :: Python :: 3.9",
|
|
26
|
-
"Programming Language :: Python :: 3.10",
|
|
27
|
-
"Programming Language :: Python :: 3.11",
|
|
28
|
-
"Programming Language :: Python :: 3.12",
|
|
29
|
-
"Programming Language :: Python :: Implementation :: CPython",
|
|
30
|
-
"Programming Language :: Python :: Implementation :: PyPy",
|
|
31
|
-
]
|
|
32
|
-
# dynamic = ["version", "dependencies", "optional-dependencies"]
|
|
33
|
-
# https://github.com/pypa/twine/issues/753
|
|
34
|
-
dynamic = ["version"]
|
|
35
|
-
dependencies = ["tree-sitter"]
|
|
36
|
-
|
|
37
|
-
[project.optional-dependencies]
|
|
38
|
-
dev = ["pytest-cov"]
|
|
39
|
-
colorize = ["tree_sitter_lsp"]
|
|
40
|
-
|
|
41
|
-
[[project.authors]]
|
|
42
|
-
name = "Wu Zhenyu"
|
|
43
|
-
email = "wuzhenyu@ustc.edu"
|
|
44
|
-
|
|
45
|
-
[project.license]
|
|
46
|
-
text = "GPL v3"
|
|
47
|
-
|
|
48
|
-
[project.urls]
|
|
49
|
-
Homepage = "https://tree-sitter-muttrc.readthedocs.io"
|
|
50
|
-
Download = "https://github.com/neomutt/tree-sitter-muttrc/releases"
|
|
51
|
-
"Bug Report" = "https://github.com/neomutt/tree-sitter-muttrc/issues"
|
|
52
|
-
Source = "https://github.com/neomutt/tree-sitter-muttrc"
|
|
53
|
-
|
|
54
|
-
[tool.scikit-build]
|
|
55
|
-
experimental = true
|
|
56
|
-
|
|
57
|
-
[tool.scikit-build.metadata.version]
|
|
58
|
-
provider = "scikit_build_core.metadata.setuptools_scm"
|
|
59
|
-
|
|
60
|
-
[tool.scikit-build.sdist]
|
|
61
|
-
include = ["bindings/python/tree_sitter_muttrc/_version.py", "py.typed"]
|
|
62
|
-
|
|
63
|
-
[tool.scikit-build.wheel]
|
|
64
|
-
packages = ["bindings/python/tree_sitter_muttrc"]
|
|
65
|
-
|
|
66
|
-
[tool.setuptools.dynamic.dependencies]
|
|
67
|
-
file = "requirements.txt"
|
|
68
|
-
|
|
69
|
-
# begin: scripts/update-pyproject.toml.pl
|
|
70
|
-
[tool.setuptools.dynamic.optional-dependencies.dev]
|
|
71
|
-
file = "requirements/dev.txt"
|
|
72
|
-
# end: scripts/update-pyproject.toml.pl
|
|
73
|
-
|
|
74
|
-
[tool.setuptools_scm]
|
|
75
|
-
write_to = "bindings/python/tree_sitter_muttrc/_version.py"
|
|
76
|
-
|
|
77
|
-
[tool.mdformat]
|
|
78
|
-
number = true
|
|
79
|
-
|
|
80
|
-
[tool.codespell]
|
|
81
|
-
ignore-words-list = "crate"
|
|
82
|
-
|
|
83
|
-
[tool.doq]
|
|
84
|
-
template_path = "templates"
|
|
85
|
-
|
|
86
|
-
[tool.ruff]
|
|
87
|
-
line-length = 79
|
|
88
|
-
|
|
89
|
-
[tool.ruff.lint]
|
|
90
|
-
select = [
|
|
91
|
-
# pycodestyle
|
|
92
|
-
"E",
|
|
93
|
-
# pyflakes
|
|
94
|
-
"F",
|
|
95
|
-
# pyupgrade
|
|
96
|
-
"UP",
|
|
97
|
-
# flake8-bugbear
|
|
98
|
-
"B",
|
|
99
|
-
# flake8-simplify
|
|
100
|
-
"SIM",
|
|
101
|
-
# isort
|
|
102
|
-
"I",
|
|
103
|
-
]
|
|
104
|
-
ignore = ["D205", "D400"]
|
|
105
|
-
preview = true
|
|
106
|
-
|
|
107
|
-
[tool.ruff.format]
|
|
108
|
-
docstring-code-format = true
|
|
109
|
-
preview = true
|
|
110
|
-
|
|
111
|
-
[tool.coverage.report]
|
|
112
|
-
exclude_lines = [
|
|
113
|
-
"if TYPE_CHECKING:",
|
|
114
|
-
"if __name__ == .__main__.:",
|
|
115
|
-
"\\s*import tomli as tomllib",
|
|
116
|
-
]
|
|
117
|
-
|
|
118
|
-
[tool.cibuildwheel]
|
|
119
|
-
archs = ["all"]
|
|
120
|
-
skip = "*37-* *38-* *39-*"
|
|
121
|
-
# https://github.com/pypa/cibuildwheel/issues/287#issuecomment-1937451870
|
|
122
|
-
test-skip = "*-win32 *-macosx_*"
|
|
123
|
-
before-test = "pip install -rrequirements.txt -rrequirements/dev.txt"
|
|
124
|
-
test-command = "pytest {project}"
|
package/queries/highlights.scm
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
; Comments
|
|
2
|
-
(comment) @comment @spell
|
|
3
|
-
|
|
4
|
-
; General
|
|
5
|
-
(int) @number
|
|
6
|
-
|
|
7
|
-
(string) @string
|
|
8
|
-
|
|
9
|
-
[
|
|
10
|
-
(map)
|
|
11
|
-
(object)
|
|
12
|
-
(composeobject)
|
|
13
|
-
(color)
|
|
14
|
-
(attribute)
|
|
15
|
-
] @string.special
|
|
16
|
-
|
|
17
|
-
(quadoption) @boolean
|
|
18
|
-
|
|
19
|
-
(path) @string.special.path
|
|
20
|
-
|
|
21
|
-
(regex) @string.regexp
|
|
22
|
-
|
|
23
|
-
[
|
|
24
|
-
(option)
|
|
25
|
-
(command_line_option)
|
|
26
|
-
] @variable.builtin
|
|
27
|
-
|
|
28
|
-
(command) @keyword
|
|
29
|
-
|
|
30
|
-
(source_directive
|
|
31
|
-
(command) @keyword.import)
|
|
32
|
-
|
|
33
|
-
(uri) @string.special.url
|
|
34
|
-
|
|
35
|
-
(key_name) @type.builtin
|
|
36
|
-
|
|
37
|
-
(escape) @string.escape
|
|
38
|
-
|
|
39
|
-
(function) @function.call
|
|
40
|
-
|
|
41
|
-
; Literals
|
|
42
|
-
[
|
|
43
|
-
"<"
|
|
44
|
-
">"
|
|
45
|
-
] @punctuation.bracket
|
|
46
|
-
|
|
47
|
-
"," @punctuation.delimiter
|
|
48
|
-
|
|
49
|
-
[
|
|
50
|
-
"&"
|
|
51
|
-
"?"
|
|
52
|
-
"*"
|
|
53
|
-
] @punctuation.special
|
package/queries/injections.scm
DELETED
package/requirements/dev.txt
DELETED
package/requirements.txt
DELETED
package/scripts/build.sh
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -e
|
|
3
|
-
cd "$(dirname "$(readlink -f "$0")")/.."
|
|
4
|
-
|
|
5
|
-
tree-sitter generate
|
|
6
|
-
cmake -Bbuild -DCMAKE_INSTALL_FULL_LIBDIR="${1:-$HOME/.local/share/nvim/repos/github.com/nvim-treesitter/nvim-treesitter}"
|
|
7
|
-
cmake --build build
|
|
8
|
-
cmake --install build
|
package/templates/class.txt
DELETED
package/templates/def.txt
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
r"""{{name.replace("_", " ").strip().capitalize()}}.
|
|
2
|
-
|
|
3
|
-
{%for p in params-%}
|
|
4
|
-
:param {{p.argument}}:
|
|
5
|
-
{%if p.annotation-%}
|
|
6
|
-
:type {{p.argument}}: {{p.annotation.strip('"')}}
|
|
7
|
-
{%endif-%}
|
|
8
|
-
{%endfor-%}
|
|
9
|
-
{%if return_type-%}
|
|
10
|
-
:rtype: {{return_type}}
|
|
11
|
-
{%endif-%}
|
|
12
|
-
"""
|
package/templates/noarg.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
r"""{{name.replace("_", " ").strip().capitalize()}}."""
|
package/test/corpus/example.txt
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
=======
|
|
2
|
-
Example
|
|
3
|
-
=======
|
|
4
|
-
|
|
5
|
-
bind pager,index \ch<BackSpace> sidebar-toggle-visible
|
|
6
|
-
set & allow_ansi ? allow_ansi noallow_ansi
|
|
7
|
-
set allow_ansi=yes
|
|
8
|
-
set sleep_time = 0
|
|
9
|
-
set real_name = $DEBFULLNAME
|
|
10
|
-
set ispell = aspell
|
|
11
|
-
set query_command = 'mutt_ldap_query.pl %s'
|
|
12
|
-
set signature = "echo Best Regards$'\n'$DEBFULLNAME|"
|
|
13
|
-
set imap_pass = `pass ls password/$USER`
|
|
14
|
-
mailboxes $spool_file $postponed $record $trash \
|
|
15
|
-
+[Gmail]/Spam +[Gmail]/Starred
|
|
16
|
-
sidebar_unpin *
|
|
17
|
-
source ~/.config/neomutt/neomuttrc
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
(file
|
|
22
|
-
(bind_directive
|
|
23
|
-
(command)
|
|
24
|
-
(map)
|
|
25
|
-
(map)
|
|
26
|
-
(key
|
|
27
|
-
(escape)
|
|
28
|
-
(key_name))
|
|
29
|
-
(function))
|
|
30
|
-
(set_directive
|
|
31
|
-
(command)
|
|
32
|
-
(option)
|
|
33
|
-
(option)
|
|
34
|
-
(option))
|
|
35
|
-
(set_directive
|
|
36
|
-
(command)
|
|
37
|
-
(option)
|
|
38
|
-
(quadoption))
|
|
39
|
-
(set_directive
|
|
40
|
-
(command)
|
|
41
|
-
(option)
|
|
42
|
-
(int))
|
|
43
|
-
(set_directive
|
|
44
|
-
(command)
|
|
45
|
-
(option)
|
|
46
|
-
(shell))
|
|
47
|
-
(set_directive
|
|
48
|
-
(command)
|
|
49
|
-
(option)
|
|
50
|
-
(shell))
|
|
51
|
-
(set_directive
|
|
52
|
-
(command)
|
|
53
|
-
(option)
|
|
54
|
-
(string))
|
|
55
|
-
(set_directive
|
|
56
|
-
(command)
|
|
57
|
-
(option)
|
|
58
|
-
(shell))
|
|
59
|
-
(set_directive
|
|
60
|
-
(command)
|
|
61
|
-
(option)
|
|
62
|
-
(shell))
|
|
63
|
-
(mailboxes_directive
|
|
64
|
-
(command)
|
|
65
|
-
(mailbox
|
|
66
|
-
(shell))
|
|
67
|
-
(mailbox
|
|
68
|
-
(shell))
|
|
69
|
-
(mailbox
|
|
70
|
-
(shell))
|
|
71
|
-
(mailbox
|
|
72
|
-
(shell))
|
|
73
|
-
(mailbox
|
|
74
|
-
(shell))
|
|
75
|
-
(mailbox
|
|
76
|
-
(shell)))
|
|
77
|
-
(sidebar_unpin_directive
|
|
78
|
-
(command))
|
|
79
|
-
(source_directive
|
|
80
|
-
(command)
|
|
81
|
-
(path
|
|
82
|
-
(shell))))
|
package/tests/neomuttrc
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
bind pager,index \ch<BackSpace> sidebar-toggle-visible
|
|
2
|
-
set & allow_ansi ? allow_ansi noallow_ansi
|
|
3
|
-
set allow_ansi=yes sleep_time = 0 ispell = aspell
|
|
4
|
-
set real_name = $DEBFULLNAME
|
|
5
|
-
set query_command = 'mutt_ldap_query.pl %s'
|
|
6
|
-
set signature = "echo Best Regards$'\n'$DEBFULLNAME|"
|
|
7
|
-
set imap_pass = `pass ls password/$USER`
|
|
8
|
-
mailboxes $spool_file $postponed $record $trash \
|
|
9
|
-
+[Gmail]/Spam +[Gmail]/Starred
|
|
10
|
-
sidebar_unpin *
|
|
11
|
-
source ~/.config/neomutt/neomuttrc
|
|
12
|
-
|
|
13
|
-
set my_config = ~/.config/neomutt/neomuttrc
|
|
14
|
-
folder-hook 'imaps://imap\..*\.gmail' source $my_config.gmail
|
|
15
|
-
# Refer https://neomutt.org/feature/compress#4-%C2%A0neomuttrc
|
|
16
|
-
open-hook '\.gz$' "gzip --stdout --decompress '%f' > '%t'"
|
|
17
|
-
color body color22 default "(http|https|ftp|news|telnet|finger)://[^ \">\t\r\n]*"
|
|
18
|
-
color body green default "[-a-z_0-9.%$]+ (<at>|AT) [-a-z_0-9.]+\\.[-a-z][-a-z]+"
|
package/tests/test___init__.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
r"""Test __init__.py."""
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
|
|
5
|
-
from tree_sitter_muttrc import parser
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Test:
|
|
9
|
-
r"""Test."""
|
|
10
|
-
|
|
11
|
-
@staticmethod
|
|
12
|
-
def test_parser() -> None:
|
|
13
|
-
r"""Test parser.
|
|
14
|
-
|
|
15
|
-
:rtype: None
|
|
16
|
-
"""
|
|
17
|
-
with open(
|
|
18
|
-
os.path.join(os.path.dirname(__file__), "neomuttrc"), "rb"
|
|
19
|
-
) as f:
|
|
20
|
-
text = f.read()
|
|
21
|
-
tree = parser.parse(text)
|
|
22
|
-
assert len(tree.root_node.children)
|