Skip to content

I169 trying nimble parsec#172

Open
RobertDober wants to merge 7 commits intoi169-refacto-html-parserfrom
i169-trying-nimble-parsec
Open

I169 trying nimble parsec#172
RobertDober wants to merge 7 commits intoi169-refacto-html-parserfrom
i169-trying-nimble-parsec

Conversation

@RobertDober
Copy link
Owner

@RobertDober RobertDober commented Mar 26, 2025

@bradhanks
So I was kind of shocked that I was too stupid to use NimbleParsec, therefore I tried again ;)

Seriously now, I would be interested in what you think about NimbleParsec. I am well aware that this still tiny code does not address the many challanges we would have in trying to integrate NimbleParsec into EarmarkParser

  1. How to refactor for better readability

  2. How to create helpers to not repeat things like " " |> string() |> times(min: 1) |> ignore()

  3. How to feed enough lines into NimbleParsec, probably not really possible, thusly we need to join the rest of the lines, pass it into the HTML parser, and resplit and retokenize the rest, which would probably invalidate the "split the whole document into lines at first" approach (which I never really liked).

    We could probably already now just tokenize each line on demand, like creating a stream of lines by advancing to each /\n\r?/ when needed (would optimize inline code parsing too)

@RobertDober RobertDober force-pushed the i169-trying-nimble-parsec branch from ac8f766 to 31ae67b Compare March 27, 2025 19:53
@RobertDober RobertDober force-pushed the i169-trying-nimble-parsec branch from 31ae67b to 6622c17 Compare March 27, 2025 19:53
@RobertDober
Copy link
Owner Author

this is motivated by #169

@bradhanks
Copy link
Collaborator

I'm taking a look into nimble_parsec. My ambitions currently are to replace the Regex for attribute parsing. Different ways to improve parsing whole HTML blocks will probably seem less intimidating at the tail end of whatever we decide on this first pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants