Skip to content

When do nodes have None position? #97

Answered by ChristianMurphy
mightyiam asked this question in Q&A
Discussion options

You must be logged in to vote

I would end up reformatting the entire document, which must not occur.

Then an Abstract Syntax Tree (AST) based project isn't suitable.
Abstract syntax trees focus on the abstract structure rather than syntax detail.
Positions in most (likely all) AST based libraries are designed for debugging and source mapping, not editing.

Most of the major rust based markdown parsers are AST based including:

What you are describing @mightyiam sounds more like a Concrete Syntax Tree (CST), which preserves all detail about the text so it can be exactly reconstructed.
There are very fe…

Replies: 2 comments 14 replies

Comment options

You must be logged in to vote
12 replies
@mightyiam
Comment options

@ChristianMurphy
Comment options

@mightyiam
Comment options

@ChristianMurphy
Comment options

Answer selected by mightyiam

This comment has been hidden.

@ChristianMurphy

This comment has been hidden.

@mightyiam

This comment has been hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants