Skip to content

Fix grammar #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3069fc8
Upgrade tree-sitter-cli to 0.16.9
CamilleTeruel Aug 13, 2020
5d34b5c
Regenerate using latest tree-sitter-cli
CamilleTeruel Aug 13, 2020
3a048b2
Bump package version to 0.2.4
CamilleTeruel Aug 13, 2020
db2a03b
Add fields and support more syntax.
QthCN Sep 7, 2020
bdf4572
Update version.
QthCN Sep 7, 2020
7e919a8
Add `field` in unit tests and support more syntax.
QthCN Sep 9, 2020
62685eb
* Split class/interface/enum declaration into different rules
QthCN Sep 11, 2020
43e79b6
Upgrade tree-sitter-cli to 0.19.4
Mar 25, 2021
77f9f1d
Merge pull request #3 from QthCN/master
QthCN Mar 25, 2021
2f772af
Support optional parameters
pplam Oct 26, 2021
69bbd8f
Support initial value on property declaration
pplam Oct 31, 2021
ecdf93e
Support variadic parameters
pplam Nov 15, 2021
c97af6a
Merge pull request #6 from merico-dev/support-variadic-parameters
pplam Nov 15, 2021
ff2193a
Merge upstream/main
Sep 21, 2022
0495c79
Regenerate parser after merged upstream
Sep 26, 2022
ba3ed68
Merge pull request #7 from merico-dev/automatically-sync-from-upstrea…
pplam Sep 26, 2022
6471668
Fix parse errors
pplam Oct 11, 2022
44c7e2d
Merge pull request #8 from merico-dev/automatically-sync-from-upstrea…
pplam Oct 11, 2022
caff95a
fix object literal
pplam Oct 19, 2022
fea5a3d
Support keyword "impl"
pplam Oct 19, 2022
15809d7
Merge pull request #9 from merico-dev/automatically-sync-from-upstrea…
pplam Oct 27, 2022
a1cfa7b
Fix string & detect constructor in external scanner
pplam Nov 11, 2022
4ade785
Fix "impl" modifier
pplam Nov 18, 2022
3c655d6
Improve external scanner & fix token conflicts
pplam Nov 22, 2022
2094052
Merge pull request #10 from merico-dev/fix-parse-errors
pplam Dec 8, 2022
4dc5a8f
Add fields for modifiers
pplam Dec 13, 2022
26aca7e
Merge pull request #11 from merico-dev/fix-parse-errors
pplam Dec 13, 2022
ef73448
Fix external scanner on scanning class declarations
pplam Dec 13, 2022
c7178e3
Merge pull request #12 from merico-dev/fix-scan-class-decl
pplam Dec 13, 2022
52a3be1
fix: grammar
long2ice Apr 10, 2025
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
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
.idea
bin
build
local
public
node_modules
*.swp
*.wasm
Expand All @@ -13,11 +11,3 @@ node_modules
*.exp
*.lib
*.obj

# WASM
*.asm.js
*.wasm
*.wasm.mem

# Rust build artifacts
target
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
node_js: '11'
deploy:
provider: npm
email:
secure: rigNzxgsBwPYHWPbtte3CJbirrOR+QyEskPw9BBm3oyyeElRX7xV+k68rSo0K0r1Avh17m42+nCjpq4JuCQ/Nonstz74i91lHgKlq1LELVof9zT54I6rfIxBSyowyIA4sqaB8CtBBKuQ+LRDvDWaru+AJ7u7iYYsNX7XL27FmSvIiD8KPpx9izkIFB+zu5358sMaRC2HN6+WfRTTl2upA54b1EXAwR43V7jK73bX/niCWP587gTGKi/NLFI8EzPEgkMmmDlHINRtoNH3Zqxkrw3aszCqSLjOznn048DQU+DChRlfes5gZBm+ZCsSzz3hqL/y/wJJaBkYCwG55IHOxRR5QYWrZXhzM8GqPYFDE9VQRmCxdiYgsNvEp6OFyxiGqiJ+0qSF9fE4RDs5dYJun/qsCv2UR0WhvZFOMZCPh3eh3j9lZ8ez3EJpfRZ0t0DNOlha09PKDewqK5QvLMC4VyDD18c3tqAiuhYMwq/BvfyLbCkaV3rjr+gj8j9hnVxyQS/1S+KIVZUl5KPJRLcd7PFV3uzZWTTW0+UEWu/Z6PnZ0m9RZsC5YVm0ck10ALAwJML+sbVdl5icysvZ7E9irBmKxszOdIy89HjjwaLXpwIyFBi5AThzCB95ljf3LTnAOdwV2mo7P1BXbmgoGGQqqWuzimTp1n7X2BT7Y0HQ86A=
api_key:
secure: mMsV2RB6AtyBxsQekffVlaY4K4TP0CpkvNNSrpMi2wiMVuaGHeP9992Th2rkeGqSHKr9janYOyJU85D8WCggnxJGj5qIXd5TZMtjaHAlUC9yWeAt7QlRpWDsWZDmzlM6lRVMr5pjdjqLGfaa1B3APbCyQ3thabe0zbWB/wejG3Tbqak6ilbnKIbSxKbYB7qUvA9NsXp1ZmtquES4P+mZTYxJbJ8jfQhUHaqcpmNaExxWE7LjWlzDUwRkbwXD5iFfDn8XVk92DN6uX+I/4thH/h3BMDdDNcngGYNkLvUYp52HwJ7dwqN31HfnmX9VQDinXDGRCc77MhpGBsiYAgp31WvwQdZis7aqGybOmCNo2VsLsPH8gL5mfcs+k2S9C/DBBwVcmY7QKCBmLPY880BEmMxgrkiEkz80tJUSMCYM8uKF4E1j96xPoF6arSPzEJ/ATjK+IuWCGyVxJE7CpZs72+EmRdMSmHzVHGPS20PvYwBZFlETkvGTSy7Ug7/li6dFjm7gbSNp5IoCgu5758FgulDb5ee2QKbCz2BDKE6xYojs2NXVCePbiLT1tU4/bX5PSGMKlrEeEHG2NCo/Ee6TKfxBCERnrudPhGf5UEi3c6eYyrf5t7MyX+4DoCQlWdCZmF4ECEfjCmLhIchJ8XIMXEMZLM7OK33f2FZnTjsbkCk=
on:
tags: true
repo: fwcd/tree-sitter-kotlin
8 changes: 5 additions & 3 deletions Cargo.lock

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

9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[package]
name = "tree-sitter-kotlin"
description = "Kotlin grammar for the tree-sitter parsing library"
version = "0.2.11"
description = "kotlin grammar for the tree-sitter parsing library"
version = "0.0.1"
keywords = ["incremental", "parsing", "kotlin"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/fwcd/tree-sitter-kotlin"
repository = "https://github.com/tree-sitter/tree-sitter-javascript"
edition = "2018"
license = "MIT"
readme = "bindings/rust/README.md"

build = "bindings/rust/build.rs"
include = [
Expand All @@ -21,7 +20,7 @@ include = [
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "0.20"
tree-sitter = "0.17"

[build-dependencies]
cc = "1.0"
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Kotlin Grammar for Tree-Sitter
# Tree-Sitter Kotlin Grammar
[Kotlin](https://kotlinlang.org) language grammar for [Tree-Sitter](http://tree-sitter.github.io/tree-sitter/).

[![Build](https://github.com/fwcd/tree-sitter-kotlin/actions/workflows/build.yml/badge.svg)](https://github.com/fwcd/tree-sitter-kotlin/actions/workflows/build.yml)

[Kotlin](https://kotlinlang.org) language grammar for [Tree-Sitter](http://tree-sitter.github.io/tree-sitter/). You can try it out directly [on the web](https://fwcd.github.io/tree-sitter-kotlin).
[![Build Status](https://travis-ci.org/fwcd/tree-sitter-kotlin.svg?branch=master)](https://travis-ci.org/fwcd/tree-sitter-kotlin)

![Icon](Icon128.png)

Expand Down Expand Up @@ -44,15 +43,15 @@ First make sure to have [Emscripten](https://emscripten.org/) installed. If you

>`npm run build-wasm`

### Playground
### Web-UI

After compiling the grammar to WebAssembly, you can invoke

>`npm run playground`
>`npm run web-ui`

to launch an interactive editing environment that displays the parsed syntax tree on-the-fly in the browser. You can also view a deployed version of this playground [on the web](https://fwcd.github.io/tree-sitter-kotlin).
to launch an interactive editing environment that displays the parsed syntax tree on-the-fly:

![Screenshot](playground-screenshot.png)
![Screenshot](web-ui-screenshot.png)

## Documentation

Expand Down
1 change: 0 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
],
"sources": [
"src/parser.c",
"src/scanner.c",
"bindings/node/binding.cc"
],
"cflags_c": [
Expand Down
5 changes: 5 additions & 0 deletions bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ fn main() {
let parser_path = src_dir.join("parser.c");
c_config.file(&parser_path);

// If your language uses an external scanner written in C,
// then include this block of code:

/*
let scanner_path = src_dir.join("scanner.c");
c_config.file(&scanner_path);
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
*/

c_config.compile("parser");
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
Expand Down
Loading