GeezerVison is showing github.com — Improve variable and flow documentation. Simplify condition · phpmyadmin/sql-parser@d5cf665
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/Components/JoinKeyword.php +13-3Lines changed: 13 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -62,6 +62,11 @@ class JoinKeyword extends Component |
62 | 62 | * @var Condition[] |
63 | 63 | */ |
64 | 64 | public $on; |
| 65 | + /** |
| 66 | + * Columns in Using clause |
| 67 | + * |
| 68 | + * @var ArrayObj |
| 69 | + */ |
65 | 70 | public $using; |
66 | 71 |
|
67 | 72 | /** |
@@ -86,7 +91,8 @@ public static function parse(Parser $parser, TokensList $list, array $options = |
86 | 91 | * |
87 | 92 | * 1 -----------------------[ expr ]----------------------> 2 |
88 | 93 | * |
89 | | - * 2 ---------------------[ ON|USING ]--------------------> 3/4 |
| 94 | + * 2 ------------------------[ ON ]-----------------------> 3 |
| 95 | + * 2 -----------------------[ USING ]---------------------> 4 |
90 | 96 | * |
91 | 97 | * 3 --------------------[ conditions ]-------------------> 0 |
92 | 98 | * |
@@ -134,8 +140,12 @@ public static function parse(Parser $parser, TokensList $list, array $options = |
134 | 140 | $expr->expr = Expression::parse($parser, $list, array('field' => 'table')); |
135 | 141 | $state = 2; |
136 | 142 | } elseif ($state === 2) { |
137 | | - if (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'ON' || $token->value === 'USING')) { |
138 | | - $state = $token->value === 'ON' ? 3 : 4; |
| 143 | + if ($token->type === Token::TYPE_KEYWORD) { |
| 144 | + if ($token->value === 'ON') { |
| 145 | + $state = 3; |
| 146 | + } elseif ($token->value === 'USING') { |
| 147 | + $state = 4; |
| 148 | + } |
139 | 149 | } |
140 | 150 | } elseif ($state === 3) { |
141 | 151 | $expr->on = Condition::parse($parser, $list); |
|