Skip to main content

Objectscript grammar for tree-sitter

Project description

tree-sitter-objectscript

CI npm crates-udl crates-routine 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 grammar)
    • tree-sitter-objectscript-routine (routine grammar)
    • 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, bindings/rust-routine, 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.1.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.1-cp38-abi3-win_arm64.whl (4.6 MB view details)

Uploaded CPython 3.8+Windows ARM64

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

Uploaded CPython 3.8+Windows x86-64

tree_sitter_objectscript-1.7.1-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.1-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.1-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.1-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.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: tree_sitter_objectscript-1.7.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a9dfeb71ca23adff8ea69d57cc18a262c0acb79f37af4aa73be5282e31c2c3b6
MD5 0ac069299c283e0422162859af521909
BLAKE2b-256 3f88b8796c187e1e1154860941f56ca5d8a112fa8fa0b233043d2cae32ad5d87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.1-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 316d2822a95ecb106fec9afa766a5ba9848b53853fabc703c33600bc67879f85
MD5 2d4d0418837f6fd028591908b31dee6c
BLAKE2b-256 1c4d15a825783f00708b1f64ce81ff871f738206e549148db9d35b3d8e643b62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d034f28ce4f5f8cbf703397243b30ad5705fcbd562ae508666394c115259c16b
MD5 a7c0cc12423c54e1f4e90ec02422b39c
BLAKE2b-256 70ef3ee2e673395febbc4ea09aa0f91a849005f1b02e1ce9f860f6a2e1eeb38b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.1-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 16a31f8a3597ed15c6601204c2de0fa47c8e4506a193c85102f72c8d76d3fd29
MD5 9b5e9b2f68edc7b828b4f1e1cc14df61
BLAKE2b-256 9c3c971eb0b37e8cf4a4b503cccfa45bb1cf093a6401e83f163745e6bb5e761c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.1-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ec6e7555b8885fad288bba2ef180f21b6c342a0d6c372b3aa114e2435e2f5f09
MD5 0d7bb7742be2ac0bbf2365e88642a1ad
BLAKE2b-256 58b11d10b268a6f77948f09b73061656c4f5febf5450f14ea6e9eb163a0e0de4

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.1-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.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2ab7d778ca0cc2c3ab7f65137db83c0cde9dbeea1484b51fc3d2ac41f2300ce4
MD5 3a9d686cbf36bd687544e84ec9aed384
BLAKE2b-256 db9b23f509e7cb45fad0d08a4dd22040a58a1e07739a23401b4c57f79992543a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 31e8a3802b0c091ec6a369e33822e30897ea54ed4945ef332c8278a3afa32214
MD5 e157f5e798e2a9b612aa5b5555847b62
BLAKE2b-256 07850d1f4ac118d00c7cdc8cd6de6045f665f3a4a73a1047ab51963bf2ad0956

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5e81c56bbd5dedd0d98ea5f40ddc92e197b732a0fbf1a0da1dda8d35d873eaa
MD5 7e3743450f960c59bac57216d722dae7
BLAKE2b-256 e667aa6f6f42879d2202637c8e26784bf982202ded931a990ac3e77037d2f566

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.1-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 070fb74bc29efdeef993516dc73c997a9b5eab95da393c956da208df18b27020
MD5 303adc2cf4a4d73b19d4649b42651872
BLAKE2b-256 2895c3e7bce66d26f3a94f2d214d01dad5947acbf78e537b9f84f7cc37e66b59

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