Uploaded image for project: 'Appcelerator Studio'
  1. Appcelerator Studio
  2. TISTUD-466

PHP formatting bug with "continue" in certain situations

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Titanium Studio 1.0.4
    • Component/s: Editor
    • Labels:
      None
    • Environment:

      Aptana Studio 3 Plugin 3.0.2.201106082253-7E137HFCPGfKLHU7RUIsH_4F1jOz

      Description

      hi,
      if i try to format this code:

       
      <?php
      class aaa {
       
      function aaa() {
          $aaa = array();
          foreach($aaa as $a => $aa) {
              if($aa == 'aa') 
                  continue ;
          }
      }
       
      }
      ?>
      

      i get the error:

      !ENTRY com.aptana.formatter.epl 4 4 2011-06-10 10:03:15.776 !MESSAGE Error while formatting the code in your editor. Please submit a bug report through Aptana's support and include the relevant code which triggered this error.
      

      adding braces or replacing the continue keyword fixes the problem.
      this 2 snippets get formatted without problems:

       
      <?php
      class aaa {
       
      function aaa() {
          $aaa = array();
          foreach($aaa as $a => $aa) {
              if($aa == 'aa') {
                  continue ;
              }
          }
      }
       
      }
      ?>
      

       
      <?php
      class aaa {
       
      function aaa() {
          $aaa = array();
          foreach($aaa as $a => $aa) {
              if($aa == 'aa')
                  return ;
          }
      }
       
      }
      ?>
      

        Attachments

          Activity

            People

            • Assignee:
              sgibly Shalom Gibly
              Reporter:
              mxmxm@gmx.de mxmxm
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: