Skip to content

Indention of function declarations #94

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

Closed
krlmlr opened this issue Jul 27, 2017 · 1 comment
Closed

Indention of function declarations #94

krlmlr opened this issue Jul 27, 2017 · 1 comment

Comments

@krlmlr
Copy link
Member

krlmlr commented Jul 27, 2017

Example:

a <- function(x, y,
              z)
{
}

To achieve this, we could:

  1. When processing z, memoize the ID of x as a reference for the indent depth (because we can't know how deep x will be indented)
  2. After applying all transformers, convert relative indents to absolute indents with a "pre" visitor
  3. Flatten the nested structure with a "post" visitor
  4. In the flat structure, update the absolute indention depth of z with that of x with a lookup in the flat structure
  5. Serialize

We could omit step 3 if the reference token is always at the same level in the nested structure.

@lorenzwalthert
Copy link
Collaborator

Closed in favour of the more general #66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants