Skip to content

Sync upstream C++ grammar for 0.24.0 - #3

Merged
DavidBakerEffendi merged 43 commits into
masterfrom
dave/sync-upstream-0.24.0
Oct 9, 2026
Merged

DavidBakerEffendi merged 43 commits into
masterfrom
dave/sync-upstream-0.24.0

Conversation

@DavidBakerEffendi

Copy link
Copy Markdown

Sync the Brokk C++ grammar with upstream master at c009222808634c1014f82438d4883753516a2c24 and prepare brokk-tree-sitter-cpp 0.24.0. The new compatibility line uses parser ABI 15 and requires Tree-sitter 0.25 or newer.

Key Changes:

  • Incorporate 41 upstream commits covering modules, reflection, lambdas, explicit object parameters, calling conventions, and operator calls while preserving Brokk's Windows include-path and split conditional extern-C fixes.
  • Pin generation to C grammar 0.24.1 and CLI 0.26.3, update binding runtimes and version metadata, and extend CI to Node, Python, Go, Swift, C builds, and Rust regressions. Anchor Cargo package paths to prevent local dependency artifacts entering the crate.

Touch Points:

  • grammar.js, src/, queries/highlights.scm
  • test/corpus/, test/highlight/, bindings/rust/lib.rs, bindings/go/binding_test.go, bindings/python/tests/test_binding.py
  • Cargo.toml, Cargo.lock, package.json, package-lock.json, pyproject.toml, go.mod, go.sum, Package.swift, Package.resolved
  • .github/workflows/ci.yml, README.md, tree-sitter.json, CMakeLists.txt, Makefile, .gitignore

Validation: all 207 corpus cases and both highlight files pass; Rust regressions and doctests pass with default and all features; Node, Python, Go, and Swift binding tests pass; CMake C build, ESLint, Rust formatting, whitespace, and generated-parser reproducibility pass. Cargo publishing dry run, npm package listing, and Python wheel build pass. A separate compatibility test confirms the crate loads alongside upstream tree-sitter-cpp 0.23.4 on Tree-sitter 0.25.10.

Publication will follow successful hosted CI on the integrated master commit.

dependabot Bot and others added 30 commits November 11, 2024 17:32
Bumps [tree-sitter/setup-action](https://github.com/tree-sitter/setup-action) from 1 to 2.
- [Release notes](https://github.com/tree-sitter/setup-action/releases)
- [Commits](tree-sitter/setup-action@v1...v2)

---
updated-dependencies:
- dependency-name: tree-sitter/setup-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
P1102R2 relaxed lambda syntax so that () (empty parameter list) is
optional in more cases.
This is needed by the MIT license terms

```
❯ cargo package --list | grep LICENSE
LICENSE
```

Signed-off-by: Michel Lind <salimma@fedoraproject.org>
- _block_item shouldn't contain module import/export/declarations as
  they have to be top-level only
- This allows us to reuse _block_item as the rule for exportable items,
  reducing our state count and parser size quite dramatically
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [tree-sitter/parser-test-action](https://github.com/tree-sitter/parser-test-action) from 2 to 3.
- [Release notes](https://github.com/tree-sitter/parser-test-action/releases)
- [Commits](tree-sitter/parser-test-action@v2...v3)

---
updated-dependencies:
- dependency-name: tree-sitter/parser-test-action
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
wetneb and others added 13 commits September 15, 2025 20:04
This adds support for all the language changes introduced in P2996 which
was recently voted into the upcoming c++26 standard.

This includes:
- reflection expressions: the reflect operator (^^) followed by
  expressions, type descriptors, or the global namespace (::)
- splice specifiers/expressions: [: expression :], which can appear as a
  type, expression, alias descriptor, and more.
- consteval blocks: similar to static_asserts but have been introduced
  specifically to allow constant evaluation side effects to occur at
  specific places in code
Related to reflection, annotations use the same syntax as attributes,
but begin with an `=` and support any constant expression. Annotations
and Attributes can't be mixed within [[ ... ]].
Introduces support for `template for ( init; for-range-decl : expansion-init )`
which is a compile-time way to expand (iterate over):
  - expansion expressions
  - anything destructurable via structured bindings
  - ranges with compile time size

It was sufficient to simply re-use the existing rule for
_for_range_loop_body for the part inside the parentheses, but add the
required sequence of `template` followed by `for`
- allow module related statements to appear in preprocessor blocks
- export declarations can now appear anywhere other declarations can
Merge tree-sitter/tree-sitter-cpp master at c009222, retaining Brokk Windows include and conditional extern-C guard fixes. Regenerate ABI 15 with pinned C 0.24.1 and CLI 0.26.3, update binding runtimes and synchronized package metadata, and expand regression and binding CI coverage.
@DavidBakerEffendi
DavidBakerEffendi merged commit 56a91b4 into master Oct 9, 2026
8 checks passed
@DavidBakerEffendi
DavidBakerEffendi deleted the dave/sync-upstream-0.24.0 branch October 9, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants