beginCompilationUnit(void)
  beginMetadataStar(void)
  endMetadataStar(0)
  beginTopLevelMember(void)
    beginTopLevelMethod(, null, null)
      handleVoidKeyword(void)
      handleIdentifier(main, topLevelFunctionDeclaration)
      handleNoTypeVariables(()
      beginFormalParameters((, MemberKind.TopLevelMethod)
      endFormalParameters(0, (, ), MemberKind.TopLevelMethod)
      handleAsyncModifier(null, null)
      beginBlockFunctionBody({)
        beginTryStatement(try)
          beginBlock({, BlockKind(try statement))
            handleEmptyStatement(;)
          endBlock(1, {, }, BlockKind(try statement))
          beginCatchClause(catch)
            beginFormalParameters((, MemberKind.Catch)
              beginMetadataStar(e)
              endMetadataStar(0)
              beginFormalParameter(e, MemberKind.Catch, null, null, null)
                handleNoType(()
                handleIdentifier(e, formalParameterDeclaration)
                handleFormalParameterWithoutValue())
              endFormalParameter(null, null, null, e, null, null, FormalParameterKind.requiredPositional, MemberKind.Catch)
            endFormalParameters(1, (, ), MemberKind.Catch)
          endCatchClause({)
          beginBlock({, BlockKind(catch clause))
            handleEmptyStatement(;)
          endBlock(1, {, }, BlockKind(catch clause))
          handleCatchBlock(null, catch, null)
          beginCatchClause(on)
            handleIdentifier(Foo, typeReference)
            handleNoTypeArguments({)
            handleType(Foo, null)
          endCatchClause({)
          beginBlock({, BlockKind(catch clause))
            handleEmptyStatement(;)
          endBlock(1, {, }, BlockKind(catch clause))
          handleCatchBlock(on, null, null)
        endTryStatement(2, try, null)
        handleIdentifier(on, expression)
        handleNoTypeArguments(()
        beginArguments(()
        endArguments(0, (, ))
        handleSend(on, ;)
        handleExpressionStatement(;)
      endBlockFunctionBody(2, {, })
    endTopLevelMethod(void, null, })
  endTopLevelDeclaration(void)
  beginMetadataStar(void)
  endMetadataStar(0)
  beginTopLevelMember(void)
    beginTopLevelMethod(}, null, null)
      handleVoidKeyword(void)
      handleIdentifier(on, topLevelFunctionDeclaration)
      handleNoTypeVariables(()
      beginFormalParameters((, MemberKind.TopLevelMethod)
      endFormalParameters(0, (, ), MemberKind.TopLevelMethod)
      handleAsyncModifier(null, null)
      beginBlockFunctionBody({)
      endBlockFunctionBody(0, {, })
    endTopLevelMethod(void, null, })
  endTopLevelDeclaration()
endCompilationUnit(2, )
