SQL/Parser.php
authorAlan Knowles <alan@akkbhome.com>
Sun, 13 Feb 2011 12:29:26 +0000 (20:29 +0800)
committerAlan Knowles <alan@akkbhome.com>
Sun, 13 Feb 2011 12:29:26 +0000 (20:29 +0800)
SQL/Parser.php

index 884dc62..b4a9f52 100755 (executable)
@@ -940,10 +940,11 @@ class SQL_Parser
                     $this->raiseError('Expected )');
                     
                 }
-                
-               
                 continue;
-            } elseif ($this->token == 'key') {
+            }
+            
+            
+            if ($this->token == 'key') {
                 $this->getTok();
                 if ($this->token != 'ident') {
                     $this->raiseError('Expected identifier');
@@ -967,15 +968,17 @@ class SQL_Parser
                     $this->getTok();
                 }
                 continue;
-            } elseif ($this->token == 'ident' || $this->isFunc()
-             || $this->isReserved()) {
-                $name = $this->lexer->tokText;
-            } elseif ($this->token == ')') {
+            } 
+            
+            if ($this->token == ')') {
                 return $fields;
-            } else {
-                //$this->raiseError('Expected identifier');
             }
-
+            
+            if ($this->token == 'ident' || $this->isFunc() || $this->isReserved()) {
+                $name = $this->lexer->tokText;
+            }
+            // else ??    //$this->raiseError('Expected identifier');
+            
             // parse field type
             $this->getTok();
             if (! $this->isType($this->token)) {