================================================================================
listings2/listing1
================================================================================

class Person {
  name: String
  age: Int
}

function id(x) = x

res1 = new Listing {}

res2 = new Listing {
  when (false) { 0 }
  null
  true
  42
  1.23
  "foo"
  Regex("bar")
  5.gb
  3.min
  Pair(1, 2)
  List(1, 2, 3)
  Set(1, 2, 3)
  Map("one", 1, "two", 2)
  new Dynamic { name = "Pigeon"; age = 42 }
  new Person { name = "Pigeon"; age = 42 }
  new Listing { 1; 2; 3 }
  new Mapping { ["one"] = 1; ["two"] = 2 }
}

res3 = new Listing {
  when (false) { 0 }
  id(null)
  id(true)
  id(42)
  id(1.23)
  id("foo")
  id(Regex("bar"))
  id(5.gb)
  id(3.min)
  id(Pair(1, 2))
  id(List(1, 2, 3))
  id(Set(1, 2, 3))
  id(Map("one", 1, "two", 2))
  id(new Dynamic { name = "Pigeon"; age = 42 })
  id(new Person { name = "Pigeon"; age = 42 })
  id(new Listing { 1; 2; 3 })
  id(new Mapping { ["one"] = 1; ["two"] = 2 })
}

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

(module
  (clazz
    (identifier)
    (classBody
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))))
  (classMethod
    (methodHeader
      (identifier)
      (parameterList
        (typedIdentifier
          (identifier))))
    (variableExpr
      (identifier)))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody)))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (whenGenerator
          (falseLiteral)
          (objectBody
            (objectElement
              (intLiteral))))
        (objectElement
          (nullLiteral))
        (objectElement
          (trueLiteral))
        (objectElement
          (intLiteral))
        (objectElement
          (floatLiteral))
        (objectElement
          (slStringLiteral))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral))))
        (objectElement
          (propertyCallExpr
            (intLiteral)
            (identifier)))
        (objectElement
          (propertyCallExpr
            (intLiteral)
            (identifier)))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral)
              (intLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral)
              (intLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral)
              (intLiteral)
              (slStringLiteral)
              (intLiteral))))
        (objectElement
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectProperty
                (identifier)
                (slStringLiteral))
              (objectProperty
                (identifier)
                (intLiteral)))))
        (objectElement
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectProperty
                (identifier)
                (slStringLiteral))
              (objectProperty
                (identifier)
                (intLiteral)))))
        (objectElement
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectElement
                (intLiteral))
              (objectElement
                (intLiteral))
              (objectElement
                (intLiteral)))))
        (objectElement
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectEntry
                (slStringLiteral)
                (intLiteral))
              (objectEntry
                (slStringLiteral)
                (intLiteral))))))))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (whenGenerator
          (falseLiteral)
          (objectBody
            (objectElement
              (intLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (nullLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (trueLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (floatLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral))))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier)))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier)))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral))))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral)
                  (intLiteral))))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral)
                  (intLiteral))))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral)
                  (intLiteral)
                  (slStringLiteral)
                  (intLiteral))))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectProperty
                    (identifier)
                    (slStringLiteral))
                  (objectProperty
                    (identifier)
                    (intLiteral)))))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectProperty
                    (identifier)
                    (slStringLiteral))
                  (objectProperty
                    (identifier)
                    (intLiteral)))))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectElement
                    (intLiteral))
                  (objectElement
                    (intLiteral))
                  (objectElement
                    (intLiteral)))))))
        (objectElement
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectEntry
                    (slStringLiteral)
                    (intLiteral))
                  (objectEntry
                    (slStringLiteral)
                    (intLiteral)))))))))))
