original_string: public function parenthesize_plural_exression($expression)
      {
          $expression .= ';';
          $res = '';
          $depth = 0;
          for ($i = 0; $i < strlen($expression); ++$i) {
              $char = $expression[$i];
              switch ($char) {
                  case '?':
                      $res .= ' ? (';
                      $depth++;
                      break;
                  case ':':
                      $res .= ') : (';
                      break;
                  case ';':
                      $res .= str_repeat(')', $depth) . ';';
                      $depth = 0;
                      break;
                  default:
                      $res .= $char;
              }
          }
  
          return rtrim($res, ';');
      }
code: public function parenthesize_plural_exression($expression)
      {
          $expression .= ';';
          $res = '';
          $depth = 0;
          for ($i = 0; $i < strlen($expression); ++$i) {
              $char = $expression[$i];
              switch ($char) {
                  case '?':
                      $res .= ' ? (';
                      $depth++;
                      break;
                  case ':':
                      $res .= ') : (';
                      break;
                  case ';':
                      $res .= str_repeat(')', $depth) . ';';
                      $depth = 0;
                      break;
                  default:
                      $res .= $char;
              }
          }
  
          return rtrim($res, ';');
      }
code_tokens: public function parenthesize_plural_exression ( $ expression ) { $ expression .= ';' ; $ res = '' ; $ depth = 0 ; for ( $ i = 0 ; $ i < strlen ( $ expression ) ; ++ $ i ) { $ char = $ expression [ $ i ] ; switch ( $ char ) { case '?' : $ res .= ' ? (' ; $ depth ++ ; break ; case ':' : $ res .= ') : (' ; break ; case ';' : $ res .= str_repeat ( ')' , $ depth ) . ';' ; $ depth = 0 ; break ; default : $ res .= $ char ; } } return rtrim ( $ res , ';' ) ; }
docstring: Adds parentheses to the inner parts of ternary operators in
  plural expressions, because PHP evaluates ternary operators
  from left to right.
  
  @param string $expression the expression without parentheses
  
  @return string the expression with parentheses added
docstring_tokens: Adds parentheses to the inner parts of ternary operators in plural expressions because PHP evaluates ternary operators from left to right .