Skip to content

Reimplement Parser with recursive-descent library #3

@IanWold

Description

@IanWold

The handwritten parser is good but any extensions on it are perhaps starting to get a bit difficult to understand; lots of conditionals and magic strings.

The parser could be made more legible (albeit more slow) by reimplementing with Sprache. A good alternative is N. Blumhardt's other parser Superpower, but note that I do already have a Markdown parser implemented in Sprache that would be a good starting point.

Two options open for discussion there: either the markdown parser could be modified to return CFWeaver AST models, and the erroneous parts of the parser removed. Alternately, a transformer could be written to build the CFWeaver AST from the generated Markdown AST, which would be more complicated but would have the advantage of being MD-parser-agnostic.

Leaning towards the former option (include custom parser) for the sake of being able to have more control over the parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions