File tree Expand file tree Collapse file tree 1 file changed +23
-28
lines changed
Expand file tree Collapse file tree 1 file changed +23
-28
lines changed Original file line number Diff line number Diff line change @@ -636,39 +636,34 @@ let private joinType =
636636 %% ws -|> Inner
637637 ]
638638
639- let private joinConstraint =
640- %[
641- %% kw " ON" -- +. expr -- ws -|> JoinOn
642- preturn JoinUnconstrained
643- ]
639+ let private joinConstraint = %% kw " ON" -- +. expr -- ws -|> JoinOn
644640
645641let private tableExpr = // parses table expr (with left-associative joins)
646642 let term = tableOrSubquery |> withSource
647643 let natural = %% kw " NATURAL" -|> ()
648644 let join =
649- %% +.(
650- %[
651- %% ','
652- -|> fun left right constr ->
653- { JoinType = Inner
654- LeftTable = left
655- RightTable = right
656- Constraint = constr
657- } |> Join
658- %% +.( natural * zeroOrOne) -- +. joinType -- kw " JOIN"
659- -|> fun natural join left right constr ->
660- let joinType = if Option.isSome natural then Natural join else join
661- { JoinType = joinType
662- LeftTable = left
663- RightTable = right
664- Constraint = constr
665- } |> Join
666- ] |> withSource)
667- -- ws
668- -- +. term
669- -- ws
670- -- +. joinConstraint
671- -|> fun f joinTo joinOn left -> { TableExpr.Source = f.Source; Value = f.Value left joinTo joinOn }
645+ %[ %% ',' -- ws -- +. withSource term
646+ -|> fun right left ->
647+ { TableExpr.Source = right.Source
648+ Value =
649+ { JoinType = Inner
650+ LeftTable = left
651+ RightTable = right.Value
652+ Constraint = JoinUnconstrained
653+ } |> Join
654+ }
655+ %% +.( natural * zeroOrOne) -- +. withSource joinType -- kw " JOIN" -- +. term -- ws -- +. joinConstraint
656+ -|> fun natural join right constr left ->
657+ let joinType = if Option.isSome natural then Natural join.Value else join.Value
658+ { TableExpr.Source = join.Source
659+ Value =
660+ { JoinType = joinType
661+ LeftTable = left
662+ RightTable = right
663+ Constraint = constr
664+ } |> Join
665+ }
666+ ]
672667 %% +. term
673668 -- ws
674669 -- +.( join * qty.[ 0 ..])
You can’t perform that action at this time.
0 commit comments