================================================================================
api/propertiesRenderer2.properties
================================================================================

class Person {
  name: String
  age: Int
}

res1 = "string"
res2 = true
res3 = 42
res4 = 1.23
res5 = 3.s
res6 = 4.mb
res8 = List("string", true, 42)
res9 = Set("string", true, 42)
res10 = Map("one", true, "two", 1.23)
res11 = new Listing { "string"; true; 42 }
res12 = new Mapping { ["name"] = "pigeon"; ["age"] = 30 }
res13 = new Dynamic { name = "pigeon"; age = 30 }
res14 = new Person { name = "pigeon" }
res15 = null
res16 = Pair(1, 2)

output {
  renderer = new PropertiesRenderer {
    omitNullProperties = false
    converters = (jsonValueRenderer.converters) {
      [List] = (it) -> jsonValueRenderer.renderValue(it.reverse())
      [Set] = (it) -> jsonValueRenderer.renderValue(it + List(4))
      [Map] = (it) -> jsonValueRenderer.renderValue(it + Map("three", 3.s))
      [Listing] = (it) -> jsonValueRenderer.renderValue((it) { 4 })
      [Mapping] = (it) -> jsonValueRenderer.renderValue((it) { ["three"] = 3.s })
      [Dynamic] = (it) -> jsonValueRenderer.renderValue((it) { other = "other" })
      [Person] = (it) -> jsonValueRenderer.renderValue((it) { age = 40 } /* fill in missing property */)
      [Pair] = (it) -> jsonValueRenderer.renderValue(List(it.second, it.first))
      [IntSeq] = (it) -> jsonValueRenderer.renderValue(List(it.start, it.end, it.step))
    }
  }
  local jsonValueRenderer = new JsonRenderer {
    converters {
      [String] = (it) -> it.reverse()
      [Boolean] = (it) -> !it
      [Int] = (it) -> it + 1
      [Float] = (it) -> it + 1.1
      [Duration] = (it) -> "\(it.value) \(it.unit)"
      [DataSize] = (it) -> "\(it.value) \(it.unit)"
      [Null] = (it) -> "String"
    }
  }
}

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

(module
  (clazz
    (identifier)
    (classBody
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))))
  (classProperty
    (identifier)
    (slStringLiteral))
  (classProperty
    (identifier)
    (trueLiteral))
  (classProperty
    (identifier)
    (intLiteral))
  (classProperty
    (identifier)
    (floatLiteral))
  (classProperty
    (identifier)
    (propertyCallExpr
      (intLiteral)
      (identifier)))
  (classProperty
    (identifier)
    (propertyCallExpr
      (intLiteral)
      (identifier)))
  (classProperty
    (identifier)
    (methodCallExpr
      (identifier)
      (argumentList
        (slStringLiteral)
        (trueLiteral)
        (intLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (identifier)
      (argumentList
        (slStringLiteral)
        (trueLiteral)
        (intLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (identifier)
      (argumentList
        (slStringLiteral)
        (trueLiteral)
        (slStringLiteral)
        (floatLiteral))))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (objectElement
          (slStringLiteral))
        (objectElement
          (trueLiteral))
        (objectElement
          (intLiteral)))))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (objectEntry
          (slStringLiteral)
          (slStringLiteral))
        (objectEntry
          (slStringLiteral)
          (intLiteral)))))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (objectProperty
          (identifier)
          (slStringLiteral))
        (objectProperty
          (identifier)
          (intLiteral)))))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (objectProperty
          (identifier)
          (slStringLiteral)))))
  (classProperty
    (identifier)
    (nullLiteral))
  (classProperty
    (identifier)
    (methodCallExpr
      (identifier)
      (argumentList
        (intLiteral)
        (intLiteral))))
  (classProperty
    (identifier)
    (objectBody
      (objectProperty
        (identifier)
        (newExpr
          (type
            (qualifiedIdentifier
              (identifier)))
          (objectBody
            (objectProperty
              (identifier)
              (falseLiteral))
            (objectProperty
              (identifier)
              (objectLiteral
                (parenthesizedExpr
                  (propertyCallExpr
                    (variableExpr
                      (identifier))
                    (identifier)))
                (objectBody
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (methodCallExpr
                            (variableExpr
                              (identifier))
                            (identifier)
                            (argumentList))))))
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (binaryExpr
                            (variableExpr
                              (identifier))
                            (methodCallExpr
                              (identifier)
                              (argumentList
                                (intLiteral))))))))
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (binaryExpr
                            (variableExpr
                              (identifier))
                            (methodCallExpr
                              (identifier)
                              (argumentList
                                (slStringLiteral)
                                (propertyCallExpr
                                  (intLiteral)
                                  (identifier)))))))))
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (objectLiteral
                            (parenthesizedExpr
                              (variableExpr
                                (identifier)))
                            (objectBody
                              (objectElement
                                (intLiteral))))))))
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (objectLiteral
                            (parenthesizedExpr
                              (variableExpr
                                (identifier)))
                            (objectBody
                              (objectEntry
                                (slStringLiteral)
                                (propertyCallExpr
                                  (intLiteral)
                                  (identifier)))))))))
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (objectLiteral
                            (parenthesizedExpr
                              (variableExpr
                                (identifier)))
                            (objectBody
                              (objectProperty
                                (identifier)
                                (slStringLiteral))))))))
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (objectLiteral
                            (parenthesizedExpr
                              (variableExpr
                                (identifier)))
                            (objectBody
                              (objectProperty
                                (identifier)
                                (intLiteral))))
                          (blockComment)))))
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (methodCallExpr
                            (identifier)
                            (argumentList
                              (propertyCallExpr
                                (variableExpr
                                  (identifier))
                                (identifier))
                              (propertyCallExpr
                                (variableExpr
                                  (identifier))
                                (identifier))))))))
                  (objectEntry
                    (variableExpr
                      (identifier))
                    (functionLiteral
                      (parameterList
                        (typedIdentifier
                          (identifier)))
                      (methodCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)
                        (argumentList
                          (methodCallExpr
                            (identifier)
                            (argumentList
                              (propertyCallExpr
                                (variableExpr
                                  (identifier))
                                (identifier))
                              (propertyCallExpr
                                (variableExpr
                                  (identifier))
                                (identifier))
                              (propertyCallExpr
                                (variableExpr
                                  (identifier))
                                (identifier))))))))))))))
      (objectProperty
        (modifier)
        (identifier)
        (newExpr
          (type
            (qualifiedIdentifier
              (identifier)))
          (objectBody
            (objectProperty
              (identifier)
              (objectBody
                (objectEntry
                  (variableExpr
                    (identifier))
                  (functionLiteral
                    (parameterList
                      (typedIdentifier
                        (identifier)))
                    (methodCallExpr
                      (variableExpr
                        (identifier))
                      (identifier)
                      (argumentList))))
                (objectEntry
                  (variableExpr
                    (identifier))
                  (functionLiteral
                    (parameterList
                      (typedIdentifier
                        (identifier)))
                    (unaryExpr
                      (variableExpr
                        (identifier)))))
                (objectEntry
                  (variableExpr
                    (identifier))
                  (functionLiteral
                    (parameterList
                      (typedIdentifier
                        (identifier)))
                    (binaryExpr
                      (variableExpr
                        (identifier))
                      (intLiteral))))
                (objectEntry
                  (variableExpr
                    (identifier))
                  (functionLiteral
                    (parameterList
                      (typedIdentifier
                        (identifier)))
                    (binaryExpr
                      (variableExpr
                        (identifier))
                      (floatLiteral))))
                (objectEntry
                  (variableExpr
                    (identifier))
                  (functionLiteral
                    (parameterList
                      (typedIdentifier
                        (identifier)))
                    (slStringLiteral
                      (interpolationExpr
                        (propertyCallExpr
                          (variableExpr
                            (identifier))
                          (identifier)))
                      (interpolationExpr
                        (propertyCallExpr
                          (variableExpr
                            (identifier))
                          (identifier))))))
                (objectEntry
                  (variableExpr
                    (identifier))
                  (functionLiteral
                    (parameterList
                      (typedIdentifier
                        (identifier)))
                    (slStringLiteral
                      (interpolationExpr
                        (propertyCallExpr
                          (variableExpr
                            (identifier))
                          (identifier)))
                      (interpolationExpr
                        (propertyCallExpr
                          (variableExpr
                            (identifier))
                          (identifier))))))
                (objectEntry
                  (variableExpr
                    (identifier))
                  (functionLiteral
                    (parameterList
                      (typedIdentifier
                        (identifier)))
                    (slStringLiteral)))))))))))
