Problem

Currently, the only ways to parse a top-level lis term, are to prepend !ATerm:

test xyz [[...]] run strategy to !ATerm [_]

or to postpend {}:

test xyz [[...]] run strategy to [_]{}

both are kind of ugly.

Proposed Solution

Unless there is a reason for not supporting top-level lists, lists should be parsed without !ATerm prefix or {} postfix:

test xyz [[...]] run strategy to [_]
Submitted by Martijn on 15 April 2017 at 05:29

On 15 April 2017 at 10:26 Daco Harkes commented:

Related issue: https://yellowgrass.org/issue/SPTWithCore/26


On 20 April 2017 at 11:25 Volker commented:

The problem with top level lists is that we can’t distinguish between [[5]] being a Stratego list containing a list with a 5, and an output fragment with program text ‘5’.
This is the reason why top level lists are not supported without the !ATerm prefix.

I guess single lists should not be a problem, so we could do a prefer on fragments in the grammar, but I’m too behind on SDF to know the exact implications of doing that.
The !ATerm prefix was added to keep things simple and moving forward.


On 20 April 2017 at 17:32 Martijn commented:

That makes sense, thanks for clarifying. Lets keep the issue in case someone else runs into this problem.

Log in to post comments