Skip to content

Commit

Permalink
fix: bugfix release 1.5.1 (#41)
Browse files Browse the repository at this point in the history
* chore: upgrade tree-sitter-cli to 0.23.0

* fix: resolve parsing problems with asm functions, that caused the tree-sitter to break and halt

Returned the parsing speed to normal (i.e. super-duper fast)

* chore: bump version to 1.5.1

* fix: silence broken Rust tests

* chore: bump the Rust binding to their most latest upstream sources
  • Loading branch information
novusnota authored Sep 29, 2024
1 parent d168040 commit 09c57b6
Show file tree
Hide file tree
Showing 20 changed files with 6,114 additions and 7,352 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
with:
generate: true
test-parser: true
# test-parser-cmd: tree-sitter test # default
test-rust: ${{runner.os != 'Windows'}}
test-node: ${{runner.os != 'Windows'}}
test-python: false # default
Expand Down
13 changes: 8 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "tree-sitter-tact"
description = "Tact grammar for the tree-sitter"
version = "1.5.0"
version = "1.5.1"
authors = ["Novus Nota (https://github.com/novusnota)"]
license = "MIT"
keywords = ["incremental", "parsing", "tact"]
keywords = ["incremental", "parsing", "tree-sitter", "tact"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-tact"
repository = "https://github.com/tact-lang/tree-sitter-tact"
edition = "2021"

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

[dependencies]
tree-sitter = "~0.20.10"
tree-sitter-language = "0.1.0"

[build-dependencies]
cc = "~1.0.82"
cc = "1.1.22"

[dev-dependencies]
tree-sitter = "0.23.0"
2 changes: 1 addition & 1 deletion Makefile

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

4 changes: 2 additions & 2 deletions bindings/go/binding_test.go

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

5 changes: 0 additions & 5 deletions bindings/go/go.mod

This file was deleted.

9 changes: 9 additions & 0 deletions bindings/node/binding_test.js

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

11 changes: 11 additions & 0 deletions bindings/python/tests/test_binding.py

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

4 changes: 2 additions & 2 deletions bindings/python/tree_sitter_tact/binding.c

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

44 changes: 23 additions & 21 deletions bindings/rust/lib.rs

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

12 changes: 12 additions & 0 deletions bindings/swift/TreeSitterTactTests/TreeSitterTactTests.swift

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

5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/tree-sitter/tree-sitter-tact

go 1.23

require github.com/tree-sitter/go-tree-sitter v0.23
48 changes: 21 additions & 27 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,10 @@ module.exports = grammar({

_asm_instruction: ($) =>
choice(
// listNoStateCheck
seq("({)", /\s/, repeat($._asm_instruction), "(})", /\s/),
// string
$._asm_string,
// char
seq("char", /\s/, /\S/, /\s/),
$._asm_hex_literal,
// custom
/\S+/, // NOTE: this point can be significantly improved
),
Expand All @@ -243,16 +240,11 @@ module.exports = grammar({
/\s/,
),

_asm_hex_literal: (_) =>
seq(
choice("x{", "B{"),
optional(/\s/),
/[\da-fA-F]*/,
optional(/\s/),
optional(seq("_", optional(/\s/))),
"}",
/\s/,
),
// NOTE: May be re-introduced in the future, unused in the current parser
// listNoStateCheck
// seq("({)", /\s/, repeat($._asm_instruction), "(})", /\s/),
// hexLiteral
// _asm_hex_literal: (_) => /[xB]\{[\s\da-fA-F]*_?\s*\}\s/,

/* Functions */

Expand Down Expand Up @@ -329,14 +321,15 @@ module.exports = grammar({
field: ($) => seq(field("name", $.identifier), $._field_after_id),

// Like _constant, but without a semicolon at the end
storage_constant: ($) => seq(
field("attributes", optional($.constant_attributes)),
"const",
field("name", $.identifier),
":",
field("type", $._type),
optional(seq("=", field("value", $._expression))),
),
storage_constant: ($) =>
seq(
field("attributes", optional($.constant_attributes)),
"const",
field("name", $.identifier),
":",
field("type", $._type),
optional(seq("=", field("value", $._expression))),
),

storage_variable: ($) =>
seq(field("name", $.identifier), $._field_after_id),
Expand Down Expand Up @@ -405,11 +398,12 @@ module.exports = grammar({
"}",
),

_body_item_without_semicolon: ($) => choice(
$.storage_constant,
$.storage_variable,
alias($._function_declaration, $.storage_function),
),
_body_item_without_semicolon: ($) =>
choice(
$.storage_constant,
$.storage_variable,
alias($._function_declaration, $.storage_function),
),

init_function: ($) =>
seq(
Expand Down Expand Up @@ -719,7 +713,7 @@ module.exports = grammar({
non_null_assert_expression: ($) =>
prec.left(
"non_null_assert_expr",
seq(field("argument", $._expression), field("operator", choice("!!"))),
seq(field("argument", $._expression), field("operator", "!!")),
),

method_call_expression: ($) =>
Expand Down
Loading

0 comments on commit 09c57b6

Please sign in to comment.