From 004025c3c4bfb3e9998e5c860700e357d70b41a4 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 23 Apr 2021 14:45:56 -0400 Subject: LibSQL: Parse common-table-expressions with a nested SELECT statement This also moves testing of common-table-expression to its own test case. --- Userland/Libraries/LibSQL/AST.h | 5 +- Userland/Libraries/LibSQL/Parser.cpp | 4 +- .../LibSQL/Tests/TestSqlStatementParser.cpp | 116 ++++++++++++--------- 3 files changed, 71 insertions(+), 54 deletions(-) (limited to 'Userland/Libraries/LibSQL') diff --git a/Userland/Libraries/LibSQL/AST.h b/Userland/Libraries/LibSQL/AST.h index fe8ff4d443..1c7a90eb26 100644 --- a/Userland/Libraries/LibSQL/AST.h +++ b/Userland/Libraries/LibSQL/AST.h @@ -83,18 +83,21 @@ private: class CommonTableExpression : public ASTNode { public: - CommonTableExpression(String table_name, Vector column_names) + CommonTableExpression(String table_name, Vector column_names, NonnullRefPtr& select_statement() const { return m_select_statement; } private: String m_table_name; Vector m_column_names; + NonnullRefPtr