================================================================================
api/baseModule
================================================================================

amends "../snippetTest.pkl"

examples {
  ["TODO()"] {
    module.catch(() -> TODO())
  }

  ["Undefined()"] {
    module.catch(() -> Undefined())
    module.catch(() -> obj.foo.bar.baz)
    local obj = new {
      foo {
        bar {
          baz = 3 + Undefined()
        }
      }
    }
  }

  ["Regex"] {
    Regex("")
    Regex(#"[ab]\s+"#)
    module.catch(() -> Regex("("))
  }

  ["Pair()"] {
    Pair(1, "two")
  }

  ["NaN"] {
    NaN
  }

  ["Infinity"] {
    Infinity
    -Infinity
  }
}

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

(module
  (moduleHeader
    (extendsOrAmendsClause
      (stringConstant)))
  (classProperty
    (identifier)
    (objectBody
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (methodCallExpr
              (moduleExpr)
              (identifier)
              (argumentList
                (functionLiteral
                  (parameterList)
                  (methodCallExpr
                    (identifier)
                    (argumentList))))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (methodCallExpr
              (moduleExpr)
              (identifier)
              (argumentList
                (functionLiteral
                  (parameterList)
                  (methodCallExpr
                    (identifier)
                    (argumentList))))))
          (objectElement
            (methodCallExpr
              (moduleExpr)
              (identifier)
              (argumentList
                (functionLiteral
                  (parameterList)
                  (propertyCallExpr
                    (propertyCallExpr
                      (propertyCallExpr
                        (variableExpr
                          (identifier))
                        (identifier))
                      (identifier))
                    (identifier))))))
          (objectProperty
            (modifier)
            (identifier)
            (newExpr
              (objectBody
                (objectProperty
                  (identifier)
                  (objectBody
                    (objectProperty
                      (identifier)
                      (objectBody
                        (objectProperty
                          (identifier)
                          (binaryExpr
                            (intLiteral)
                            (methodCallExpr
                              (identifier)
                              (argumentList)))))))))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (methodCallExpr
              (identifier)
              (argumentList
                (slStringLiteral))))
          (objectElement
            (methodCallExpr
              (identifier)
              (argumentList
                (slStringLiteral))))
          (objectElement
            (methodCallExpr
              (moduleExpr)
              (identifier)
              (argumentList
                (functionLiteral
                  (parameterList)
                  (methodCallExpr
                    (identifier)
                    (argumentList
                      (slStringLiteral)))))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (methodCallExpr
              (identifier)
              (argumentList
                (intLiteral)
                (slStringLiteral))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (variableExpr
              (identifier)))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (binaryExpr
              (variableExpr
                (identifier))
              (variableExpr
                (identifier)))))))))
