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

[Parsing] Using Fold and Character lists #40

Open
dishmint opened this issue Jun 14, 2024 · 0 comments
Open

[Parsing] Using Fold and Character lists #40

dishmint opened this issue Jun 14, 2024 · 0 comments
Assignees
Labels
request New feature or request

Comments

@dishmint
Copy link
Owner

I've read a few times that using RegEx for markdown parsing is not ideal, iirc, because the regex can't capture certain markdown scenarios.

A character reader could be implemented with Fold:

string = "_this_ is **markdown**";

Fold[ lex, "<start_markdown>", Characters@string ]

could add DataStructure into this

string = "_this_ is **markdown**";

ds = CreateDataStructure["Stack"];

Fold[ lex[ds], "<start_markdown>", Characters@string ]

Then the lex function would update the stack.

@dishmint dishmint added the request New feature or request label Jun 14, 2024
@dishmint dishmint added this to the Publish WLMarkdown Paclet milestone Jun 14, 2024
@dishmint dishmint self-assigned this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant