fugue / fregot

Fugue Rego Toolkit
Apache License 2.0
233 stars 11 forks source link

"some a, b" not allowed #219

Closed srenatus closed 4 years ago

srenatus commented 4 years ago

The rego code is silly but illustrates the difference:

$ cat foo.rego
package f

x := { "foo", "bar" }

allow {
        some a, b
        x[a] == x[b]
}
$ opa eval -d foo.rego data.f.allow
{
  "result": [
    {
      "expressions": [
        {
          "value": true,
          "text": "data.f.allow",
          "location": {
            "row": 1,
            "col": 1
          }
        }
      ]
    }
  ]
}
$ fregot eval data.f.allow foo.rego
fregot (fatal parse error):
  "foo.rego" (line 6, column 15):
  parse failed:

    6|  some a, b
              ^

  unexpected ,
  expected newline before next statement
$
jaspervdj-luminal commented 4 years ago

Thanks for reporting! Seems like I made a mistake and used . as separator. That's what I get for not adding a test...