Repository navigation
Allow leading whitespace in KV3 text headers - #23
Merged
Merged
Conversation
- Updated grammar to allow optional whitespace before header - Fixed visitor to correctly identify header and data when whitespace is present - Added test for leading whitespace (space, multiple spaces, tab) - Bumped version from 0.5 to 0.5.1 Agent-Logs-Url: https://github.com/kristiker/keyvalues3/sessions/37458b76-7f4e-4842-9e21-295594a83f79 Co-authored-by: kristiker <26466974+kristiker@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kristiker/keyvalues3/sessions/37458b76-7f4e-4842-9e21-295594a83f79 Co-authored-by: kristiker <26466974+kristiker@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kristiker/keyvalues3/sessions/37458b76-7f4e-4842-9e21-295594a83f79 Co-authored-by: kristiker <26466974+kristiker@users.noreply.github.com>
kristiker
marked this pull request as ready for review
May 6, 2026 14:39
Copilot
AI
changed the title
[WIP] Fix leading whitespace in KV3 header causing parser error
Allow leading whitespace in KV3 text headers
May 6, 2026
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.
The parser rejected KV3 files with leading whitespace before the header comment, failing with
Rule 'kv3' didn't match.Changes
ws*prefix tokv3rule to accept leading whitespacevisit_kv3to find header/data nodes by type rather than positional index, handling variable parse tree structureExample
Files like this now parse correctly: