parse comments to retrieve annotations
@access public
@return array
@throws AnnotationNotExistingException
767482
public function parse(){
			$data = [];

			preg_match_all('#@(.*?)\n#s', $this->_comments, $annotations);

			foreach ($annotations[1] as $key => $annotation){
				if(preg_match('#([A-Za-z]+)\((.*)\)#is', $annotation)){
					preg_match_all('#([A-Za-z]+)\((.*)\)#is', $annotation, $annotationData);
					$annotationTitle = $annotationData[1][0];

					if(isset(Parser::$_annotations[$annotationTitle])) {
						$annotationContents = explode(", ", $annotationData[2][0]);
						$data[$key] = [];

						foreach ($annotationContents as $annotationContent) {
							preg_match_all('#(.+)="(.*)"#isU', trim($annotationContent), $annotationContentData);

							$data[$key]['type'] = $annotationTitle;
							$data[$key]['class'] = Parser::$_annotations[$annotationTitle];
							$data[$key]['properties'][$annotationContentData[1][0]] = $annotationContentData[2][0];
						}
					}
					else{
						throw new AnnotationNotExistingException('The annotation "' . $annotationTitle . '" does not exist');
					}
				}
			}

			return $data;
		}
682207
protected function _parse($comment) {
		$summary = null;
		$description = null;
		$tags = array();

		$comment = trim(preg_replace('/^(\s*\/\*\*|\s*\*{1,2}\/|\s*\* ?)/m', '', $comment));
		$comment = str_replace("\r\n", "\n", $comment);

		if ($items = preg_split('/\n@/ms', $comment, 2)) {
			list($summary, $tags) = $items + array('', '');
			$this->_tags = $tags ? $this->_parseTags("@{$tags}") : array();
		}
		if (strpos($summary, "\n\n")) {
			list($summary, $description) = explode("\n\n", $summary, 2);
		}
		$this->_summary = $this->_clean($summary);
		$this->_description = $this->_clean($description);
	}
1199941
public function getRegexes() : array
    {
        return [
            $this->getPhoneNumbers(),                        
            $this->getUrls(),            
            $this->getEmoticons(),            
            $this->getHashTags(),           
            $this->getAsciiArrows(),            
            $this->getUsernames(),
            $this->getHashTags(),            
            $this->getWordsWith(),
            $this->getNumbers(),            
            $this->getWordsWithout(),            
            $this->getEllipsisDots(),            
            $this->getEverythingElse()
        ];
    }
950105
protected function scanComment()
    {
        if ($this->inPyString) {
            return null;
        }

        $line = $this->getTrimmedLine();
        if (0 !== mb_strpos($line, '#', 0, 'utf8')) {
            return null;
        }

        $token = $this->takeToken('Comment', $line);
        $this->consumeLine();

        return $token;
    }
979829
public function listComments(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
    }
15898
public function lexComment()
    {
        $source = $this->source;
        if ($source->cursor >= $source->bound) {
            $this->addError("The parser did not find the '{$source->leftDelimiter}*' comment start tag.", $source->cursor);
            return null;
        }
        Rules::reset($source->leftDelimiter, $source->rightDelimiter);
        $ret = $this->find('@' . preg_quote($source->leftDelimiter . '*', '@') . '@', null, true);
        if ($ret == null) {
            $this->addError("The parser did not find the '{$source->leftDelimiter}*' comment start tag.", $source->cursor);
            return null;
        }
        $source->cursor = $ret['end'];
        $ret = $this->find('@' . preg_quote('*' . $source->rightDelimiter, '@') . '@', null, true);
        if ($ret == null) {
            $this->addError("The parser did not find the '*{$source->rightDelimiter}' comment end tag.", $source->cursor);
            return null;
        }
        $source->cursor = $ret['end'];
        return ['map' => null, 'code' => null, 'next' => 'parsHtml'];
    }
331062
public function getComments($postId = false)
    {
        $cArgs = [
            'author__in' => $this->ID,
            'orderby' => 'comment_date_gmt'
        ];
        if ($postId) {
            $cArgs['post_id'] = $postId;
        }
        $comments = [];
        foreach (get_comments($cArgs) as $c) {
            $comments[] = Comment::find($c->comment_ID);
        }
        return $comments;
    }
554617
public function parseComment($comment)
    {
        preg_match_all('/@([a-zA-Z]+) *(.*)\n/', $comment, $matches, PREG_SET_ORDER);
        $tags = new TagCollection();

        foreach ($matches as $match) {
            array_shift($match);
            list($tag, $body) = $match;

            $tags->addTag($this->getTagEntity($tag, $body));
        }

        return $tags;
    }
1301044
public function getAnnotations()
    {
        $result = array();
        foreach ($this->annotationsDefinitions as $annotationDefinition) {
            $result = array_merge($result, $this->buildAnnotationsInstances($annotationDefinition));
        }

        return $result;
    }
413567
public function getComments() {
        $comments = false;
        $table    = \MUtil_Html::create()->table(['class' => 'browser table', 'style' => 'width: auto']);

        $targetSurveyAnswers = $this->getNumberOfAnswers($this->targetSurveyId);
        if ($targetSurveyAnswers > 0) {
            $comments = true;
            $table
                    ->tr(['class' => 'warning'])
                    ->td(
                            sprintf(
                                    $this->_('Target survey already has %d answers. Is this expected?'),
                                    $targetSurveyAnswers
                            )
            );
        }

        if ($comments) {
            return $table;
        }

        return false;
    }
379895
public function GetCommentCounts() {
      $this->AllowJSONP(TRUE);
      
		$vanilla_identifier = GetValue('vanilla_identifier', $_GET);
		if (!is_array($vanilla_identifier))
			$vanilla_identifier = array($vanilla_identifier);
         
      $vanilla_identifier = array_unique($vanilla_identifier);
      
      $FinalData = array_fill_keys($vanilla_identifier, 0);
      $Misses = array();
      $CacheKey = 'embed.comments.count.%s';
      $OriginalIDs = array();
      foreach ($vanilla_identifier as $ForeignID) {
         $HashedForeignID = ForeignIDHash($ForeignID);
         
         // Keep record of non-hashed identifiers for the reply
         $OriginalIDs[$HashedForeignID] = $ForeignID;
         
         $RealCacheKey = sprintf($CacheKey, $HashedForeignID);
         $Comments = Gdn::Cache()->Get($RealCacheKey);
         if ($Comments !== Gdn_Cache::CACHEOP_FAILURE)
            $FinalData[$ForeignID] = $Comments;
         else
            $Misses[] = $HashedForeignID;
      }
      
      if (sizeof($Misses)) {
         $CountData = Gdn::SQL()
            ->Select('ForeignID, CountComments')
            ->From('Discussion')
            ->Where('Type', 'page')
            ->WhereIn('ForeignID', $Misses)
            ->Get()->ResultArray();
         
         foreach ($CountData as $Row) {
            // Get original identifier to send back
            $ForeignID = $OriginalIDs[$Row['ForeignID']];
            $FinalData[$ForeignID] = $Row['CountComments'];
            
            // Cache using the hashed identifier
            $RealCacheKey = sprintf($CacheKey, $Row['ForeignID']);
            Gdn::Cache()->Store($RealCacheKey, $Row['CountComments'], array(
               Gdn_Cache::FEATURE_EXPIRY     => 60
            ));
         }         
      }
      
		$this->SetData('CountData', $FinalData);
		$this->DeliveryMethod = DELIVERY_METHOD_JSON;
		$this->DeliveryType = DELIVERY_TYPE_DATA;
		$this->Render();
	}
1175740
private function scanFileListForAnnotations()
    {
        $annotations = [];
        foreach ($this->getFileList() as $file) {
            $this->classListByFiles[$file] = ClassInformationFromFile::getClassesFromFile($file)[0];
            $annotations[$this->classListByFiles[$file]] = $this->scanClassForAnnotations(
                $this->classListByFiles[$file]
            );
        }
        return $annotations;
    }
596399
protected function _parseMailbox()
    {
        $this->_comments = array();
        $start = $this->_ptr;

        if (!($ob = $this->_parseNameAddr())) {
            $this->_comments = array();
            $this->_ptr = $start;
            $ob = $this->_parseAddrSpec();
        }

        if ($ob) {
            $ob->comment = $this->_comments;
        }

        return $ob;
    }
1275977
protected function extractParamAnnotations(string $docComment): array
    {
        $pattern = '/@param(?:\s+([^$"]\S+))?(?:\s+\$(\w+))?(?:\s+"([^"]++)")?/';

        if (!(bool)preg_match_all($pattern, $docComment, $matches, PREG_SET_ORDER)) {
            return [];
        }

        $annotations = [];

        foreach ($matches as $index => $match) {
            $annotations[$index] = isset($match[3]) && $match[3] !== '' ? $match[3] : null;
        }

        return $annotations;
    }
1249493
private function getAnnotationsForSite()
    {
        $result = array();
        foreach ($this->idSites as $id) {
            $optionName = self::getAnnotationCollectionOptionName($id);
            $serialized = Option::get($optionName);

            if ($serialized !== false) {
                $result[$id] = Common::safe_unserialize($serialized);
                if (empty($result[$id])) {
                    // in case unserialize failed
                    $result[$id] = array();
                }
            } else {
                $result[$id] = array();
            }
        }
        return $result;
    }
1089113
public function getClassAnnotations()
    {
        if (empty($this->_annotations['class'])) {
            $comment = $this->_getReflection()->getDocComment();
            $data = AnnotationParser::getAnnotations($comment);
            $classAnnotations = new AnnotationsList();
            foreach ($data as $name => $parsedData) {
                $classAnnotations->append(
                    $this->_createAnnotation($name, $parsedData)
                );
            }
            $this->_annotations['class'] = $classAnnotations;
        }
        return $this->_annotations['class'];
    }
817080
private function Annotations()
    {
        $annotations = [];

        while (null !== $this->lexer->lookahead) {
            if (DocLexer::T_AT !== $this->lexer->lookahead['type']) {
                $this->lexer->moveNext();
                continue;
            }

            // make sure the @ is preceded by non-catchable pattern
            if (null !== $this->lexer->token && $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value'])) {
                $this->lexer->moveNext();
                continue;
            }

            // make sure the @ is followed by either a namespace separator, or
            // an identifier token
            if ((null === $peek = $this->lexer->glimpse())
                || (DocLexer::T_NAMESPACE_SEPARATOR !== $peek['type'] && !in_array($peek['type'], self::$classIdentifiers, true))
                || $peek['position'] !== $this->lexer->lookahead['position'] + 1) {
                $this->lexer->moveNext();
                continue;
            }

            $this->isNestedAnnotation = false;
            if (false !== $annot = $this->Annotation()) {
                $annotations[] = $annot;
            }
        }

        return $annotations;
    }