MDL-63422 lib: lessphp - review core loop / switch / case / continue
[moodle.git] / lib / lessphp / Exception / Chunk.php
index 97fce1b..b9f0a5e 100644 (file)
@@ -67,7 +67,7 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
                                case 40:\r
                                        $parenLevel++;\r
                                        $lastParen = $this->parserCurrentIndex;\r
-                                       continue;\r
+                                       break;\r
 \r
                                // )\r
                                case 41:\r
@@ -75,18 +75,18 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
                                        if( $parenLevel < 0 ){\r
                                                return $this->fail("missing opening `(`");\r
                                        }\r
-                                       continue;\r
+                                       break;\r
 \r
                                // ;\r
                                case 59:\r
                                        //if (!$parenLevel) { $this->emitChunk();       }\r
-                                       continue;\r
+                                       break;\r
 \r
                                // {\r
                                case 123:\r
                                        $level++;\r
                                        $lastOpening = $this->parserCurrentIndex;\r
-                                       continue;\r
+                                       break;\r
 \r
                                // }\r
                                case 125:\r
@@ -96,10 +96,10 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
 \r
                                        }\r
                                        //if (!$level && !$parenLevel) { $this->emitChunk(); }\r
-                                       continue;\r
+                                       break;\r
                                // \\r
                                case 92:\r
-                                       if ($this->parserCurrentIndex < $this->input_len - 1) { $this->parserCurrentIndex++; continue; }\r
+                                       if ($this->parserCurrentIndex < $this->input_len - 1) { $this->parserCurrentIndex++; break; }\r
                                        return $this->fail("unescaped `\\`");\r
 \r
                                // ", ' and `\r
@@ -119,12 +119,12 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
                                                        $this->parserCurrentIndex++;\r
                                                }\r
                                        }\r
-                                       if ($matched) { continue; }\r
+                                       if ($matched) { break; }\r
                                        return $this->fail("unmatched `" . chr($cc) . "`", $currentChunkStartIndex);\r
 \r
                                // /, check for comment\r
                                case 47:\r
-                                       if ($parenLevel || ($this->parserCurrentIndex == $this->input_len - 1)) { continue; }\r
+                                       if ($parenLevel || ($this->parserCurrentIndex == $this->input_len - 1)) { break; }\r
                                        $cc2 = $this->CharCode($this->parserCurrentIndex+1);\r
                                        if ($cc2 == 47) {\r
                                                // //, find lnfeed\r
@@ -145,14 +145,14 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
                                                        return $this->fail("missing closing `*/`", $currentChunkStartIndex);\r
                                                }\r
                                        }\r
-                                       continue;\r
+                                       break;\r
 \r
                                // *, check for unmatched */\r
                                case 42:\r
                                        if (($this->parserCurrentIndex < $this->input_len - 1) && ($this->CharCode($this->parserCurrentIndex+1) == 47)) {\r
                                                return $this->fail("unmatched `/*`");\r
                                        }\r
-                                       continue;\r
+                                       break;\r
                        }\r
                }\r
 \r