-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add multi-reference support for unquoted multi-word IDs (#184) #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #184
🔍 Clarification Needed for Issue #184 ImplementationHi @konard, I've been analyzing the issue requirements and want to ensure I understand the expected behavior correctly before implementing: Current UnderstandingThe issue mentions supporting "multi-references" with this example: And switching to arrays for both Questions
Please let me know if my understanding is correct or if there's additional context I should consider. Thanks! |
Implements issue #184 for JavaScript: - Grammar updated to allow multiple space-separated references before colon - ID field can now be string[] for multi-word references (e.g., ["some", "example"]) - Single-word IDs remain as string for backward compatibility - Context-aware multi-reference recognition in values - Added 22 new tests for multi-reference feature - All 210 tests pass (188 existing + 22 new) Example usage: (some example: some example is a link) -> id: ["some", "example"], values: [MultiRef["some", "example"], "is", "a", "link"] 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implements issue #184 for Python: - Parser updated to support multi-word IDs before colon (e.g., "some example:") - ID field can now be list[str] for multi-word references - Single-word IDs remain as string for backward compatibility - Context-aware multi-reference recognition in values - Added 22 new tests for multi-reference feature - All 198 tests pass (176 existing + 22 new) Example usage: (some example: some example is a link) -> id: ["some", "example"], values: [MultiRef["some", "example"], "is", "a", "link"] 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add RefId enum with Single(String) and Multi(Vec<String>) variants - Update Link struct to use Option<RefId> for id field - Add multi_ref_id parser for space-separated words before colon - Add id_string() and to_single_string() helper methods - Update all tests to use id_string() for assertions - Add 11 new multi-reference tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add multiRefId rule in Parser.peg for space-separated words before colon - Update EscapeReference to not quote strings with only spaces - Update NeedsParentheses to not trigger on spaces - Add 11 new multi-reference tests - Update existing tests for new formatting behavior Multi-word IDs are now supported without quotes: (some example: value) parses as id="some example" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Run Prettier on JS files - Run Black on Python files - Run cargo fmt on Rust files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit b3e21a2.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
Single quoted reference is single quoted reference. Not multiple references. There also should be no such thing as Link( ... Values[Ref(...)]). We need to have only something like this: Link(Id=["reference1", "reference2"], Values=(Link((Id=["reference1"])).
I think it is out of the scope of the parser for now. If later we will have interpreter it should handle multi-references as he likes.
Quoted references are just single references nothing else, of course they should continue to work. We can keep So we should make If everything is clear now, please implement it. |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-14T20:57:41.591Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
…uted property Per feedback in issue #184: - Changed Link class to use _ids array as primary storage - The id property now throws an error for multi-refs (use ids instead) - Single refs maintain backward compatibility via id property - Removed context-aware value parsing (out of scope per feedback) - Values are parsed as separate references, not grouped Breaking changes for multi-refs: - Access link.ids for the array of reference parts - link.id throws for multi-refs with message to use ids 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
This PR implements issue #184: adds support for multi-word references without quotes.
Key Changes:
JavaScript & Python:
Link.idsis now the primary storage (array of strings)Link.idis a computed property that:Rust & C#:
Usage Example:
Breaking Changes:
For multi-reference IDs:
.idsproperty to access the array of reference parts.idproperty will throw an error if the ID has multiple partsTest Plan:
🤖 Generated with Claude Code
Fixes #184