Ejemplo n.º 1
0
 /**
  * Returns a regular expression that is used to parse each line.
  *
  * @return string
  */
 public function getRE()
 {
     return $this->lineParser->getRE();
 }
Ejemplo n.º 2
0
 /**
  * Parses text as single line.
  * @param  Texy
  * @param  string
  * @return void
  */
 public final function parseLine(Texy $texy, $s)
 {
     $parser = new LineParser($texy, $this);
     $parser->parse($s);
     return $parser;
 }
Ejemplo n.º 3
0
 /**
  * Parses text as single line.
  * @param  Texy
  * @param  string
  * @return void
  */
 public final function parseLine(Texy $texy, $s)
 {
     // TODO!
     // special escape sequences
     $s = str_replace(['\\)', '\\*'], [')', '*'], $s);
     $parser = new LineParser($texy, $this);
     $parser->parse($s);
     return $parser;
 }
Ejemplo n.º 4
0
 $file = new SplFileObject($ctagsPath, 'a+');
 $newFileStr = '';
 while (!$file->eof()) {
     // Get current line
     $line = $file->fgets();
     // Check empty lines
     if (!isset($line[0])) {
         continue;
     }
     // Add comment
     if ($line[0] === '!') {
         $newFileStr .= $line;
         continue;
     }
     // Parse current line
     $parser = new LineParser($line);
     $info = $parser->extractAll();
     // Class mapping
     if ($info['type'] == 'c') {
         // Check PHP extension
         $pathRegex = '#(?<!\\.old[0-9]|\\.old)\\.php$#';
         if (!preg_match($pathRegex, $info['path'])) {
             continue;
         }
         // Comparing filename and tag name
         $filename = basename($info['path']);
         if ($filename === $info['cleanTag'] . '.php') {
             $newFileStr .= $line;
         }
     } else {
         $newFileStr .= $line;