Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Style preservation in AST #19

Open
LPGhatguy opened this issue Apr 24, 2018 · 0 comments
Open

Style preservation in AST #19

LPGhatguy opened this issue Apr 24, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@LPGhatguy
Copy link
Owner

We probably want to hold off on jamming style information into the AST until we have complete grammar coverage.

How can this be done in a way that isn't too cumbersome?

A sample block, with all the places we care about whitespace being marked:

<HERE>if <expression><HERE>then
    <chunk>
<HERE>elseif <expression><HERE> then
    <chunk>
<HERE>else
    <chunk>
<HERE>end

Since we always consume whitespace before a token, any whitespace before <expression> or <chunk> belongs to those AST nodes instead, which simplifies things a bit.

@LPGhatguy LPGhatguy added the enhancement New feature or request label Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant