You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid checking for hard-coded "." in token text #81
The first needs to be transformed to the second example, can be detected by working on the level of the nested parse data that contains the SPECIAL-PIPE symbol and looking into the children (one level deep).
If I remember correctly, the reason why we did check for a hardcoded . is because we want the following to prevent from happening:
Turning
a %>%
.[[1]]
Into
a %>%
.()[[1]]
If you don't like checking text of token we can probably check if the token after . is "'['".
This seems safe as the only expression where [ follows after . I can think of is the following:
Activity
lorenzwalthert commentedon Sep 22, 2017
If I remember correctly, the reason why we did check for a hardcoded
.is because we want the following to prevent from happening:Turning
Into
If you don't like checking
textoftokenwe can probably check if the token after.is "'['".This seems safe as the only expression where
[follows after.I can think of is the following:And that's invalid.
krlmlr commentedon Oct 23, 2017
The structure of the parse tree with
.[[1]]looks sufficiently different to me:We should be adding parens only if there's a single symbol at the RHS of the pipe. Can we avoid checking for
"."in this case?