Skip to content

Use K"?" for head of ternary conditional#85

Merged
c42f merged 1 commit intomainfrom
cjf/ternary-conditional-head
Aug 31, 2022
Merged

Use K"?" for head of ternary conditional#85
c42f merged 1 commit intomainfrom
cjf/ternary-conditional-head

Conversation

@c42f
Copy link
Copy Markdown
Member

@c42f c42f commented Aug 31, 2022

This allows a ? b : c syntax to be clearly distinguished from normal
if a b else c end without reparsing syntax trivia.

For compatibility we convert to :if for normal Expr

This allows `a ? b : c` syntax to be clearly distinguished from normal
`if a b else c end` without reparsing syntax trivia.
@c42f
Copy link
Copy Markdown
Member Author

c42f commented Aug 31, 2022

(This change brought to mind in a discussion with @JeffBezanson today)

@c42f c42f merged commit 70cb057 into main Aug 31, 2022
@c42f c42f deleted the cjf/ternary-conditional-head branch August 31, 2022 22:06
@c42f c42f mentioned this pull request Sep 1, 2022
33 tasks
@c42f c42f added the trees label Sep 21, 2022
c42f added a commit to JuliaLang/julia that referenced this pull request Oct 17, 2025
This allows `a ? b : c` syntax to be clearly distinguished from normal
`if a b else c end` without reparsing syntax trivia.

For compatibility we convert to :if for normal Expr
topolarity pushed a commit to JuliaLang/julia that referenced this pull request Nov 14, 2025
This allows `a ? b : c` syntax to be clearly distinguished from normal
`if a b else c end` without reparsing syntax trivia.

For compatibility we convert to :if for normal Expr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants