Using string interpolation in an overlay results in the following kind of error:

    [java] [ Main | critical ] Cannot generate congruence definition from overlay definition
    [java]            ["EXTERNAL_DEF_RULE","(","3",")"]
    [java] Cannot generate congruence definition from overlay definition
    [java] 	"EXTERNAL_DEF_RULE(3)"

which is a bad error message, but there does not seem to be a reason why string interpolation cannot be used in an overlay?

Submitted by Gabriël Konat on 7 May 2014 at 17:42

On 7 May 2014 at 19:04 Vlad Vergu commented:

Not a great error message indeed. The reason for the rejection is that string interpolation is compiled down to a series of applications of concat-strings, but strategy applications are not allowed in an overlay declaration. Perhaps the improvement should be in the way overlays are compiled.


On 7 May 2014 at 22:49 Lennart Kats commented:

Overlays allow for both matching and building. Building with string interpolation is fine, but matching is much trickier. Should greedy matching be used? How does $[ function x [y] ] match “function q() { r(); }”? I’d just tweak the error message for this one and use regular expressions when string matching is needed. (And I’m also not really a fan of overlays in the first place.) Just my .02.

Log in to post comments