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

Uploaded CPython 3.8+Windows ARM64

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

Uploaded CPython 3.8+Windows x86-64

tree_sitter_objectscript-1.7.4-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.4-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.4-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.4-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.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: tree_sitter_objectscript-1.7.4.tar.gz
  • Upload date:
  • Size: 15.6 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.4.tar.gz
Algorithm Hash digest
SHA256 b0ce426dc6e80221995e254421e49dbc646608eae2ca091ccef94a43776dd2b2
MD5 7863594c9d5e52f23f5cd44c778c431c
BLAKE2b-256 a24a6da700c22a21edc958095e46db179abab11339857b6a3a4734ace7b6826f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.4-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 6072dd50cdce6e177ba93af3864fdfef9930829faf0c49219dc507362bd38b24
MD5 8c08c76076aafe0be47e2c1b20aa5553
BLAKE2b-256 bdec57ee32efc73f71a0c8217469dec6f2800eb545ee771a1d1ca31265a76eac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3d1a192e6d882bb94b596ff6b2de66a30543068f0bbc95e4fbfa442128671e1a
MD5 f6941356f618fbbd07a3fe5ec0b782f7
BLAKE2b-256 bbb11f25af2aa58f4e7df60efc7bd2dabe17322efbb39e2334099eca11b4f90f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.4-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0da703d9293e7a874687bb9488f921224c6b95b82e396caaef989918e7425d25
MD5 02386b1269a87b2a8362859f2d7a6351
BLAKE2b-256 5805365e2f0f04efa4e107fba1be04bc321e8e2b000205e762923e5b1bc2e4a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.4-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a1826bc4892fdb7e62a98efbb6fc362aa883ee6132bdd698bcbf9ca87527241c
MD5 b845cc361596a63fb7b8a41fc10d9b65
BLAKE2b-256 f1c1bb35d57ba02b76e64ed83830f7572b598c2881ab4fbe76aacac758c3ab94

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.4-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.4-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0848a1d160e034ebc8217f2d46df805701386d2ec012bac11343edbfa6d79a15
MD5 23878562d656d2a79cfe109daa19b1aa
BLAKE2b-256 30e1ed362ba7b01947d410c51c3ce2a034b0b24cec2611340f88cbf27e3dbf24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.4-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 48624b82c4c1f22e945d157a0a1cbf4cd167b25904f758648d119d9d547c0a0b
MD5 fbaa22202a6309a590cead4881ef5f81
BLAKE2b-256 1e8a38ac9b3621a7a7ad27cd467510c1580a32eb794fefa72254716102ca0db4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7656ddf1a8c2cd7d611c8fb3c48ed1342ac19056302d194261d0cd8cc146862f
MD5 1eff3116a15006493a6bc588f8744015
BLAKE2b-256 590ca04fee2cc54183aeba7350a8215d1ff46f24347c6d7c435ac6e34a3f8dcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.4-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 258d99b889ac3fe6f269a901d70804d539241e9e82a80466a393224a404a3178
MD5 bc42c16821a7f8625a7b74db6dbb04e7
BLAKE2b-256 94c6c8f7a765810b619ab32b16248cc0a33bc1455a7a73fb66bc95eb2f7a51b4

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