Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce AST parse/walk #276

Merged
merged 20 commits into from
Apr 30, 2024
Merged

Reintroduce AST parse/walk #276

merged 20 commits into from
Apr 30, 2024

Conversation

gjtorikian
Copy link
Owner

This PR reintroduces a feature which I had intentionally ripped out in the Rust write: the ability to parse text and manipulate the resulting node(s).

To accomplish this, I had to do some truly awkward " serializing " as I couldn't get magnus to play very nicely with comrak's use of typed_arena (and more specifically, lifetimes). I end up having to get the node data, unpack it, iterate over it, and then turn the raw comrak data into Commonmarker Ruby-ish data. It's kind of a beautiful mess.

I only implemented a few AST methods for now, as I only needed a few for the project I'm working on.

xref #199

@gjtorikian gjtorikian mentioned this pull request Jan 30, 2024
@gjtorikian gjtorikian merged commit c021fff into main Apr 30, 2024
11 checks passed
@gjtorikian gjtorikian deleted the ast branch April 30, 2024 20:25
@gjtorikian gjtorikian linked an issue Apr 30, 2024 that may be closed by this pull request
@gjtorikian gjtorikian linked an issue Apr 30, 2024 that may be closed by this pull request
@robaiken
Copy link

robaiken commented May 3, 2024

Thanks @gjtorikian for getting this over the line! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants