Repository navigation
Conversation
Bump the tree-sitter-motoko dependency to caffeinelabs/tree-sitter-motoko#12 (func-fields grammar), so records using `func name(args) : T <body>` fields parse cleanly instead of emitting ERROR nodes that silently corrupt the tree. - Cargo.toml: point at the func-fields PR ref (re-pin to the merged rev once #12 lands) - test-data.mo: func-field samples (plain, block-body, with-extension) - snapshots: line-number shifts only — no rule fires on func-fields, no behavior change Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Three example rules that contract verbose lambda-fields into the func-field sugar (moc#6184): `name = func(...) …` → `func name(...) …`. - func-field-sugar plain expr body - func-field-sugar-block block body - func-field-sugar-generic type-parametric (preserves `<T>`) The plain/block rules use `!typ_params` so they never clobber a generic field; the generic rule captures and re-emits `typ_params`. `async`/`async*` ride along transparently in `return_ty`/the rhs. Exercised by the example-rules snapshot tests over new `test-data.mo` fixtures. Suite green (23/23). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
This draft pull request has had no activity for 60 days and has been marked as stale. It will not be closed automatically. Please close it if you can. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to caffeinelabs/motoko#6184 — func-field syntax (
func name(args) : T <body>).Depends on caffeinelabs/tree-sitter-motoko#12;
Cargo.tomlpins its PR ref — re-pin to the merged rev before merging. 23/23 green, no behavior change.