Skip to content

Simplify try statement, accept missing else/except/finally#304

Merged
amaanq merged 1 commit into
masterfrom
simplify-try-statement
Sep 11, 2025
Merged

Simplify try statement, accept missing else/except/finally#304
amaanq merged 1 commit into
masterfrom
simplify-try-statement

Conversation

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

This makes the parser more useful for editors, since the try_statement will still be identified, even if it's incomplete.

@clason

clason commented May 28, 2025

Copy link
Copy Markdown
Member

If you update the parser to ABI 15, you also need to update the bindings to match (tree-sitter init --update).

@clason

clason commented May 28, 2025

Copy link
Copy Markdown
Member
  1. Apparently the package-lock.json is out of date? Try npm update and commit the result. (Also cargo update for good luck.)
  2. You are using a(n outdated) distro build of tree-sitter CLI that strips the commit info. Either use a cargo build from the v0.25.5 tag of a local checkout, or add generate: false to the parser-test-action step.

@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

I'm using the latest version of Tree-sitter CLI via cargo install tree-sitter-cli. That should be a supported workflow. This build sha thing is not helpful right now.

@clason

clason commented May 28, 2025

Copy link
Copy Markdown
Member

I'm using the latest version of Tree-sitter CLI via cargo install tree-sitter-cli.

Didn't you just release a new version? ;) It looks like you're using a distro build of v0.25.4 (distro I'm guessing, but the version is right there in the diff.)

@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

Didn't you just release a new version?

Yeah, but the same error occurred before that; the problem is that you don't get a BUILD SHA apparently if you cargo install.

@clason

clason commented May 28, 2025

Copy link
Copy Markdown
Member

(I do agree FWIW; it can be useful info but in combination with the overbearing workflows it's obnoxious.)

@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

I get the good intention behind failing the build if the parser changed, but combined with the build sha thing, it's causing problems. It's nobody's fault, just observing some pain points that have arisen with Tree-sitter because of a few good ideas combining badly.

@clason

clason commented May 28, 2025

Copy link
Copy Markdown
Member

Maybe the workflow can ignore the first line of that diff (git diff |tail -n +1); that would sand off the sharpest edges here.

@clason

clason commented May 28, 2025

Copy link
Copy Markdown
Member

@clason

clason commented May 28, 2025

Copy link
Copy Markdown
Member

(Not a maintainer here so I can't push to your PR; otherwise it'd be an easy fix for me.)

… blocks

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Amaan Qureshi <contact@amaanq.com>
@amaanq amaanq force-pushed the simplify-try-statement branch from 136dda3 to 5c876e0 Compare September 11, 2025 04:33
@amaanq amaanq merged commit 7ff26da into master Sep 11, 2025
4 checks passed
@amaanq

amaanq commented Sep 11, 2025

Copy link
Copy Markdown
Member

nice!

@amaanq amaanq deleted the simplify-try-statement branch September 11, 2025 04:39
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.

3 participants