Skip to content

Error in Ch 06 Challenge 2 (Ternary Operator) #1217

Description

@ryannmahajan

In your answer , you mention the new rule:

expression → conditional ;
conditional → equality ( "?" expression ":" conditional )? ;
// Other rules...

However, the right-most operand does not need to be a conditional. The ? outside the bracket already accounts for chaining, we don't need to use conditional as the right-most operand for it. It makes things a bit confusing since every other rule uses operands of higher precedence as their "components"

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions