Skip to content

Commit fb56ce3

Browse files
author
Dray Lacy
committed
Added table reference lists (ex. 'FROM users, posts, comments').
1 parent b9faf82 commit fb56ce3

File tree

3 files changed

+425
-404
lines changed

3 files changed

+425
-404
lines changed

lib/sql/parser.racc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ rule
2323
: from_clause where_clause group_by_clause having_clause { result = SQL::Statement::TableExpression.new(val[0], val[1], val[2], val[3]) }
2424

2525
from_clause
26-
: FROM table_reference { result = SQL::Statement::FromClause.new(val[1]) }
26+
: FROM table_reference_list { result = SQL::Statement::FromClause.new(val[1]) }
27+
28+
# NOTE: this node doesn't exist in the SQL-92 grammar
29+
table_reference_list
30+
: table_reference_list comma table_reference { result = Array(val[0]) + Array(val[2]) }
31+
| table_reference
2732

2833
table_reference
2934
: table_name { result = SQL::Statement::Table.new(val[0]) }

0 commit comments

Comments
 (0)