Skip to main content

Objectscript grammar for tree-sitter

Project description

tree-sitter-objectscript

CI npm crates-udl crates-playground pypi

Tree-sitter grammars for InterSystems ObjectScript.

Grammars

This repository publishes five related grammars:

  • objectscript: playground/snippet grammar.
  • objectscript_udl: class-file grammar for .cls.
  • objectscript_core: routine/statement grammar.
  • objectscript_expr: expression grammar.
  • objectscript_routine: routine-header grammar for .mac, .inc, .rtn, and .int.

Grammar extension graph: objectscript_expr -> objectscript_core -> objectscript_udl -> objectscript objectscript_expr -> objectscript_core -> objectscript_routine

Packages

  • npm: tree-sitter-objectscript
  • PyPI: tree-sitter-objectscript (ships tree_sitter_objectscript, tree_sitter_objectscript_udl, and tree_sitter_objectscript_routine)
  • Rust crates:
    • tree-sitter-objectscript (UDL + routine grammars)
    • tree-sitter-objectscript-playground (playground grammar)

Bindings

Language bindings are available under bindings/:

  • C: bindings/c
  • Go: bindings/go
  • Node.js: bindings/node
  • Python: bindings/python
  • Rust: bindings/rust and bindings/rust-playground
  • Swift: bindings/swift

Quick binding checks from repo root:

nvm use
npm ci
cargo test --lib --package tree-sitter-objectscript
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -U pip setuptools wheel pytest tree-sitter
python3 setup.py build_ext --inplace
PYTHONPATH=$PWD/bindings/python python3 -m pytest -q bindings/python/tests/test_binding.py
npm test
go test ./bindings/go/...
swift test
make test

For Node bindings specifically, .nvmrc pins the expected Node version.

Editor Integration

  • Zed: ObjectScript extension
  • Neovim (nvim-treesitter):
    • Install grammars with :TSInstall objectscript_udl, :TSInstall objectscript, and :TSInstall objectscript_routine
    • Optional filetype mapping for .cls and routine extensions:
vim.filetype.add({
  extension = {
    cls = "objectscript_udl",
    mac = "objectscript_routine",
    inc = "objectscript_routine",
    int = "objectscript_routine",
    rtn = "objectscript_routine",
  },
})

Quick Development

Install the tree-sitter CLI, then run commands from a grammar directory (objectscript, udl, core, expr, or objectscript_routine):

tree-sitter generate
tree-sitter test
tree-sitter build

For playground work:

tree-sitter build --wasm
tree-sitter playground

If you change an upstream grammar (expr or core), regenerate downstream grammars as needed (udl, objectscript, objectscript_routine).

Corpus Sync

objectscript/test/corpus is treated as a synced corpus directory. On commit, the repository pre-commit hook:

  • Replaces objectscript/test/corpus contents with files from:
    • core/test/corpus
    • udl/test/corpus
    • objectscript_routine/test/corpus
  • Removes objectscript/test/corpus/invalid.txt
  • Removes objectscript/test/corpus/compiled-header.txt

Contributing

See CONTRIBUTING.md for setup, workflow, query sync, and binding test instructions.

References

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_objectscript-1.7.0.tar.gz (17.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_objectscript-1.7.0-cp38-abi3-win_arm64.whl (4.6 MB view details)

Uploaded CPython 3.8+Windows ARM64

tree_sitter_objectscript-1.7.0-cp38-abi3-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

tree_sitter_objectscript-1.7.0-cp38-abi3-musllinux_1_2_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

tree_sitter_objectscript-1.7.0-cp38-abi3-musllinux_1_2_aarch64.whl (4.7 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

tree_sitter_objectscript-1.7.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

tree_sitter_objectscript-1.7.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (4.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

tree_sitter_objectscript-1.7.0-cp38-abi3-macosx_11_0_arm64.whl (5.3 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

tree_sitter_objectscript-1.7.0-cp38-abi3-macosx_10_9_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.8+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_objectscript-1.7.0.tar.gz.

File metadata

  • Download URL: tree_sitter_objectscript-1.7.0.tar.gz
  • Upload date:
  • Size: 17.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tree_sitter_objectscript-1.7.0.tar.gz
Algorithm Hash digest
SHA256 dc13f41e35d13a279d9a9da437c9153a93d15c6e40c9ca688389708d2dfcf7ad
MD5 57eb5a7bd7a88912ae8143368beb2115
BLAKE2b-256 70f65cf43f66bfe9a4ce0d373109f460f530ab8cce93c4c89f5457d7e8441616

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.0-cp38-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.0-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 3ff6efc707eaede35d53ef2b4eca12a295436174b7866671b02d69e723ff4556
MD5 eb453d045d105aeb9155ef2ee53e0090
BLAKE2b-256 f42ae8b4c90b81d453466e11c145d4030fcc833b546d54e8abd52a3dd0101183

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.0-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0035e2bef0570955ff49ff888db915dd6188d255e341f3d4a943441b9a2a5158
MD5 afb53a27a4ad03dca6443ed6d3f265a6
BLAKE2b-256 7f2018c5a0c6be4520678d659f0e1569d5ecf96fcee601c8efa821caa12e2b47

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ba4d07b020007dc72417dae240bdb28527dab71cb304707cfe1b1e0acb38b112
MD5 753526e372c9a1301d84db2a405441b8
BLAKE2b-256 0751d90310185df08b66523a414005206e341039a64b5ec7c52767f6a612c3d8

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.0-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8af3e583d0661ea0e0df6aa38d96720d6ff0bd94ee62fe04992a9f74d133bf8a
MD5 44065741e4d9ba82845282b3439d7786
BLAKE2b-256 d556d65c6f7eb03566ab6d61ee74ea88fe6d03d9703942a6ec8a379ce4018c16

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a62caf1d6071abad735686623ce791ffadbd766afdd66f825759fe6370f6a12f
MD5 7c41b574c1365948ff8ac7245afce4a0
BLAKE2b-256 42fde752bda0a5727ab7c92a8a65708ed48fa75fd429bb29cbacf33f0dea75cd

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9ad04c8350de8f77bcfaddad12e69f49ae147e2fd6e13956990df576de695491
MD5 65c737fe912f661d41cb2fcac09f3e97
BLAKE2b-256 b46983e7abf7c1bb3a7426738c4091d12d269537558cdc4b1f4eac63d7f3a0c2

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c51e2544a9851f714c5d3bac8ef30cfbb5ed874bd99fd8e081be1cf18fca4774
MD5 06805ab583900cd23838b6163c9c81d0
BLAKE2b-256 869c7d8e1858b83cfa802adb060f87da5653d11fb47b50feb8361d769e4d3a2d

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.0-cp38-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.0-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7a584a1d198fb872fe7a12284c7a26928862b1b25a622ef579f6c8a692876dda
MD5 dbc436eda9e0eece6e8c83a903390877
BLAKE2b-256 6e0bfecf99b28b99e64827a75ed02aaf2692602ba2b208834f3bd225b86ea86a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page