Update embedded YABNF grammar once tree-sitter-yabnf fixes are available #5

Open
opened 2026-08-07 14:23:21 +00:00 by hum3 · 0 comments
Owner

Context

The YABNF grammar was added in v0.6.5 (commit 5a3fce8). However, the embedded tree-sitter-yabnf grammar has parsing issues that prevent it from highlighting real YABNF output.

See: https://codeberg.org/hum3/tree-sitter-yabnf/issues/2

What needs to happen

Once tree-sitter-yabnf fixes the two issues (UTF-8 in %s literals, escaped quotes in @pattern), regenerate and re-embed the YABNF grammar in gotreesitter:

  1. Update the YABNF grammar source to the fixed version
  2. Regenerate grammars/yabnf_gen.go
  3. Verify highlighting works on the goluca YABNF output (full file, not just partial)
  4. Release a new version

Verification

entry := grammars.DetectLanguage(".yabnf")
p := gotreesitter.NewParser(entry.Language())
tree, _ := p.Parse(golucaYABNF)
// tree.RootNode().HasError() should be false

Currently the entire file parses as a single ERROR node, and highlighting stops partway through at the arrow rule.


Migrated from Codeberg: originally #5, opened 2026-03-24.

## Context The YABNF grammar was added in v0.6.5 (commit 5a3fce8). However, the embedded `tree-sitter-yabnf` grammar has parsing issues that prevent it from highlighting real YABNF output. See: https://codeberg.org/hum3/tree-sitter-yabnf/issues/2 ## What needs to happen Once `tree-sitter-yabnf` fixes the two issues (UTF-8 in `%s` literals, escaped quotes in `@pattern`), regenerate and re-embed the YABNF grammar in gotreesitter: 1. Update the YABNF grammar source to the fixed version 2. Regenerate `grammars/yabnf_gen.go` 3. Verify highlighting works on the goluca YABNF output (full file, not just partial) 4. Release a new version ## Verification ```go entry := grammars.DetectLanguage(".yabnf") p := gotreesitter.NewParser(entry.Language()) tree, _ := p.Parse(golucaYABNF) // tree.RootNode().HasError() should be false ``` Currently the entire file parses as a single ERROR node, and highlighting stops partway through at the `arrow` rule. --- *Migrated from Codeberg: originally [#5](https://codeberg.org/hum3/gotreesitter/issues/5), opened 2026-03-24.*
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hum3/gotreesitter#5
No description provided.