You are here

function PARSEENTRIES::closingDelimiter in Bibliography Module 7.3

Same name and namespace in other branches
  1. 5 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
  2. 6.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
  3. 6 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
  4. 7 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
  5. 7.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
1 call to PARSEENTRIES::closingDelimiter()
PARSEENTRIES::extractEntries in plugins/biblio_style/bibtex/PARSEENTRIES.php

File

plugins/biblio_style/bibtex/PARSEENTRIES.php, line 389

Class

PARSEENTRIES

Code

function closingDelimiter($val, $delimitEnd) {

  //  echo "####>$delimitEnd $val<BR>";
  $openquote = $bracelevel = $i = $j = 0;
  while ($i < strlen($val)) {

    // a '"' found at brace level 0 defines a value such as "ss{\"o}ss"
    if ($val[$i] == '"' && !$bracelevel) {
      $openquote = !$openquote;
    }
    elseif ($val[$i] == '{') {
      $bracelevel++;
    }
    elseif ($val[$i] == '}') {
      $bracelevel--;
    }
    if ($val[$i] == $delimitEnd && !$openquote && !$bracelevel) {
      return $i;
    }
    $i++;
  }

  // echo "--> $bracelevel, $openquote";
  return 0;
}