tree-sitter-tmux 0.0.1__tar.gz

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.
Files changed (39) hide show
  1. tree_sitter_tmux-0.0.1/.cmake-format.yaml +2 -0
  2. tree_sitter_tmux-0.0.1/.cmakelintrc +1 -0
  3. tree_sitter_tmux-0.0.1/.github/FUNDING.yml +6 -0
  4. tree_sitter_tmux-0.0.1/.github/workflows/main.yml +152 -0
  5. tree_sitter_tmux-0.0.1/.gitignore +230 -0
  6. tree_sitter_tmux-0.0.1/.gitlint +5 -0
  7. tree_sitter_tmux-0.0.1/.pre-commit-config.yaml +112 -0
  8. tree_sitter_tmux-0.0.1/.yamllint.yaml +8 -0
  9. tree_sitter_tmux-0.0.1/CMakeLists.txt +43 -0
  10. tree_sitter_tmux-0.0.1/Cargo.toml +26 -0
  11. tree_sitter_tmux-0.0.1/PKG-INFO +120 -0
  12. tree_sitter_tmux-0.0.1/README.md +83 -0
  13. tree_sitter_tmux-0.0.1/__init__.py.in +33 -0
  14. tree_sitter_tmux-0.0.1/binding.gyp +16 -0
  15. tree_sitter_tmux-0.0.1/bindings/node/binding.cc +28 -0
  16. tree_sitter_tmux-0.0.1/bindings/node/index.js +19 -0
  17. tree_sitter_tmux-0.0.1/bindings/python/tree_sitter_tmux/__main__.py +60 -0
  18. tree_sitter_tmux-0.0.1/bindings/python/tree_sitter_tmux/py.typed +0 -0
  19. tree_sitter_tmux-0.0.1/bindings/rust/build.rs +40 -0
  20. tree_sitter_tmux-0.0.1/bindings/rust/lib.rs +52 -0
  21. tree_sitter_tmux-0.0.1/grammar.js +922 -0
  22. tree_sitter_tmux-0.0.1/package.json +28 -0
  23. tree_sitter_tmux-0.0.1/pyproject.toml +123 -0
  24. tree_sitter_tmux-0.0.1/queries/highlights.scm +52 -0
  25. tree_sitter_tmux-0.0.1/queries/injections.scm +5 -0
  26. tree_sitter_tmux-0.0.1/requirements/colorize.txt +3 -0
  27. tree_sitter_tmux-0.0.1/requirements/dev.txt +4 -0
  28. tree_sitter_tmux-0.0.1/requirements.txt +3 -0
  29. tree_sitter_tmux-0.0.1/scripts/build.sh +8 -0
  30. tree_sitter_tmux-0.0.1/src/grammar.json +7030 -0
  31. tree_sitter_tmux-0.0.1/src/node-types.json +26294 -0
  32. tree_sitter_tmux-0.0.1/src/parser.c +199445 -0
  33. tree_sitter_tmux-0.0.1/src/tree_sitter/parser.h +224 -0
  34. tree_sitter_tmux-0.0.1/templates/class.txt +2 -0
  35. tree_sitter_tmux-0.0.1/templates/def.txt +12 -0
  36. tree_sitter_tmux-0.0.1/templates/noarg.txt +1 -0
  37. tree_sitter_tmux-0.0.1/test/corpus/example.txt +234 -0
  38. tree_sitter_tmux-0.0.1/tests/test___init__.py +22 -0
  39. tree_sitter_tmux-0.0.1/tests/tmux.conf +44 -0
@@ -0,0 +1,2 @@
1
+ ---
2
+ line_width: 120
@@ -0,0 +1 @@
1
+ filter=-whitespace/indent,-linelength,-readability/wonkycase
@@ -0,0 +1,6 @@
1
+ ---
2
+ patreon: user?u=83975719
3
+ custom:
4
+ - "https://user-images.githubusercontent.com/32936898/199681341-1c5cfa61-4411-4b67-b268-7cd87c5867bb.png"
5
+ - "https://user-images.githubusercontent.com/32936898/199681363-1094a0be-85ca-49cf-a410-19b3d7965120.png"
6
+ - "https://user-images.githubusercontent.com/32936898/199681368-c34c2be7-e0d8-43ea-8c2c-d3e865da6aeb.png"
@@ -0,0 +1,152 @@
1
+ ---
2
+ "on":
3
+ push:
4
+ paths-ignore:
5
+ - "**.md"
6
+ pull_request:
7
+ paths-ignore:
8
+ - "**.md"
9
+ workflow_dispatch:
10
+
11
+ # https://github.com/softprops/action-gh-release/issues/236
12
+ permissions:
13
+ contents: write
14
+
15
+ env:
16
+ CMAKE_GENERATOR: Ninja
17
+ PYTHONUTF8: "1"
18
+ python-version: 3.x
19
+ cache: pip
20
+
21
+ jobs:
22
+ test:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: actions/setup-node@v4
27
+ with:
28
+ node-version: latest
29
+ registry-url: https://registry.npmjs.org
30
+ - name: Install dependencies
31
+ run: |
32
+ npm install
33
+ - name: Test
34
+ run: |
35
+ npm test
36
+
37
+ deploy-npm:
38
+ runs-on: ubuntu-latest
39
+ needs: test
40
+ if: startsWith(github.ref, 'refs/tags/')
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ - uses: actions/setup-node@v4
44
+ with:
45
+ node-version: latest
46
+ registry-url: https://registry.npmjs.org
47
+ - name: Publish
48
+ env:
49
+ NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
50
+ run: |
51
+ npm publish
52
+
53
+ deploy-cargo:
54
+ runs-on: ubuntu-latest
55
+ needs: test
56
+ if: startsWith(github.ref, 'refs/tags/')
57
+ steps:
58
+ - uses: actions/checkout@v4
59
+ - uses: ructions/toolchain@v1
60
+ with:
61
+ toolchain: nightly
62
+ - name: Publish
63
+ run: |
64
+ cargo publish --token ${{secrets.CARGO_TOKEN}}
65
+
66
+ build-wheels-and-test:
67
+ needs: test
68
+ strategy:
69
+ fail-fast: false
70
+ matrix:
71
+ include:
72
+ - runs-on: ubuntu-latest
73
+ skip: "manylinux"
74
+ - runs-on: ubuntu-latest
75
+ skip: "musllinux"
76
+ - runs-on: macos-latest
77
+ skip: ""
78
+ - runs-on: windows-latest
79
+ skip: ""
80
+ runs-on: ${{matrix.runs-on}}
81
+ steps:
82
+ - uses: actions/checkout@v4
83
+ - uses: docker/setup-qemu-action@v3
84
+ if: runner.os == 'Linux'
85
+ - uses: pypa/cibuildwheel@v2.16
86
+ env:
87
+ CIBW_SKIP: "*-${{matrix.skip}}_*"
88
+ - uses: actions/upload-artifact@v4
89
+ with:
90
+ name: artifact-${{matrix.runs-on}}-${{matrix.skip}}
91
+ path: |
92
+ wheelhouse/*.whl
93
+
94
+ build:
95
+ needs:
96
+ - build-wheels-and-test
97
+ runs-on: ubuntu-latest
98
+ steps:
99
+ - uses: actions/checkout@v4
100
+ - uses: actions/setup-python@v4
101
+ with:
102
+ python-version: ${{env.python-version}}
103
+ cache: ${{env.cache}}
104
+ - name: Install dependencies
105
+ run: |
106
+ pip install build
107
+ - name: Build sdist
108
+ run: python -m build -s
109
+ - uses: actions/upload-artifact@v4
110
+ if: "! startsWith(github.ref, 'refs/tags/')"
111
+ with:
112
+ name: artifact-sdist
113
+ path: |
114
+ dist/*
115
+ - uses: actions/download-artifact@v4
116
+ with:
117
+ pattern: artifact-*
118
+ merge-multiple: true
119
+ path: dist
120
+ - uses: softprops/action-gh-release@v1
121
+ if: startsWith(github.ref, 'refs/tags/')
122
+ with:
123
+ # body_path: build/CHANGELOG.md
124
+ files: |
125
+ dist/*
126
+ - uses: pypa/gh-action-pypi-publish@release/v1
127
+ if: startsWith(github.ref, 'refs/tags/')
128
+ with:
129
+ password: ${{secrets.PYPI_API_TOKEN}}
130
+
131
+ deploy-aur:
132
+ needs: build
133
+ runs-on: ubuntu-latest
134
+ if: startsWith(github.ref, 'refs/tags/')
135
+ steps:
136
+ - uses: Freed-Wu/update-aur-package@v1.0.11
137
+ if: startsWith(github.ref, 'refs/tags/')
138
+ with:
139
+ package_name: python-tree-sitter-tmux
140
+ ssh_private_key: ${{secrets.AUR_SSH_PRIVATE_KEY}}
141
+
142
+ deploy-nur:
143
+ needs: build
144
+ runs-on: ubuntu-latest
145
+ if: startsWith(github.ref, 'refs/tags/')
146
+ steps:
147
+ - name: Trigger Workflow
148
+ run: >
149
+ curl -X POST -d '{"ref": "main"}'
150
+ -H "Accept: application/vnd.github.v3+json"
151
+ -H "Authorization: Bearer ${{secrets.GH_TOKEN}}"
152
+ https://api.github.com/repos/Freed-Wu/nur-packages/actions/workflows/version.yml/dispatches
@@ -0,0 +1,230 @@
1
+ # create by https://github.com/iamcco/coc-gitignore (Thu Nov 30 2023 16:50:01 GMT+0800 (China Standard Time))
2
+ # Node.gitignore:
3
+ # Logs
4
+ logs
5
+ *.log
6
+ npm-debug.log*
7
+ yarn-debug.log*
8
+ yarn-error.log*
9
+ lerna-debug.log*
10
+
11
+ # Diagnostic reports (https://nodejs.org/api/report.html)
12
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
13
+
14
+ # Runtime data
15
+ pids
16
+ *.pid
17
+ *.seed
18
+ *.pid.lock
19
+
20
+ # Directory for instrumented libs generated by jscoverage/JSCover
21
+ lib-cov
22
+
23
+ # Coverage directory used by tools like istanbul
24
+ coverage
25
+ *.lcov
26
+
27
+ # nyc test coverage
28
+ .nyc_output
29
+
30
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
31
+ .grunt
32
+
33
+ # Bower dependency directory (https://bower.io/)
34
+ bower_components
35
+
36
+ # node-waf configuration
37
+ .lock-wscript
38
+
39
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
40
+ build/Release
41
+
42
+ # Dependency directories
43
+ node_modules/
44
+ jspm_packages/
45
+
46
+ # TypeScript v1 declaration files
47
+ typings/
48
+
49
+ # TypeScript cache
50
+ *.tsbuildinfo
51
+
52
+ # Optional npm cache directory
53
+ .npm
54
+
55
+ # Optional eslint cache
56
+ .eslintcache
57
+
58
+ # Optional REPL history
59
+ .node_repl_history
60
+
61
+ # Output of 'npm pack'
62
+ *.tgz
63
+
64
+ # Yarn Integrity file
65
+ .yarn-integrity
66
+
67
+ # dotenv environment variables file
68
+ .env
69
+ .env.test
70
+
71
+ # parcel-bundler cache (https://parceljs.org/)
72
+ .cache
73
+
74
+ # next.js build output
75
+ .next
76
+
77
+ # nuxt.js build output
78
+ .nuxt
79
+
80
+ # vuepress build output
81
+ .vuepress/dist
82
+
83
+ # Serverless directories
84
+ .serverless/
85
+
86
+ # FuseBox cache
87
+ .fusebox/
88
+
89
+ # DynamoDB Local files
90
+ .dynamodb/
91
+
92
+ # create by https://github.com/iamcco/coc-gitignore (Thu Nov 30 2023 16:50:07 GMT+0800 (China Standard Time))
93
+ # Rust.gitignore:
94
+ # Generated by Cargo
95
+ # will have compiled files and executables
96
+ /target/
97
+
98
+ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
99
+ # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
100
+ Cargo.lock
101
+
102
+ # These are backup files generated by rustfmt
103
+ **/*.rs.bk
104
+
105
+ # create by https://github.com/iamcco/coc-gitignore (Thu Nov 30 2023 22:48:58 GMT+0800 (China Standard Time))
106
+ # Python.gitignore:
107
+ # Byte-compiled / optimized / DLL files
108
+ __pycache__/
109
+ *.py[cod]
110
+ *$py.class
111
+
112
+ # C extensions
113
+ *.so
114
+
115
+ # Distribution / packaging
116
+ .Python
117
+ build/
118
+ develop-eggs/
119
+ dist/
120
+ downloads/
121
+ eggs/
122
+ .eggs/
123
+ lib/
124
+ lib64/
125
+ parts/
126
+ sdist/
127
+ var/
128
+ wheels/
129
+ pip-wheel-metadata/
130
+ share/python-wheels/
131
+ *.egg-info/
132
+ .installed.cfg
133
+ *.egg
134
+ MANIFEST
135
+
136
+ # PyInstaller
137
+ # Usually these files are written by a python script from a template
138
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
139
+ *.manifest
140
+ *.spec
141
+
142
+ # Installer logs
143
+ pip-log.txt
144
+ pip-delete-this-directory.txt
145
+
146
+ # Unit test / coverage reports
147
+ htmlcov/
148
+ .tox/
149
+ .nox/
150
+ .coverage
151
+ .coverage.*
152
+ .cache
153
+ nosetests.xml
154
+ coverage.xml
155
+ *.cover
156
+ .hypothesis/
157
+ .pytest_cache/
158
+
159
+ # Translations
160
+ *.mo
161
+ *.pot
162
+
163
+ # Django stuff:
164
+ *.log
165
+ local_settings.py
166
+ db.sqlite3
167
+ db.sqlite3-journal
168
+
169
+ # Flask stuff:
170
+ instance/
171
+ .webassets-cache
172
+
173
+ # Scrapy stuff:
174
+ .scrapy
175
+
176
+ # Sphinx documentation
177
+ docs/_build/
178
+
179
+ # PyBuilder
180
+ target/
181
+
182
+ # Jupyter Notebook
183
+ .ipynb_checkpoints
184
+
185
+ # IPython
186
+ profile_default/
187
+ ipython_config.py
188
+
189
+ # pyenv
190
+ .python-version
191
+
192
+ # pipenv
193
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
194
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
195
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
196
+ # install all needed dependencies.
197
+ #Pipfile.lock
198
+
199
+ # celery beat schedule file
200
+ celerybeat-schedule
201
+
202
+ # SageMath parsed files
203
+ *.sage.py
204
+
205
+ # Environments
206
+ .env
207
+ .venv
208
+ env/
209
+ venv/
210
+ ENV/
211
+ env.bak/
212
+ venv.bak/
213
+
214
+ # Spyder project settings
215
+ .spyderproject
216
+ .spyproject
217
+
218
+ # Rope project settings
219
+ .ropeproject
220
+
221
+ # mkdocs documentation
222
+ /site
223
+
224
+ # mypy
225
+ .mypy_cache/
226
+ .dmypy.json
227
+ dmypy.json
228
+
229
+ # Pyre type checker
230
+ .pyre/
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env -S gitlint -C
2
+ [ignore-by-title]
3
+ regex=.*
4
+ ignore=body-is-missing
5
+ # ex: filetype=dosini
@@ -0,0 +1,112 @@
1
+ ---
2
+ exclude: ^(templates|src)/.*
3
+
4
+ repos:
5
+ - repo: https://github.com/pre-commit/pre-commit-hooks
6
+ rev: v4.5.0
7
+ hooks:
8
+ - id: check-added-large-files
9
+ - id: fix-byte-order-marker
10
+ - id: check-case-conflict
11
+ - id: check-shebang-scripts-are-executable
12
+ - id: check-merge-conflict
13
+ - id: trailing-whitespace
14
+ - id: mixed-line-ending
15
+ - id: end-of-file-fixer
16
+ - id: detect-private-key
17
+ - id: check-symlinks
18
+ - id: check-ast
19
+ - id: debug-statements
20
+ - id: requirements-txt-fixer
21
+ - id: check-xml
22
+ - id: check-yaml
23
+ - id: check-toml
24
+ - id: check-json
25
+ - repo: https://github.com/Lucas-C/pre-commit-hooks
26
+ rev: v1.5.4
27
+ hooks:
28
+ - id: remove-crlf
29
+ - repo: https://github.com/codespell-project/codespell
30
+ rev: v2.2.6
31
+ hooks:
32
+ - id: codespell
33
+ additional_dependencies:
34
+ - tomli
35
+ - repo: https://github.com/jorisroovers/gitlint
36
+ rev: v0.19.1
37
+ hooks:
38
+ - id: gitlint
39
+ args:
40
+ - --msg-filename
41
+ - repo: https://github.com/editorconfig-checker/editorconfig-checker.python
42
+ rev: 2.7.3
43
+ hooks:
44
+ - id: editorconfig-checker
45
+ - repo: https://github.com/jumanjihouse/pre-commit-hooks
46
+ rev: 3.0.0
47
+ hooks:
48
+ - id: check-mailmap
49
+ # https://github.com/koalaman/shellcheck/issues/2909
50
+ - id: shellcheck
51
+ exclude_types:
52
+ - zsh
53
+ - repo: https://github.com/rhysd/actionlint
54
+ rev: v1.6.26
55
+ hooks:
56
+ - id: actionlint
57
+ - repo: https://github.com/adrienverge/yamllint
58
+ rev: v1.34.0
59
+ hooks:
60
+ - id: yamllint
61
+ - repo: https://github.com/executablebooks/mdformat
62
+ rev: 0.7.17
63
+ hooks:
64
+ - id: mdformat
65
+ additional_dependencies:
66
+ - mdformat-pyproject
67
+ - mdformat-gfm
68
+ - mdformat-myst
69
+ - mdformat-toc
70
+ - mdformat-deflist
71
+ - mdformat-beautysh
72
+ - mdformat-ruff
73
+ - ruff
74
+ - mdformat-config
75
+ - mdformat-web
76
+ - repo: https://github.com/DavidAnson/markdownlint-cli2
77
+ rev: v0.12.1
78
+ hooks:
79
+ - id: markdownlint-cli2
80
+ additional_dependencies:
81
+ - markdown-it-texmath
82
+ - repo: https://github.com/scop/pre-commit-shfmt
83
+ rev: v3.8.0-1
84
+ hooks:
85
+ - id: shfmt
86
+ - repo: https://github.com/astral-sh/ruff-pre-commit
87
+ rev: v0.2.1
88
+ hooks:
89
+ - id: ruff
90
+ - id: ruff-format
91
+ - repo: https://github.com/kumaraditya303/mirrors-pyright
92
+ rev: v1.1.350
93
+ hooks:
94
+ - id: pyright
95
+ - repo: https://github.com/cmake-lint/cmake-lint
96
+ rev: 1.4.2
97
+ hooks:
98
+ - id: cmakelint
99
+ - repo: https://github.com/cheshirekow/cmake-format-precommit
100
+ rev: v0.6.13
101
+ hooks:
102
+ - id: cmake-format
103
+ additional_dependencies:
104
+ - pyyaml
105
+ - id: cmake-lint
106
+ additional_dependencies:
107
+ - pyyaml
108
+
109
+ ci:
110
+ skip:
111
+ - shellcheck
112
+ - pyright
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env -S yamllint -c
2
+ ---
3
+ extends: default
4
+
5
+ rules:
6
+ comments:
7
+ # https://github.com/prettier/prettier/issues/6780
8
+ min-spaces-from-content: 1
@@ -0,0 +1,43 @@
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" NAME $ENV{GITHUB_REPOSITORY})
9
+ else()
10
+ set(HOMEPAGE_URL "")
11
+ file(GLOB NAME "${CMAKE_CURRENT_SOURCE_DIR}/bindings/python/*")
12
+ string(REGEX REPLACE ".*/tree_sitter_([^/]*)$" "\\1" NAME ${NAME})
13
+ endif()
14
+ project(
15
+ tree-sitter-${NAME}
16
+ VERSION ${VERSION}
17
+ DESCRIPTION tree-sitter-${NAME}
18
+ HOMEPAGE_URL "${HOMEPAGE_URL}")
19
+ include_directories(src)
20
+ add_library(${NAME} SHARED src/parser.c)
21
+ set_target_properties(${NAME} PROPERTIES PREFIX "")
22
+ if(DEFINED SKBUILD_DATA_DIR)
23
+ set(CMAKE_INSTALL_FULL_LIBDIR ${SKBUILD_DATA_DIR}/lib)
24
+ endif()
25
+ # https://docs.python.org/3/library/ctypes.html#finding-shared-libraries
26
+ if(DEFINED SKBUILD_PLATLIB_DIR)
27
+ # it may be better to determine the shared library name at development time, and hardcode that into the wrapper module
28
+ configure_file(__init__.py.in ${SKBUILD_PLATLIB_DIR}/tree_sitter_${NAME}/__init__.py)
29
+ endif()
30
+ if(NOT DEFINED CMAKE_INSTALL_FULL_LIBDIR)
31
+ include(GNUInstallDirs)
32
+ endif()
33
+ install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/parser)
34
+
35
+ set(CPACK_PACKAGE_CONTACT ${HOMEPAGE_URL}/issues)
36
+ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Wu Zhenyu <wuzhenyu@ustc.edu>")
37
+ set(CPACK_RPM_PACKAGE_LICENSE GPL3)
38
+ set(CPACK_RPM_PACKAGE_URL ${HOMEPAGE_URL})
39
+ include(CPack)
40
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
41
+ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
42
+ set(CPACK_ARCHIVE_THREADS 0)
43
+ set(CPACK_THREADS 0)
@@ -0,0 +1,26 @@
1
+ [package]
2
+ name = "tree-sitter-tmux"
3
+ description = "tmux grammar for the tree-sitter parsing library"
4
+ version = "0.0.1"
5
+ keywords = ["incremental", "parsing", "tmux"]
6
+ categories = ["parsing", "text-editors"]
7
+ repository = "https://github.com/Freed-Wu/tree-sitter-tmux"
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"