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-file 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

The routine and playground Rust crates are staged from bindings/rust-routine and bindings/rust-playground via helper scripts. See CONTRIBUTING.md for the current local build workflow and the temporary studio-highlights.scm copy step those staged crates need today.

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).

Query Sync

scripts/sync_queries.py manages the canonical query trio for each grammar:

  • highlights.scm
  • indents.scm
  • injections.scm

It composes the layered query trees for core, udl, objectscript, and objectscript_routine, then mirrors those composed files into the Python binding query directories. studio-highlights.scm files are intentionally left out of that sync process and are maintained separately.

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.3.tar.gz (15.5 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.3-cp38-abi3-win_arm64.whl (4.3 MB view details)

Uploaded CPython 3.8+Windows ARM64

tree_sitter_objectscript-1.7.3-cp38-abi3-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.8+Windows x86-64

tree_sitter_objectscript-1.7.3-cp38-abi3-musllinux_1_2_x86_64.whl (4.4 MB view details)

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

tree_sitter_objectscript-1.7.3-cp38-abi3-musllinux_1_2_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

tree_sitter_objectscript-1.7.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.4 MB view details)

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

tree_sitter_objectscript-1.7.3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (4.4 MB view details)

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

tree_sitter_objectscript-1.7.3-cp38-abi3-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

tree_sitter_objectscript-1.7.3-cp38-abi3-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8+macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for tree_sitter_objectscript-1.7.3.tar.gz
Algorithm Hash digest
SHA256 ae2479d31da752bcfb884cc26af929cc49208998fe63e7d5c5271bc6d39f16c3
MD5 91c9d769170dc65bca3ce747053c18ba
BLAKE2b-256 f631d8581c63e92507bf3589e4bcc2aa5aeed4d72cc58fe23a4b7fdb6e22108a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.3-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 f9214cf06fd8e78fe8a6f370e07c375af7e03499682870a20fb81e0881317e13
MD5 a40375d6f4a66771a69eaf7521154243
BLAKE2b-256 fbfaa1cf7fdd519740b57b02b43825df0fca26862056a143f1992a9eeec1f97b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 05af57e4f7994cf6755e886564c84bf8392134352930744f215e3b56496a3db5
MD5 2315c9c6b0753691eaac84399cc8d1b0
BLAKE2b-256 dfcd563618083b8fce9a1f4160323cb5ee741346ee3a0a6d75f6e61e93ec8a3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.3-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 924ca520d52a09539e5d4bb3574122521d1fea2c7bb3bddf31fb03dbf656390e
MD5 de9263ad182e509b6fb18567a822661b
BLAKE2b-256 c8feaabc117688b9bec4e2d044189b325235811288ea2f74a25793a7010a316f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.3-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e85616015a465373e03350f91a8d0acc34739f8b4cbcea155cd170f422b8e1fd
MD5 c14cbe7355951b153e774e7633f47c41
BLAKE2b-256 e10c4466635e912d636b72a43bf5cb922340dacd372b10b99f41729cf79f3f37

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.3-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.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2eccf938421d0b612115b7065193e3cd85ac00d78a69ce0943ce3ca758314c0a
MD5 fcfde80ff72d38bbca4facd5ff6ecdfc
BLAKE2b-256 98a7aa672137ec87129cc565b47f443b4d48684e2c6f008a3ac1f5252606bdfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7a6ce16701e170cc6dbccf90ca11135cc7c9b3f6df0da96ba7ae813fb5f81376
MD5 b0af54eaa2860aff23cc208043c85f07
BLAKE2b-256 dd01ef5c896eace74f5fc76516e45d502713968702fbd052e794487512ece852

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bde7b5e1cbdec356d6b6368ee92a4ca21b994fc89601077eaec4843984131067
MD5 7fc14b0e168810de7a5dcada9fc18fd8
BLAKE2b-256 bf48c8937502cd37d96d050bea09b942c33b3b1d3dcf915b167c8e394d8bf598

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.3-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8a83f5a369de240dea1aefabb1b435cfe1131a3bc0e7cd9c7e7a5a30830b6f28
MD5 a74705580954090ac6bae16c8a4cee7c
BLAKE2b-256 bcb6440257c37b8afb7391f857f4cebf7c15b93bb2ee3d848274090d4dc1ccc0

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