summaryrefslogtreecommitdiffstats
path: root/src/Parser.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-07-03 00:36:33 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-07-03 00:36:33 +0300
commit4dabcc2ae266c022e44294bfbe3344b05e66e266 (patch)
tree087ec6996da50ef402a37e2b090a56a926d3df9e /src/Parser.php
parentfe199733111d7fa2eef929df39c39ee50bb55d89 (diff)
downloadsql-parser-4dabcc2ae266c022e44294bfbe3344b05e66e266.zip
sql-parser-4dabcc2ae266c022e44294bfbe3344b05e66e266.tar.gz
sql-parser-4dabcc2ae266c022e44294bfbe3344b05e66e266.tar.bz2
Moved build() to Statement class to be next to the parse() method.
Improved CREATE statements. Improved TokensList's getNext(). Better first and last positions for statements.
Diffstat (limited to 'src/Parser.php')
-rw-r--r--src/Parser.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Parser.php b/src/Parser.php
index 29e6701..11874fa 100644
--- a/src/Parser.php
+++ b/src/Parser.php
@@ -339,15 +339,15 @@ class Parser
*/
$stmt = new $class();
+ // Parsing the actual statement.
+ $stmt->parse($this, $this->list);
+
// The first token that is a part of this token is the next token
// unprocessed by the previous statement.
// There might be brackets around statements and this shouldn't
// affect the parser
$stmt->first = $prevLastIdx + 1;
- // Parsing the actual statement.
- $stmt->parse($this, $this->list);
-
// Storing the index of the last token parsed and updating the old
// index.
$stmt->last = $list->idx;