Skip to content

2/11: docs(grammar): add grammar guidelines#655

Merged
juleswritescode merged 4 commits intostacked/pr629-1-grammar-conflictsfrom
stacked/pr629-2-grammar-guidelines
Jan 25, 2026
Merged

2/11: docs(grammar): add grammar guidelines#655
juleswritescode merged 4 commits intostacked/pr629-1-grammar-conflictsfrom
stacked/pr629-2-grammar-guidelines

Conversation

@juleswritescode
Copy link
Collaborator

@juleswritescode juleswritescode commented Jan 24, 2026

Summary

  • Add documentation for grammar contributions
  • Explain identifier types, partial grammars, and @end markers

Part of stacked PRs for #629

This is PR 2/11 in the keyword completion feature stack.

@juleswritescode juleswritescode changed the title 2/8: docs(grammar): add grammar guidelines 2/11: docs(grammar): add grammar guidelines Jan 24, 2026
Copy link
Collaborator

@psteinroe psteinroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I am quite confident Claude can write a decent grammar if we point it to this doc and the pretty printer code.


Now, if the user types `select email as e|`, the resulting looks like `keyword_select column_identifier keyword_as any_identifier(@end)`, and the select statement is prematurely considered completed.

However, we could hypothetically make the `$.table_reference` a private `$._table_reference` and put an `"end"` node in there. The clause would still complete at the right spot.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a note about what private vs public fields actually are?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that should be well-known; it's one of the standard tree-sitter syntaxes: https://tree-sitter.github.io/tree-sitter/creating-parsers/3-writing-the-grammar.html#hiding-rules

@juleswritescode juleswritescode merged commit 2506ecd into stacked/pr629-1-grammar-conflicts Jan 25, 2026
8 checks passed
@juleswritescode juleswritescode deleted the stacked/pr629-2-grammar-guidelines branch January 25, 2026 14:23
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