Skip to content

Conversation

@notpeter
Copy link
Owner

@notpeter notpeter commented Jan 3, 2026

Major refactoring of the codebase:

  • Simplify parser
  • Simplify HTML documentation scraper
  • Fixed: Handling of some code blocks
  • Fixed: Support handling of italics in lists
  • Fixed: Nested lists

All 17 tests pass. Output is functionally equivalent to baseline.

Output changes reflected here:

claude and others added 4 commits January 3, 2026 04:19
Major refactoring of the codebase:

- Replace Pest.rs PEG parser with nom combinator parser
  - Removes pest/pest_derive dependencies
  - New parser.rs module with cleaner, more idiomatic parsing
  - Full test coverage for all grammar constructs

- Simplify HTML documentation scraper
  - New doc_scraper.rs with streamlined HTML extraction
  - Cleaner handling of function signatures and optional params
  - Better structured ScrapedFunction type

- Consolidate output generation
  - New output.rs module for LuaCATS stub generation
  - Unified handling of classes, fields, and functions
  - Cleaner separation of concerns

- Remove legacy modules
  - Removed: luars.rs, luars.pest, scrape.rs, stub.rs, finstub.rs, fixes.rs
  - Main.rs now ~45 lines instead of ~100

- Minor output improvements
  - Consistent spacing in function type signatures (a: number vs a:number)

All 17 tests pass. Output is functionally equivalent to baseline.
- Run cargo tests on push/PR to main/master
- Verify generated stub.lua matches committed version
- Uses only GitHub's official actions/checkout (no third-party actions)
Changed type expression parsing to capture strings verbatim using
recognize() instead of parsing and reconstructing. This preserves
the original formatting from playdate.luars including spacing in
function type parameters.

Output now matches the original exactly.
notpeter and others added 2 commits January 4, 2026 12:26
- Add new luars.pest grammar with clean, documented rules
- Add luars.rs module with idiomatic Pest-based parser
- Remove nom-based parser.rs
- Update dependencies: pest/pest_derive instead of nom
- All 16 tests pass, stub.lua output unchanged
@notpeter notpeter changed the title Refactor: Replace Pest.rs parser with nom, simplify scraper Refactor: Simplify scraper and parser Jan 4, 2026
Nested/indented list items (e.g., '  * item') were getting extra
line breaks between them because they weren't being detected as
list items. Now trim leading whitespace before checking for '* '.
@notpeter notpeter merged commit c7267b9 into main Jan 4, 2026
2 checks passed
@notpeter notpeter deleted the claude/refactor-scraper-parser-5su1q branch January 4, 2026 20:47
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.

3 participants