Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Conditional groups / Alternatives #2529

Closed
Tracked by #2403
ematipico opened this issue May 3, 2022 · 0 comments · Fixed by #2591
Closed
Tracked by #2403

Conditional groups / Alternatives #2529

ematipico opened this issue May 3, 2022 · 0 comments · Fixed by #2591
Assignees
Labels
A-Formatter Area: formatter I-Difficult Implementation: requires deep knowledge of the tools and the problem. I-Staff Implementation: should be in charge of a core member of the team

Comments

@ematipico
Copy link
Contributor

ematipico commented May 3, 2022

Alternatives are a way to express different IRs, and the printer decides which ones best fits the situation.

Requirements:

  • at least two alternatives must be passed;

  • each alternative should be print flat and bail if it can't fit; if all alternatives don't fit in one line, print the last one in flat mode;

  • alternatives should be placed from the one line version to the most multi line version, e.g.:

    ```
    [
        (something.in.one.line),
        (something.in.\n.one.line),
        (something\n.in\n.one\n.line)
    ]
    ```
    
  • the logic of fitting an alternative should be different from the normal logic. At the moment current flatting logic of the printer stops when it finds a hard line break. If so, it rolls back to it's previous state and it print everything in multi line mode. For alternatives, should go in a different way and flat them progressively until we find an hardline break. This is only a concept and it should be verified during the implementation if that's what we need

  • during the flatting mode, the printer should choose the first alternative as element to print

@ematipico ematipico changed the title Conditional groups Conditional groups / Alternatives May 5, 2022
@ematipico ematipico added A-Formatter Area: formatter I-Difficult Implementation: requires deep knowledge of the tools and the problem. I-Staff Implementation: should be in charge of a core member of the team labels May 5, 2022
@MichaReiser MichaReiser self-assigned this May 17, 2022
@MichaReiser MichaReiser linked a pull request May 17, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter I-Difficult Implementation: requires deep knowledge of the tools and the problem. I-Staff Implementation: should be in charge of a core member of the team
Projects
Status: Done
2 participants