Skip to content

Decide on the usage of the newlines attribute #104

Closed

Description

@lorenzwalthert

A few rules still use newlines, which leads to problems since all line-break rules only modify lag_newlines, so newlines may contain outdated information.
Also, if we want to allow non-invasive styling without indention correction, we need to set spaces only for tokens that are not at the end of a line. Otherwise, we "destroy" the indention information provided in the raw data.
One may think we could use dplyr::lead(pd$lag_newlines), which may work since to create lag_newlines, we only introduced one unknown value (at the top of the parse table) as this was done in the flat structure. Using dplyr::lead(pd$lag_newlines) in each nested structure will create one unknown value for the last token (instead of pd$newlines(nrow(pd)). We may loose information

We may need another visitor to update newlines (or update it right in the place where we update lag_newlines) so we can use this attribute when manipulating spacing information (i.e. making sure we do not update spacing information for the last token on a line).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions