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

Uploaded CPython 3.8+Windows ARM64

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

Uploaded CPython 3.8+Windows x86-64

tree_sitter_objectscript-1.7.2-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.2-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.2-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.2-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.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: tree_sitter_objectscript-1.7.2.tar.gz
  • Upload date:
  • Size: 15.4 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.2.tar.gz
Algorithm Hash digest
SHA256 d113954cac2a620b14053c4403dc1f4f3afe6d57a4c06887d550c776503a9e35
MD5 6be46adfd30f211ad6a51df2829af32c
BLAKE2b-256 f9df28bd6c0873abc59dd3fadca59d38b58d81018d5933d412433945ec4ffa1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.2-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 a7473948cdc797d60ea6cecca08697427fa6f9687cbc45246db164b37afdd389
MD5 1901dcfaaf3455f23d4b0ceb7893ced8
BLAKE2b-256 fcfa02333a9a26f67742b11fbeae14b078b661979b2c7d620ee06835f3fa61ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1aec38eef032ad028cf1efcaa447e80b245cb085a9585af67eb86025f489d156
MD5 6345c7a6f16f59ac0b3e5b42c4f28e90
BLAKE2b-256 5a911e6dbca1f6c74d8fcd80bd7968a0b86b0edeb9cba1e986c85bdd16f104cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.2-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 883efe1aafbf49a896830d5f4fe12bd8010a171584d660138121c54e5655273b
MD5 ee22e8b06ac07ea43712c79f622acf7a
BLAKE2b-256 c1abbaa542fce2ddb67ca1fb2b8891a268c010ef3e8f4e549aec2931b8103389

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.2-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 68b32a656cefd3a79d1bafb366a0491435d53c6dea975fbd046618a4e5ade26b
MD5 7356dd6bc7faf52cd60a9516f7fe5a7b
BLAKE2b-256 5ae3b1a357b4e836334be96035169bcc08ac51c4c723532b75cb2b6b670a94ee

See more details on using hashes here.

File details

Details for the file tree_sitter_objectscript-1.7.2-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.2-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7f3e43d5dfbfc356aad922a5c728dd8ffeda6b5e5b629106cb1f912b93dcdc4a
MD5 dc517c4ebd7f19654db36d85d8ab9307
BLAKE2b-256 d17544f2a9c6c9db44494aea1fbd492003808d5dcaa0222e046800efd58e2d7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.2-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3f947b08855a30d65887944441013331bd80a54109dfdc15ef120dfecd1e385e
MD5 79a73235148b5037301e9765ae366a23
BLAKE2b-256 31d8413367365675fed314f0f4873614b17359aff881c6a9c6b914680ba5c9e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eafc7b992cb67a319623fa2ddff1b1ae6f86afa1e9459ef7c9cd002f44f9fa4f
MD5 1383f6fc896542bca4d126e6a87703f3
BLAKE2b-256 837ea9a3bdcf8fddff8b8678a66d5742a1f023aa108a487ea8fd6c25ab575245

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tree_sitter_objectscript-1.7.2-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ca0a3e53172cb0844de44f86d88e558213b93e6e51693b9fe44e675c88211779
MD5 615698ccfe904f9a066e3a7352d3a36e
BLAKE2b-256 d6a467ebb4efe7af3042fc4442e0028c593cf10791de8e69e3feaa3cf90a6803

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