It looks like Regent has trouble parsing when two quoted statements are close to each other. I think there is also an issue for rexpr too. My fix has been to surround quoted statements with ;.
local function genStatement(alpha, beta)
alpha = beta + 3
var a = 1
var b = 2
[genStatement(a, b)] -- Fix by adding `;` here
legion/language/src/regent/specialize.t:144: Errors reported during typechecking.
../bug.rg:12: unable to specialize quoted statement as an expression
[C]: in function 'error'
src/terralib.lua:388: in function 'finishandabortiferrors'
/home/ellis/repos/legion/language/src/common/report.t:56: in function 'error'
/home/ellis/repos/legion/language/src/regent/specialize.t:144: in function 'expr'
/home/ellis/repos/legion/language/src/regent/specialize.t:547: in function 'expr'
/home/ellis/repos/legion/language/src/regent/specialize.t:1639: in function 'stat'
/home/ellis/repos/legion/language/src/regent/specialize.t:1369: in function 'block'
/home/ellis/repos/legion/language/src/regent/specialize.t:1920: in function </home/ellis/repos/legion/language/src/regent/specialize.t:1899>
/home/ellis/repos/legion/language/src/regent/passes.t:59: in function </home/ellis/repos/legion/language/src/regent/passes.t:57>
The text was updated successfully, but these errors were encountered:
This issue is something we inherited from Terra. There is an ambiguity in the expression [...][...]: is this two escapes back-to-back, or is this a nested array reference?
Terra's solution is to insert the ; implicitly when the two sets of brackets are on different lines. I've never been super happy with this, so I didn't implement it in Regent. But I'm not sure there are any other great solutions, so maybe it's time to bite the bullet and just do it.
Unfortunately I think this is not something we're able to fix at the moment, though we could potentially migrate to the solution proposed at terralang/terra#385 (comment) --- but this would be a backwards incompatible change, so it's not obvious the benefits outweigh the costs.