Skip to content

Commit ca3cde2

Browse files
authored
Engine Refactor #2: Setup Query Parser Test (#85)
* organize queries, setup test for parser * fix syntax * fix tests * update test
1 parent 321549f commit ca3cde2

File tree

4 files changed

+1392
-46
lines changed

4 files changed

+1392
-46
lines changed

core/query_parser.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from core.ast.node import QueryNode
2+
3+
class QueryParser:
4+
5+
def parse(self, query: str) -> QueryNode:
6+
# Implement parsing logic using self.rules
7+
pass
8+
9+
# [1] Call mo_sql_parser
10+
# str -> Any (JSON)
11+
12+
# [2] Our new code
13+
# Any (JSON) -> AST (QueryNode)
14+
15+
def format(self, query: QueryNode) -> str:
16+
# Implement formatting logic to convert AST back to SQL string
17+
pass
18+
19+
# [1] Our new code
20+
# AST (QueryNode) -> JSON
21+
22+
# [2] Call mo_sql_format
23+
# Any (JSON) -> str

0 commit comments

Comments
 (0)