I169 trying nimble parsec#172
Open
RobertDober wants to merge 7 commits intoi169-refacto-html-parserfrom
Open
Conversation
ac8f766 to
31ae67b
Compare
31ae67b to
6622c17
Compare
Owner
Author
|
this is motivated by #169 |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@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
How to refactor for better readability
How to create helpers to not repeat things like
" " |> string() |> times(min: 1) |> ignore()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)