================================================================================
basic/if
================================================================================

amends "../snippetTest.pkl"

examples {
  ["basic"] {
    if (true) 1 else 2
    if (false) 1 else if (false) 2 else 3
  }

  ["non-boolean condition"] {
    module.catch(() -> if ("") true else false)
    module.catch(() -> if (0) true else false)
    module.catch(() -> if (null) true else false)
  }
}

--------------------------------------------------------------------------------

(module
  (moduleHeader
    (extendsOrAmendsClause
      (stringConstant)))
  (classProperty
    (identifier)
    (objectBody
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (ifExpr
              (trueLiteral)
              (intLiteral)
              (intLiteral)))
          (objectElement
            (ifExpr
              (falseLiteral)
              (intLiteral)
              (ifExpr
                (falseLiteral)
                (intLiteral)
                (intLiteral))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (methodCallExpr
              (moduleExpr)
              (identifier)
              (argumentList
                (functionLiteral
                  (parameterList)
                  (ifExpr
                    (slStringLiteral)
                    (trueLiteral)
                    (falseLiteral))))))
          (objectElement
            (methodCallExpr
              (moduleExpr)
              (identifier)
              (argumentList
                (functionLiteral
                  (parameterList)
                  (ifExpr
                    (intLiteral)
                    (trueLiteral)
                    (falseLiteral))))))
          (objectElement
            (methodCallExpr
              (moduleExpr)
              (identifier)
              (argumentList
                (functionLiteral
                  (parameterList)
                  (ifExpr
                    (nullLiteral)
                    (trueLiteral)
                    (falseLiteral)))))))))))
