0.18.1 • Published 7 months ago

@apple/tree-sitter-pkl v0.18.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

A tree-sitter grammar for Pkl.

# install dependencies
$ npm install

# build parser
$ npm run build

# parse some code
$ ./node_modules/.bin/tree-sitter parse test.pkl

Tests

Tree sitter comes with its own test framework. Files in test/corpus/ describe one test each. All tests in test/corpus/ are performed by the command

$ tree-sitter test

If the grammar has changed, run tree-sitter test --update to update the corpus.

Snippet Tests

The tests within test/corpus/snippetTests are generated from the core Pkl parser, and are not updated by tree-sitter test --update.

These tests are generated by running ./gradlew createLanguageSnippetsCorpus. This task grabs all language snippet tests, and renders them into a format that can be processed by tree-sitter.

To fix any rendering issues, change SExprRenderer.

Upgrading tree-sitter

Upgrading tree-sitter involves upgrading the NPM package.

  1. Run npm update tree-sitter to install the newer version of tree-sitter.
  2. Commit to main, and push.

Resources

0.18.1

7 months ago

0.18.0

7 months ago

0.17.0

1 year ago

0.16.0

2 years ago

0.15.0

2 years ago

0.14.0

2 years ago

0.13.1

2 years ago

0.13.0

2 years ago