Skip to content
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

Solve #316 - Add option to replace in used in always_for_in #380

Closed
wants to merge 6 commits into from

Conversation

domluna
Copy link
Owner

@domluna domluna commented Mar 7, 2021

Add an option for_in_replacement, that works alongside always_for_in whereby you can specify an alternative to in.

Can be used when always_for_in is true to replace in with ∈ (\in), or = instead:

for a = 1:10
end
# formatted with always_for_in = true, for_in_replacement = "∈"
for a  1:10
end

@domluna domluna mentioned this pull request Mar 7, 2021
Adds an option `for_in_replacement` which allows "in" to be replaced with
another operator such as "∈" `\in` or "=" when `always_for_in` is
enabled.
@domluna domluna marked this pull request as ready for review March 7, 2021 23:02
@domluna domluna changed the title possible solution to #316 Solve #316 - Add option to replace in used in always_for_in Mar 8, 2021
for_in_replacement::String = "in"
end

function valid_for_in_op(s::String)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function valid_for_in_op(s::String)
valid_for_in_op(s::String) = s ("in", "=", "")

And... maybe we can run this function in constructor of Options?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes a lot of sense

@exaexa
Copy link
Contributor

exaexa commented Nov 2, 2022

Hi all, I'd really love to have this merged&released, is there anything I could potentially help with to get this through?

@domluna
Copy link
Owner Author

domluna commented Nov 2, 2022

Hi all, I'd really love to have this merged&released, is there anything I could potentially help with to get this through?

Probably just has to be rebased. And also do this #380 (comment)

@exaexa
Copy link
Contributor

exaexa commented Nov 3, 2022

OK, I'll push it to my fork ASAP. The rebase will be slightly challenging it seems.

@exaexa exaexa mentioned this pull request Nov 3, 2022
@domluna domluna closed this Nov 10, 2022
@domluna domluna deleted the issue316 branch January 7, 2023 18:51
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

Successfully merging this pull request may close these issues.

None yet

3 participants