Source/Packages

Data.JSON

packages/foundation/standard/src/Data/JSON.alpha

2,617 lines251 declarations113.9 KiBSHA-256 bd63da5ed186

def · lines 2119–2189

jsonAuditTreeWithTokenLimitsPart1

Full file
Part of `jsonAuditTreeWithTokenLimits`, lifted out to keep it inside the §28.3 size and nesting limits; the parameters are the locals it still needs.
2119def jsonAuditTreeWithTokenLimitsPart1 =
2120  (lambda unrestricted maximumStringBytes : (family JSONBound) .
2121    (lambda unrestricted maximumContainerEntries : (family JSONBound) .
2122      (lambda unrestricted key : Bytes .
2123        (lambda unrestricted tail : (family JSON) .
2124          (lambda unrestricted memberInduction : (family JSONTreeAuditResult) .
2125            (lambda unrestricted tailInduction : (family JSONTreeAuditResult) .
2126              (eliminate
2127                UTF8DecodeResult
2128                (lambda unrestricted current : (family UTF8DecodeResult) .
2129                  (family JSONTreeAuditResult))
2130                (decodeUTF8 key)
2131                (branch
2132                  UTF8DecodeSucceeded
2133                  codepoints
2134                  .
2135                  (eliminate
2136                    JSONTreeAuditResult
2137                    (lambda unrestricted current : (family JSONTreeAuditResult) .
2138                      (family JSONTreeAuditResult))
2139                    memberInduction
2140                    (branch
2141                      JSONTreeAuditSucceeded
2142                      memberKind
2143                      memberCounts
2144                      memberDepth
2145                      memberSequence
2146                      .
2147                      (eliminate
2148                        JSONTreeAuditResult
2149                        (lambda unrestricted current : (family JSONTreeAuditResult) .
2150                          (family JSONTreeAuditResult))
2151                        tailInduction
2152                        (branch
2153                          JSONTreeAuditSucceeded
2154                          tailKind
2155                          tailCounts
2156                          tailDepth
2157                          tailSequence
2158                          .
2159                          (jsonAuditGate
2160                            (jsonFlagAnd
2161                              (jsonTreeKindIsValue memberKind)
2162                              (jsonTreeKindIsObjectMembers tailKind))
2163                            (constructor JSONErrorCode JSONMalformedTree)
2164                            (jsonAuditGate
2165                              (jsonFlagNot (jsonObjectContainsKey key tail))
2166                              (constructor JSONErrorCode JSONObjectDuplicateKey)
2167                              (jsonAuditGate
2168                                (jsonBoundAllows maximumStringBytes (bytes-length key))
2169                                (constructor JSONErrorCode JSONStringLimitExceeded)
2170                                (jsonAuditGate
2171                                  (jsonBoundAllows maximumContainerEntries (succ tailSequence))
2172                                  (constructor JSONErrorCode JSONContainerLimitExceeded)
2173                                  (constructor
2174                                    JSONTreeAuditResult
2175                                    JSONTreeAuditSucceeded
2176                                    (constructor JSONTreeKind JSONTreeObjectMembersKind)
2177                                    (jsonCountsAdd
2178                                      (jsonCountsObjectMember (bytes-length key))
2179                                      (jsonCountsAdd memberCounts tailCounts))
2180                                    (jsonNaturalMaximum memberDepth tailDepth)
2181                                    (succ tailSequence)))))))
2182                        (branch JSONTreeAuditFailed code . (jsonTreeAuditFailure code))))
2183                    (branch JSONTreeAuditFailed code . (jsonTreeAuditFailure code))))
2184                (branch
2185                  UTF8DecodeFailed
2186                  code
2187                  offset
2188                  .
2189                  (jsonTreeAuditFailure (constructor JSONErrorCode JSONInvalidUTF8))))))))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.