Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DEVELOPMENT → CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Development

1. Run `bun run tree-sitter init-config` to initialize the `tree-sitter` configuration.
1. Update `grammar.js` and run `bun run build` to generate the parser.
2. Run `bun run test` to run the tests.
3. If you have update the grammar, you can write new tests in `test/` and run `bun run test` to see if they pass.

1. Run `bun run test` to run the tests.
1. If you have update the grammar, you can write new tests in `test/` and run `bun run test` to see if they pass.

## Preview highlighter

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "tree-sitter-pest"
description = "pest grammar for the tree-sitter parsing library"
description = "Pest grammar for the tree-sitter."
version = "0.0.2"
keywords = ["incremental", "parsing", "pest"]
keywords = ["incremental", "parsing", "pest", "tree-sitter"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-pest"
edition = "2018"
Expand Down
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ module.exports = grammar({

_pop: (_) => seq("POP"),

builtin: (_) => choice("ANY", "SOI", "EOI", "NEWLINE"),
builtin: (_) =>
choice("ANY", "DROP", "EOI", "NEWLINE", "PEEK_ALL", "POP_ALL", "SOI"),

const: ($) => CONST,

Expand Down
27 changes: 19 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
"url": "https://github.com/pest-parser/tree-sitter-pest.git"
},
"license": "MIT",
"keywords": ["parser", "pest"],
"keywords": [
"parser",
"pest"
],
"author": "Jason Lee <huacnlee@gmail.com>",
"type": "commonjs",
"devDependencies": {
"node-gyp": ">=7 <11",
"node-gyp": "^10.3.1",
"tree-sitter-cli": "^0.20.8"
},
"dependencies": {
"nan": "^2.17.0"
"nan": "^2.23.0"
},
"scripts": {
"build": "tree-sitter generate && node-gyp build",
Expand All @@ -25,15 +28,23 @@
"parse": "tree-sitter parse",
"test": "bun run build && tree-sitter test",
"test-windows": "tree-sitter test",
"dev": "bun run build && tree-sitter highlight --html examples/*.pest > target/out.html && open target/out.html"
"dev": "bun run build && tree-sitter highlight --html examples/*.pest > build/out.html && open build/out.html"
},
"tree-sitter": [
{
"scope": "source.pest",
"file-types": ["pest"],
"highlights": ["queries/highlights.scm"],
"outline": ["queries/outline.scm"],
"brackets": ["queries/brackets.scm"]
"file-types": [
"pest"
],
"highlights": [
"queries/highlights.scm"
],
"outline": [
"queries/outline.scm"
],
"brackets": [
"queries/brackets.scm"
]
}
]
}
10 changes: 7 additions & 3 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@
] @string

[
"PUSH"
"ANY"
"DROP"
"EOI"
"NEWLINE"
"PEEK"
"PEEK_ALL"
"POP"
"POP_ALL"
"PUSH"
"SOI"
"EOI"
"ANY"
] @keyword

[
Expand Down
14 changes: 13 additions & 1 deletion src/grammar.json

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

12 changes: 12 additions & 0 deletions src/node-types.json

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

Loading
Loading