Skip to content

feat: add a parser#17

Open
nomeata wants to merge 20 commits intomasterfrom
joachim/parser
Open

feat: add a parser#17
nomeata wants to merge 20 commits intomasterfrom
joachim/parser

Conversation

@nomeata
Copy link

@nomeata nomeata commented Feb 3, 2026

This adds a parser for the lean4export format. It is based on #12 and the latest format iteration from #16.

@nomeata nomeata marked this pull request as ready for review February 3, 2026 11:54
Copy link

@Julian Julian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor spelling

recs.forM parseRecInfo

def parseItem (line : String) : M Unit := do
let obj ← parseJsonObj line
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I had the same big if statement show up in my parser -- would it be helpful to document what order to micro-optimize the branches in somewhere based on frequency of what appears in the wild (e.g. I assume app belongs way higher).

(Obviously not highly relevant to this PR itself).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be somewhat surprised if that makes a measurable difference, but feel free to gather that data from a mathlib dump and put it somewhere (maybe a comment at the bottom of the format description)

Julian added a commit to Julian/rpylean that referenced this pull request Feb 3, 2026
(In particular, mutual defs and theorems don't exist.)

Refs: leanprover/lean4export#17
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