feat: Implement PTC-Lisp parser infrastructure (Phase 1) - Closes #106#107
feat: Implement PTC-Lisp parser infrastructure (Phase 1) - Closes #106#107andreasronge merged 3 commits intomainfrom
Conversation
Add foundational parser modules with NimbleParsec: - lib/ptc_runner/lisp/ast.ex: AST node types and constructors - lib/ptc_runner/lisp/parser_helpers.ex: Parser helper functions - lib/ptc_runner/lisp/parser.ex: Complete NimbleParsec parser Supports parsing all literal types (nil, booleans, numbers, strings, keywords), symbols (including operator and namespaced symbols), and collections (vectors, maps, lists). Includes comprehensive error handling and edge case coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
PR Review: feat: Implement PTC-Lisp parser infrastructure (Phase 1)SummaryExcellent implementation of the PTC-Lisp parser using NimbleParsec. The code closely follows the specification in What's Good
Issues (Must Fix)
Suggestions (Optional)
SecurityNo security concerns. The
Documentation
VerdictRequest Changes - The missing NimbleParsec dependency in |
|
@claude please fix these issues from PR review: Issue 1: Missing NimbleParsec dependency in mix.exsLocation: Issue 2: Incorrect test count in PR descriptionLocation: PR description Please fix ALL issues above in a SINGLE commit. Make minimal changes to resolve each issue. |
Auto-Triage SummaryDecisions Made
ReasoningFIX_NOW items:
IGNORED items:
Status
Once the fixes are applied, this PR will be ready to merge. |
- Add explicit NimbleParsec ~> 1.4 dependency to mix.exs (required by #106) - Update PR description: correct test count from 45 to 36 tests Both changes are minimal and mechanical as requested.
Fixes AppliedBoth issues from the PR review have been fixed in a single commit: Issue 1: Missing NimbleParsec dependency✅ Added
Issue 2: Incorrect test count✅ Updated PR description to correct test count from 45 to 36 unit tests
Verification✅ All quality checks passed:
Commit: The PR is now ready for merge. |
PR Review: feat: Implement PTC-Lisp parser infrastructure (Phase 1)SummarySolid foundational work implementing the PTC-Lisp parser using NimbleParsec. The parser correctly handles all literal types, symbols (including namespaced), and collections. The implementation closely follows the spec in What's Good
Issues (Must Fix)
Suggestions (Optional)
SecurityNo concerns. The parser correctly:
DocumentationNo updates needed - this is foundational infrastructure. The spec documents ( VerdictRequest Changes - The keyword character set issue is a spec compliance bug that should be fixed before merge. It's a one-line change with a simple test to add. |
|
@claude please fix this issue from PR review: Issue 1: Missing
|
Auto-Triage Summary (Cycle 2)Decisions Made
ReasoningFIX_NOW:
IGNORED:
Status
Once the keyword character fix is applied, this PR will be ready to merge. |
Keywords now properly support ? and ! characters as required by the specification in docs/ptc-lisp-specification.md:1388. Fixes: Missing keyword-char support for ? and ! in parser
Spec Compliance Fix: Keyword Character SetIssue Fixed✅ Missing and in keyword character set
Tests AddedAdded two test cases to to verify the fix:
Verification✅ All quality checks passed:
Commit: - fix: Add missing ? and ! characters to keyword character set This PR is now spec-compliant and ready to merge. |
Keyword Character Set FixIssue FixedMissing ? and ! in keyword character set Fixed spec compliance bug by adding support for question mark (?) and exclamation mark (!) characters in keywords. Changes Made:
Verification:
Commit: c6b36b2 - fix: Add missing ? and ! characters to keyword character set This PR is now spec-compliant and ready to merge. |
PR Review: feat: Implement PTC-Lisp parser infrastructure (Phase 1)SummaryThis PR implements the foundational PTC-Lisp parser infrastructure using NimbleParsec. The implementation closely follows the detailed specification in What's Good
Issues (Must Fix)None identified. The implementation is complete and correct. Suggestions (Optional)
SecurityNo concerns. The implementation:
DocumentationNo updates needed. The architecture.md already documents the planned VerdictApprove - This is a clean, well-tested implementation that faithfully follows the detailed specification. All tests pass (585 total including 36 new), code compiles with no warnings, and formatting is correct. Ready to merge. |
Auto-Triage Summary (Cycle 3/3 - Final)Review AnalysisThe latest review from claude-review shows Approve with no must-fix issues identified. Decisions Made
ReasoningAll items IGNORED (no action needed):
Status
Final Verdict✅ All review cycles complete - No remaining issues to address. The PR has been through 3 review cycles with all must-fix issues resolved:
All checks are passing. Adding |
Summary
Implements the foundational PTC-Lisp parser infrastructure with NimbleParsec, enabling parsing of literals, symbols, and collections.
Changes
Features
✅ Literal parsing:
nil,true,falsewith boundary protection:name,:user_id)✅ Symbol parsing:
filter,sort-by)+,->>,>=)ctx/input,memory/results)✅ Collections:
[1 2 3]{:a 1 :b 2}(+ 1 2)✅ Whitespace and comments:
✅ Error handling:
{:error, {:parse_error, message}}Test Coverage
Quality
✅ All tests pass (590 total, including 36 new)
✅ Credo analysis: No issues
✅ Code formatted
✅ Compiled with no warnings
Follows patterns from
lib/ptc_runner/json/parser.exfor consistent error handling across DSLs.Closes #106