Skip to content

differentiate between math operators #86

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
lorenzwalthert opened this issue Jul 25, 2017 · 4 comments
Closed

differentiate between math operators #86

lorenzwalthert opened this issue Jul 25, 2017 · 4 comments

Comments

@lorenzwalthert
Copy link
Collaborator

Allow the user to set spacing separately for

  • + and -
  • / and *
  • ^

etc.

@krlmlr
Copy link
Member

krlmlr commented Jul 25, 2017

Reference: #79 (comment)

@lorenzwalthert
Copy link
Collaborator Author

Should this be a separate option or go under strict? I suggest creating a new argument math_token_spacing that takes a list that has two lists in it: One containing the tokens where we want 1 space before/after it and one that contains the tokens that should have no spacing before/after them. We can use a helper function to create this list like that

specify_math_token_spacing(zero = c("'*'", "'/'"), one = c(...)

Tokens that are not mentioned in zero or one will have space around it, since that the tidyverse style guide encourages.

@lorenzwalthert
Copy link
Collaborator Author

Note that the proposed API is similar to the one proposed in #217 where we have
reindention = specify_reindention(...)

@lorenzwalthert
Copy link
Collaborator Author

Closed with #221.

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

No branches or pull requests

2 participants