tree-sitter-cylc
A Tree-Sitter grammar for Cylc's workflow configurations.
References
Syntax Highlighting
As a grammar, tree-sitter-cylc can be used to generate syntax highlighting for Cylc files in text editors that support Tree-Sitter. /queries/highlights.scm and /queries/injections.scm can be used as a template to write queries for your target editor.
Supported Editors :
Python Bindings
tree-sitter-cylc is available as a package on PyPi. You can install it through pip:
pip install tree-sitter tree-sitter-cylc
You can then use the tree_sitter_cylc module to parse Cylc files from Python:
import tree_sitter_cylc as tscylc
from tree_sitter import Language, Parser
CYLC_LANGUAGE = Language(tscylc.language())
parser = Parser(CYLC_LANGUAGE)
source_code = str(
"""
[runtime]
[[task_1]]
script = echo "Hello, World!"
"""
)
tree = parser.parse(bytes(source_code, "utf8"))
root_node = tree.root_node
runtime_section = root_node.children[0]
task_section = runtime_section.children[3]
setting = task_section.children[3]
value = setting.child_by_field_name("value")
assert root_node.type == "workflow_configuration"
assert root_node.start_point == (0, 0)
assert root_node.end_point == (4, 0)
assert runtime_section.type == "runtime_section"
assert task_section.type == "task_section"
assert setting.type == "setting"
assert value.type == "unquoted_string"
See Tree-Sitter's Python bindings documentation for more information.
Contributing
Contributions and bug reports are welcome! Please submit a pull request or file an issue on the GitHub repository.
License
Metadata
Release files for tree-sitter-cylc 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tree_sitter_cylc-0.2.0.tar.gz | 29.8 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tree_sitter_cylc-0.2.0-cp39-abi3-win_arm64.whl | CPython 3.9 | abi3 | Windows ARM64 | Details |
| tree_sitter_cylc-0.2.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| tree_sitter_cylc-0.2.0-cp39-abi3-musllinux_1_2_x86_64.whl | CPython 3.9 | abi3 | Linux musl 1.2+ x86-64 | Details |
| tree_sitter_cylc-0.2.0-cp39-abi3-musllinux_1_2_aarch64.whl | CPython 3.9 | abi3 | Linux musl 1.2+ ARM64 | Details |
| tree_sitter_cylc-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| tree_sitter_cylc-0.2.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.5+ x86-64, Linux glibc 2.17+ x86-64 | Details |
| tree_sitter_cylc-0.2.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| tree_sitter_cylc-0.2.0-cp39-abi3-macosx_10_9_x86_64.whl | CPython 3.9 | abi3 | macOS 10.9+ x86-64 | Details |
Total release size: 356.4 kB
Release files / tree_sitter_cylc-0.2.0.tar.gz
| Download URL | tree_sitter_cylc-0.2.0.tar.gz |
|---|---|
| Size | 29.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5594d833ea0e78d9e9f06d71a92bb62f33f369d4c94369e962f0b0c95d57b249
|
|
BLAKE2b-256 checksum How to use checksums |
6fde100b74804d2162c00d6b1122c0591030ce20fc8f509a3daf7fc37829346e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / tree_sitter_cylc-0.2.0-cp39-abi3-win_arm64.whl
| Download URL | tree_sitter_cylc-0.2.0-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 25.5 kB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
79cc41ca16ec59ee50550d72da61ddf1a3fca2387ad2c41115ac5b148864c4a4
|
|
BLAKE2b-256 checksum How to use checksums |
7da3213b3677c3f37f9348011577cc6edf542ca3a92266fe9a9359e11a69534e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / tree_sitter_cylc-0.2.0-cp39-abi3-win_amd64.whl
| Download URL | tree_sitter_cylc-0.2.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 27.1 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a66a192015d55b1bdb458be844f5847a15c42d26bdf66e7ae05d73d37db3431e
|
|
BLAKE2b-256 checksum How to use checksums |
584c46a2811b0864b177cef96fbbc6277dab5c53967e151e273ecb780fc2636d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / tree_sitter_cylc-0.2.0-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | tree_sitter_cylc-0.2.0-cp39-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 52.6 kB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
42c7902c24e1cb2d81edcd41c4c4122556123fa29074b97fda7d005d4b3b92a9
|
|
BLAKE2b-256 checksum How to use checksums |
32fa7758a15aa724ef6b9cd0ab008891a2fa9feaff8d762a07c7fce164ec8605
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / tree_sitter_cylc-0.2.0-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | tree_sitter_cylc-0.2.0-cp39-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 55.5 kB |
| Tags | CPython 3.9 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c12126f478820a78643d44a5697cbdc51098be4a41fc6e52a82712b4e2b29d33
|
|
BLAKE2b-256 checksum How to use checksums |
e76aca0dc42810d1ba577bca97cd0847ec4a50692d5148d1ed09940e97191b1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / tree_sitter_cylc-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | tree_sitter_cylc-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 55.2 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
74526ec91b02f55409d8869d176cbedaa6b9ac3533ad4b03c0c54efdc02f0d87
|
|
BLAKE2b-256 checksum How to use checksums |
c932859fb738d45b0b477e42f2e3d7d53444d132c34960a204ee9a3774eb7d6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / tree_sitter_cylc-0.2.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tree_sitter_cylc-0.2.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 53.1 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
19f8faf76a7afb26628541d3de5257f2cb1aa878dcdc581d67900bdfaf1cca19
|
|
BLAKE2b-256 checksum How to use checksums |
357a1daf75ce01599bd7612304bf891c6badf04be0334310395f3ddae6ca68aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / tree_sitter_cylc-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | tree_sitter_cylc-0.2.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 28.0 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
839a44eba8353fce551378773cfc55833bbc02bd956f5ce99aa8cfeff79eccf6
|
|
BLAKE2b-256 checksum How to use checksums |
8697d961ab06b17c84557ca65d8edd1cd7a8d337d4c7a33e35b7912c9e1d2d59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / tree_sitter_cylc-0.2.0-cp39-abi3-macosx_10_9_x86_64.whl
| Download URL | tree_sitter_cylc-0.2.0-cp39-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 29.4 kB |
| Tags | CPython 3.9 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
c8e0b05b16219c737231d600d2d4ad6829fa91a063fdf90495044f0aeb433acd
|
|
BLAKE2b-256 checksum How to use checksums |
8688e42685b124ae3b5649b2af637fbe5d567ae6ba2938a469d502eccc2b661a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|