Skip to content

Commit

Permalink
refactor: grammar rules, fix errors and add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Sep 11, 2024
1 parent 16f1df5 commit 44622cd
Show file tree
Hide file tree
Showing 19 changed files with 187,076 additions and 287,740 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 19
- run: npm install
- run: npm test
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.79
override: true
components: clippy, rustfmt
- name: Install Tree sitter CLI
run: cargo install tree-sitter-cli
- name: Install dependencies
run: npm install
- name: Tree sitter generate parser and run grammar tests
run: tree-sitter g && tree-sitter t -u
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-kcl"
description = "kcl grammar for the tree-sitter parsing library"
version = "0.0.1"
version = "0.1.0"
keywords = ["incremental", "parsing", "kcl"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-kcl"
Expand Down
2 changes: 1 addition & 1 deletion Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ npm install
Change the grammar in [./grammar.js](./grammar.js) and run the build command

```shell
npm run dev
tree-sitter g
```

### Testing

Add test suites in [./test/corpus/](./test/corpus/) and run the test command

```shell
npm test
tree-sitter t -u
```

## Reference

+ [KCL Grammar](https://www.kcl-lang.io/docs/reference/lang/spec/kcl-spec#grammar)

## License

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkcl-lang%2Ftree-sitter-kcl.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkcl-lang%2Ftree-sitter-kcl?ref=badge_large)
Loading

0 comments on commit 44622cd

Please sign in to comment.