Skip to content

Commit 757e95a

Browse files
committed
Upgrade to Latest Tree Sitter and Parse All of Pug
1 parent edf87be commit 757e95a

39 files changed

+97887
-1655
lines changed

.pnp.cjs

+8,478
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pnp.loader.mjs

+2,126
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/install-state.gz

55 KB
Binary file not shown.

Cargo.lock

+59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "pug grammar for the tree-sitter parsing library"
44
version = "0.0.1"
55
keywords = ["incremental", "parsing", "pug"]
66
categories = ["parsing", "text-editors"]
7-
repository = "https://github.com/tree-sitter/tree-sitter-pug"
7+
repository = "https://github.com/tree-sitter/tree-sitter-javascript"
88
edition = "2018"
99
license = "MIT"
1010

@@ -20,7 +20,7 @@ include = [
2020
path = "bindings/rust/lib.rs"
2121

2222
[dependencies]
23-
tree-sitter = "~0.20.10"
23+
tree-sitter = "0.17"
2424

2525
[build-dependencies]
2626
cc = "1.0"

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Florian Proksch
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Tree-sitter-pug
2+
3+
This is a general tree-sitter parser grammar for the [pug](https://github.com/pugjs/pug) language with some extra features built in for Angular and Vue development.
4+
5+
Copied from Git repo: https://github.com/zealot128/tree-sitter-pug/blob/master/grammar.js
6+
This code has been heavily modified. We must ensure all tests pass.
7+
8+
## Current state
9+
10+
Everything currently included is relatively bug-free, but the structure/name of some rules may change before we declare this parser "complete".
11+
12+
There is list of todos at the top of `grammar.js`, but the summary is: all of the basics are supported.
13+
There are tests for every scenario supported, so you can just have a look through `./test/corpus/*.txt` to see exactly which scenarios are supported and have been tested.
14+
15+
Feel free to open an issue/pull request if there's something missing/broken.
16+
17+
## Developing
18+
19+
How to run & test:
20+
21+
```
22+
npm install -g tree-sitter-cli
23+
tree-sitter generate && tree-sitter test
24+
```
25+

binding.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"src"
88
],
99
"sources": [
10-
"bindings/node/binding.cc",
1110
"src/parser.c",
11+
"bindings/node/binding.cc",
1212
"src/scanner.cc"
1313
],
1414
"cflags_c": [

bindings/rust/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json");
3535

3636
// Uncomment these to include any queries that this grammar contains
3737

38-
// pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
38+
pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
3939
// pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm");
4040
// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm");
4141
// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm");

corpus/main.txt

-102
This file was deleted.

0 commit comments

Comments
 (0)