Skip to content

Commit

Permalink
parser: Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
MKleusberg committed Dec 25, 2021
1 parent da28fdc commit 0f595ff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions src/sql/parser/sqlite3_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,7 @@ namespace sqlb { namespace parser {

case 180: // optional_sort_order: %empty
#line 533 "sqlite3_parser.yy"
{ yylhs.value.as < std::string > () = ""; }
{ }
#line 2530 "sqlite3_parser.cpp"
break;

Expand Down Expand Up @@ -2555,7 +2555,7 @@ namespace sqlb { namespace parser {

case 185: // optional_where: %empty
#line 548 "sqlite3_parser.yy"
{ yylhs.value.as < std::string > () = ""; }
{ }
#line 2560 "sqlite3_parser.cpp"
break;

Expand Down Expand Up @@ -2626,13 +2626,13 @@ namespace sqlb { namespace parser {

case 194: // optional_exprlist_with_paren: %empty
#line 593 "sqlite3_parser.yy"
{ yylhs.value.as < std::string > () = {}; }
{ }
#line 2631 "sqlite3_parser.cpp"
break;

case 195: // optional_exprlist_with_paren: "(" ")"
#line 594 "sqlite3_parser.yy"
{ yylhs.value.as < std::string > () = {}; }
{ }
#line 2637 "sqlite3_parser.cpp"
break;

Expand Down Expand Up @@ -2702,7 +2702,7 @@ namespace sqlb { namespace parser {

case 206: // optional_tableoptions_list: %empty
#line 628 "sqlite3_parser.yy"
{}
{ }
#line 2707 "sqlite3_parser.cpp"
break;

Expand All @@ -2714,7 +2714,7 @@ namespace sqlb { namespace parser {

case 208: // optional_conflictclause: %empty
#line 633 "sqlite3_parser.yy"
{ yylhs.value.as < std::string > () = ""; }
{ }
#line 2719 "sqlite3_parser.cpp"
break;

Expand Down Expand Up @@ -2750,7 +2750,7 @@ namespace sqlb { namespace parser {

case 214: // optional_typename: %empty
#line 642 "sqlite3_parser.yy"
{ yylhs.value.as < std::string > () = ""; }
{ }
#line 2755 "sqlite3_parser.cpp"
break;

Expand Down Expand Up @@ -3035,7 +3035,7 @@ namespace sqlb { namespace parser {

case 242: // optional_constraintname: %empty
#line 808 "sqlite3_parser.yy"
{ yylhs.value.as < std::string > () = ""; }
{ }
#line 3040 "sqlite3_parser.cpp"
break;

Expand Down Expand Up @@ -3065,7 +3065,7 @@ namespace sqlb { namespace parser {

case 247: // optional_columnid_with_paren_list: %empty
#line 819 "sqlite3_parser.yy"
{ yylhs.value.as < sqlb::StringVector > () = sqlb::StringVector(); }
{ }
#line 3070 "sqlite3_parser.cpp"
break;

Expand Down Expand Up @@ -3185,7 +3185,7 @@ namespace sqlb { namespace parser {

case 267: // optional_fk_clause: %empty
#line 848 "sqlite3_parser.yy"
{ yylhs.value.as < std::string > () = ""; }
{ }
#line 3190 "sqlite3_parser.cpp"
break;

Expand Down Expand Up @@ -3340,7 +3340,7 @@ namespace sqlb { namespace parser {

case 289: // optional_tableconstraint_list: %empty
#line 902 "sqlite3_parser.yy"
{ yylhs.value.as < sqlb::ConstraintVector > () = {}; }
{ }
#line 3345 "sqlite3_parser.cpp"
break;

Expand Down
22 changes: 11 additions & 11 deletions src/sql/parser/sqlite3_parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ optional_if_not_exists:
;

optional_sort_order:
%empty { $$ = ""; }
%empty { }
| ASC { $$ = "ASC"; }
| DESC { $$ = "DESC"; }
;
Expand All @@ -545,7 +545,7 @@ optional_unique:
;

optional_where:
%empty { $$ = ""; }
%empty { }
| WHERE expr { $$ = $2; }
;

Expand Down Expand Up @@ -590,8 +590,8 @@ createindex_stmt:
*/

optional_exprlist_with_paren:
%empty { $$ = {}; }
| "(" ")" { $$ = {}; }
%empty { }
| "(" ")" { }
| "(" exprlist_expr ")" { $$ = $2; }
;

Expand Down Expand Up @@ -625,12 +625,12 @@ tableoptions_list:
;

optional_tableoptions_list:
%empty {}
%empty { }
| tableoptions_list { $$ = $1; }
;

optional_conflictclause:
%empty { $$ = ""; }
%empty { }
| ON CONFLICT ROLLBACK { $$ = $3; }
| ON CONFLICT ABORT { $$ = $3; }
| ON CONFLICT FAIL { $$ = $3; }
Expand All @@ -639,7 +639,7 @@ optional_conflictclause:
;

optional_typename:
%empty { $$ = ""; }
%empty { }
| type_name { $$ = $1; }
;

Expand Down Expand Up @@ -805,7 +805,7 @@ columndef_list:
;

optional_constraintname:
%empty { $$ = ""; }
%empty { }
| CONSTRAINT id { $$ = $2; }
| CONSTRAINT STRINGLITERAL { $$ = $2; }
;
Expand All @@ -816,7 +816,7 @@ columnid_list:
;

optional_columnid_with_paren_list:
%empty { $$ = sqlb::StringVector(); }
%empty { }
| "(" columnid_list ")" { $$ = $2; }
;

Expand Down Expand Up @@ -845,7 +845,7 @@ fk_clause_part_list:
;

optional_fk_clause:
%empty { $$ = ""; }
%empty { }
| fk_clause_part_list { $$ = $1; }
| fk_clause_part_list DEFERRABLE INITIALLY DEFERRED { $$ = $1 + " " + $2 + " " + $3 + " " + $4; }
| fk_clause_part_list DEFERRABLE INITIALLY IMMEDIATE { $$ = $1 + " " + $2 + " " + $3 + " " + $4; }
Expand Down Expand Up @@ -899,7 +899,7 @@ tableconstraint_list:
;

optional_tableconstraint_list:
%empty { $$ = {}; }
%empty { }
| "," tableconstraint_list { $$ = $2; }
;

Expand Down

0 comments on commit 0f595ff

Please sign in to comment.