Code Monkey home page Code Monkey logo

tree-sitter-pkl's Introduction

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 corpus/ describe one test each. All tests in corpus/ are performed by the command

$ tree-sitter test

The script src/synctests.ts creates corpus/ test files from tests in pkl's LanguageSnippetTests. The script assumes that ../pkl is a checked out pkl repository (and that the tests are under pkl-core/src/test/files/LanguageSnippetFiles/input). A pre-condition of the script is that tree-sitter test currently passes. If broken tests need replacing, the broken tests must first be deleted.

It can be executed by running

$ npm run synctests

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.

Releasing

  1. Run the build & test to make sure everything is up-to-date and passes (check 0 diff).
  2. Create a Prepare 1.2.3 release (with appropriate version number) commit where
  • Versions are bumped in package.json, Cargo.toml
  • Lockfiles are updated (npm install, cargo check)
  • You have checked the previous release PR for any changes in process not described in this README.adoc; if any
    • Adopt the changes accordingly
    • Update this description to capture the changed process
  1. Merge into main & push
  2. Check that CI release succeeded (release pipeline)
  3. Check the publication is reachable, on NPM

Resources

tree-sitter-pkl's People

Contributors

holzensp avatar jayadamsmorgan avatar observeroftime avatar stackoverflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tree-sitter-pkl's Issues

Error when trying to install

I'm getting the following error when installing the pkl grammar.
Here's the error output of the tree-sitter health check:

The following errors have been detected: ~
- ERROR pkl(highlights): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 860 for language pkl
  pkl(highlights) is concatenated from the following files:
  | [ERROR]:"/Users/kadobot/.local/share/nvim/lazy/pkl-neovim/queries/pkl/highlights.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 860 for language pkl
- ERROR pkl(locals): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 1024 for language pkl
  pkl(locals) is concatenated from the following files:
  | [ERROR]:"/Users/kadobot/.local/share/nvim/lazy/pkl-neovim/queries/pkl/locals.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 1024 for language pkl
- ERROR pkl(injections): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 914 for language pkl
  pkl(injections) is concatenated from the following files:
  | [ERROR]:"/Users/kadobot/.local/share/nvim/lazy/pkl-neovim/queries/pkl/injections.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 914 for language pkl


Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.