malloy icon indicating copy to clipboard operation
malloy copied to clipboard

precedence problems with partials

Open mtoy-googly-moogly opened this issue 1 year ago • 0 comments

This works ...

source: d is duckdb.sql("select 1 as num, 'a' as str")
run: d -> {
  where:
    num = 1
    and str ? 'a' | 'b'
  select: *
}

This fails ...

run: d -> {
  where:
    str ? 'a' | 'b'
    and num = 1
  select: *
}

Because it is parsing as ...

run: d -> {
  where:
    str ? ('a' | 'b' and num = 1)
  select: *
}

mtoy-googly-moogly avatar Sep 22 '23 15:09 mtoy-googly-moogly