diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17e1e92..fe650e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,6 @@ -on: push +on: + push: + pull_request: jobs: test: runs-on: ubuntu-22.04 diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 080ce99..237b6bf 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -1,4 +1,6 @@ -on: push +on: + push: + pull_request: jobs: test: runs-on: ubuntu-22.04 diff --git a/lib/mix/tasks/sql.gen.parser.ex b/lib/mix/tasks/sql.gen.parser.ex index d845d4e..68453fd 100644 --- a/lib/mix/tasks/sql.gen.parser.ex +++ b/lib/mix/tasks/sql.gen.parser.ex @@ -156,7 +156,7 @@ defmodule Mix.Tasks.Sql.Gen.Parser do def insert_node({:with = tag, meta, []}, [{:ident, _, _} = l, {:parens, _, _} = r, {:as = t2, m2, a}], [], context, root) do {[], [], context, root ++ [{tag, meta, [{t2, m2, [[l, r] | a]}]}]} end - def insert_node({:with = tag, meta, []}, unit, acc, context, root) do + def insert_node({:with = tag, meta, []}, [{:ident, _, _}, {:as, _, _}] = unit, acc, context, root) do {[], [], context, root ++ [{tag, meta, unit ++ acc}]} end def insert_node({tag, meta, []}, unit, acc, context, root) when tag in ~w[by in references]a do diff --git a/lib/parser.ex b/lib/parser.ex index 9b854a3..cbc277b 100644 --- a/lib/parser.ex +++ b/lib/parser.ex @@ -126,7 +126,7 @@ defmodule SQL.Parser do def insert_node({:with = tag, meta, []}, [{:ident, _, _} = l, {:parens, _, _} = r, {:as = t2, m2, a}], [], context, root) do {[], [], context, root ++ [{tag, meta, [{t2, m2, [[l, r] | a]}]}]} end - def insert_node({:with = tag, meta, []}, unit, acc, context, root) do + def insert_node({:with = tag, meta, []}, [{:ident, _, _}, {:as, _, _}] = unit, acc, context, root) do {[], [], context, root ++ [{tag, meta, unit ++ acc}]} end def insert_node({tag, meta, []}, unit, acc, context, root) when tag in ~w[by in references]a do