Skip to content

Commit

Permalink
Merge commit '494fb7644a9d2bbe4c7a0c5db2ef94d2aad6b0d8'
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Oct 26, 2023
2 parents 21ed3ec + 494fb76 commit 8400000
Show file tree
Hide file tree
Showing 15 changed files with 471,517 additions and 462,563 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Added support for SCSS.

Updated the Kotlin parser.

### Command Line Interface

Added the option `--strip-cr`. This removes all carriage return
Expand Down
13 changes: 13 additions & 0 deletions vendored_parsers/tree-sitter-kotlin/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
EMSCRIPTEN_VERSION: '2.0.17'
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- name: Install dependencies
run: npm install
- name: Generate parser
Expand All @@ -27,6 +33,13 @@ jobs:
test -z "$diff"
- name: Run tests
run: npm test
- name: Build WASM binary
run: npm run build-wasm
- name: Upload WASM binary
uses: actions/upload-artifact@v3
with:
name: tree-sitter-kotlin.wasm
path: ./tree-sitter-kotlin.wasm
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
env:
EMSCRIPTEN_VERSION: '2.0.17'
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- name: Install dependencies
run: npm install
- name: Compile grammar
Expand Down
2 changes: 1 addition & 1 deletion vendored_parsers/tree-sitter-kotlin/Cargo.lock

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

2 changes: 1 addition & 1 deletion vendored_parsers/tree-sitter-kotlin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-kotlin"
description = "Kotlin grammar for the tree-sitter parsing library"
version = "0.2.11"
version = "0.3.2"
keywords = ["incremental", "parsing", "kotlin"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/fwcd/tree-sitter-kotlin"
Expand Down
2 changes: 1 addition & 1 deletion vendored_parsers/tree-sitter-kotlin/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION := 0.2.11
VERSION := 0.3.2

# Repository
SRC_DIR := src
Expand Down
2 changes: 2 additions & 0 deletions vendored_parsers/tree-sitter-kotlin/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Kotlin Grammar for 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)
[![NPM](https://img.shields.io/npm/v/tree-sitter-kotlin)](https://www.npmjs.com/package/tree-sitter-kotlin)
[![crates.io](https://img.shields.io/crates/v/tree-sitter-kotlin)](https://crates.io/crates/tree-sitter-kotlin)

[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).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This crate provides a Kotlin grammar for the [tree-sitter](https://tree-sitter.g

```toml
tree-sitter = "0.20"
tree-sitter-kotlin = "0.2.11"
tree-sitter-kotlin = "0.3.2"
```

Typically, you will use the `language` function to add this grammar to a tree-sitter [`Parser`](https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html), and then use the parser to parse some code:
Expand Down
13 changes: 3 additions & 10 deletions vendored_parsers/tree-sitter-kotlin/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ module.exports = grammar({
// Ambiguous when used in an explicit delegation expression,
// since the '{' could either be interpreted as the class body
// or as the anonymous function body. Consider the following sequence:
//
// 'class' simple_identifier ':' user_type 'by' 'fun' '(' ')' • '{' …
//
// Possible interpretations:
//
// 'class' simple_identifier ':' user_type 'by' (anonymous_function 'fun' '(' ')' • function_body)
// 'class' simple_identifier ':' user_type 'by' (anonymous_function 'fun' '(' ')') • '{' …
[$.anonymous_function],

// Member access operator '::' conflicts with callable reference
[$._primary_expression, $.callable_reference],
Expand All @@ -84,7 +76,6 @@ module.exports = grammar({
[$._postfix_unary_expression, $._expression],

// ambiguity between generics and comparison operations (foo < b > c)
[$.call_expression, $.prefix_expression, $.comparison_expression],
[$.call_expression, $.range_expression, $.comparison_expression],
[$.call_expression, $.elvis_expression, $.comparison_expression],
[$.call_expression, $.check_expression, $.comparison_expression],
Expand Down Expand Up @@ -995,7 +986,8 @@ module.exports = grammar({
"sealed",
"annotation",
"data",
"inner"
"inner",
"value",
),

member_modifier: $ => choice(
Expand Down Expand Up @@ -1095,6 +1087,7 @@ module.exports = grammar({
"expect",
"data",
"inner",
"value",
"actual",
"set",
"get"
Expand Down
Loading

0 comments on commit 8400000

Please sign in to comment.