diff --git a/lib/ast.ml b/lib/ast.ml index 8e43286..5d3859f 100644 --- a/lib/ast.ml +++ b/lib/ast.ml @@ -28,8 +28,8 @@ and predicate = | Comparison of operator * predicand | Between of predicand * predicand | NotBetween of predicand * predicand - | In of string list - | NotIn of string list + | In of predicand list + | NotIn of predicand list | Like of string | NotLike of string and operator = @@ -66,7 +66,7 @@ let rec pp_query fmt ast = and pp_select s = match s with - | Select(cols, _, _) -> pp_columns cols + | Select(cols, _, _) -> String.cat "SELECT " (pp_columns cols) and pp_columns cols = match cols with @@ -77,8 +77,10 @@ and pp_columns cols = and pp_column col = match col with | Column(Ref(name),_) -> name + | Column(StringLiteral(name),_) -> "'"^name^"'" + | Column(DateLiteral(name),_) -> "'"^name^"'" | Asterisk -> "*" - | _ -> failwith "not supported" + | _ -> failwith "Pretty parsing of Column not supported" and pp_tables tables = match tables with diff --git a/parser/parser.mly b/parser/parser.mly index 702ee22..7127122 100644 --- a/parser/parser.mly +++ b/parser/parser.mly @@ -509,8 +509,8 @@ as_clause : predicate : | comparison_predicate { $1 } + | in_predicate { $1 } (* | between_predicate { $1 } *) -(* | in_predicate { $1 } *) (* | like_predicate { $1 }*) (*****************)