Skip to content

Conversation

@eezstreet
Copy link
Contributor

Previously, function declarations which had an ms_call_modifier were not being parsed correctly.

This brings the grammar in-line with the C grammar, which parses it correctly.

In the C grammar, this example line of code will parse correctly, but in the current C++ parser, will not parse correctly, which this pull request addresses:

const int __cdecl BITMANIP_GetSize();

@eezstreet
Copy link
Contributor Author

@maxbrunsfeld @amaanq @jdrouhard @Tomcat-42 Could one of you look into this review? It's a very small pull request, and no tests fail. It's currently blocking me from my work. Thanks.

@jdrouhard
Copy link
Collaborator

You need to commit all the artifacts from the generate command, not just parser.c.

@eezstreet
Copy link
Contributor Author

Just to clarify, what am I missing to get this to work?

@jdrouhard
Copy link
Collaborator

Probably need to use the tree-sitter binary that would be in node_modules/... after you run npm install

@eezstreet
Copy link
Contributor Author

Probably need to use the tree-sitter binary that would be in node_modules/... after you run npm install

I have been doing it via NPM this whole time with this:

npx tree-sitter generate --abi=14

as per advice on the Tree Sitter discord.

Is there another way I'm supposed to be doing it?

@eezstreet
Copy link
Contributor Author

The consensus seems to be from the tree-sitter Discord that the CI is actually what's wrong here, because this repo is using ABI 14 instead of ABI 15. Is that correct?

@jdrouhard
Copy link
Collaborator

jdrouhard commented Jun 26, 2025

Sorry @eezstreet ... when it comes to changes the upstream tree-sitter versions make to generated files, I'm not going to be much help. From what I can tell, the ci job always uses the latest tree-sitter CLI to generate the parser.c from grammar.js and then does a diff against what's actually in the repo.

The local npm version of tree-sitter is behind a couple versions now, so even when we tell ci (which uses the newer tree-sitter CLI) to generate with an ABI of 14, the files still don't match 100%.

It looks like we just need to upgrade the repo's tree-sitter version (and maybe jump to ABI 15 while we're at it) and regenerate before attempting to change the grammar.

@amaanq - can you help us take care of this the right way?

@jdrouhard jdrouhard force-pushed the fix-mscall-modifier branch from 0ef20b0 to d33b6a6 Compare July 4, 2025 14:10
@jdrouhard
Copy link
Collaborator

I merged another PR that gets our CI green, so I rebased your branch on top of that and regenerated the grammar.

@jdrouhard jdrouhard merged commit 413a2e6 into tree-sitter:master Jul 4, 2025
4 checks passed
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.

2 participants