@@ -1010,27 +1010,21 @@ private function parse_create_table() {
10101010 * `my_field` varchar(255) NOT NULL DEFAULT 'foo'
10111011 * Constraint definition, e.g.:
10121012 * PRIMARY KEY (`my_field`)
1013- *
1014- * Lexer does not seem to reliably understand whether the
1015- * first token is a field name or a reserved keyword, so
1016- * instead we'll check whether the second non-whitespace
1017- * token is a data type.
10181013 */
1019- $ second_token = $ this ->rewriter ->peek_nth ( 2 );
10201014 $ current_token = $ this ->rewriter ->peek ();
1015+ $ second_token = $ this ->rewriter ->peek_nth ( 2 );
10211016
1022- if ( $ second_token -> matches (
1023- WP_SQLite_Token:: TYPE_KEYWORD ,
1024- WP_SQLite_Token::FLAG_KEYWORD_DATA_TYPE
1025- ) && ! $ current_token -> matches (
1026- WP_SQLite_Token:: TYPE_KEYWORD ,
1027- WP_SQLite_Token::FLAG_KEYWORD_RESERVED ,
1028- array ( ' KEY ' )
1029- ) ) {
1030- echo ' field ' ;
1017+ if (
1018+ $ second_token -> matches (
1019+ WP_SQLite_Token::TYPE_KEYWORD ,
1020+ WP_SQLite_Token:: FLAG_KEYWORD_DATA_TYPE
1021+ ) && ! $ current_token -> matches (
1022+ WP_SQLite_Token::TYPE_KEYWORD ,
1023+ WP_SQLite_Token:: FLAG_KEYWORD_RESERVED ,
1024+ )
1025+ ) {
10311026 $ result ->fields [] = $ this ->parse_mysql_create_table_field ();
10321027 } else {
1033- echo 'constraint ' ;
10341028 $ result ->constraints [] = $ this ->parse_mysql_create_table_constraint ();
10351029 }
10361030
0 commit comments