private function handleChildBlock(Lexer $lexer, int $useragentPosition, int $childPosition) : int
    {
        $enterPlatforms = false;
        $enterDevices   = false;
        $collectMatch   = false;

        $functionStart       = $this->getLocationCoordinates($lexer);
        $functionDeclaration = [];

        do {
            $code = $lexer->lex();

            switch ($code) {
                case self::JSON_STRING:
                    if ('platforms' === $lexer->yytext) {
                        $enterPlatforms = true;
                    } elseif ('devices' === $lexer->yytext) {
                        $enterDevices = true;
                    } elseif ('match' === $lexer->yytext) {
                        $collectMatch = true;
                    } elseif (true === $collectMatch) {
                        $collectMatch        = false;
                        $match               = $lexer->yytext;
                        $functionDeclaration = [
                            'start' => $this->getLocationCoordinates($lexer, false, '"' . $match . '"'),
                            'end' => $this->getLocationCoordinates($lexer, true, '"' . $match . '"'),
                        ];
                    }

                    break;
                case self::JSON_OBJECT_START:
                    if (true === $enterDevices) {
                        $code         = $this->handleDeviceBlock($lexer, $useragentPosition, $childPosition);
                        $enterDevices = false;
                    } else {
                        $code = $this->ignoreObjectBlock($lexer);
                    }

                    break;
                case self::JSON_ARRAY_START:
                    if (true === $enterPlatforms) {
                        $code           = $this->handlePlatformBlock($lexer, $useragentPosition, $childPosition);
                        $enterPlatforms = false;
                    }

                    break;
            }
        } while (self::JSON_OBJECT_END !== $code);

        $functionEnd = $this->getLocationCoordinates($lexer, true);

        $functionCoverage = $this->getCoverageCount(
            sprintf('u%d::c%d::d::p', $useragentPosition, $childPosition),
            $this->fileCoveredIds
        );

        $this->collectFunction($functionStart, $functionEnd, $functionDeclaration, $functionCoverage);

        return $lexer->lex();
    }