Support top-level lists (ATerm)
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:Submitted by Martijn on 15 April 2017 at 05:29test xyz [[...]] run strategy to [_]
Issue Log
Related issue: https://yellowgrass.org/issue/SPTWithCore/26
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.
That makes sense, thanks for clarifying. Lets keep the issue in case someone else runs into this problem.
Log in to post comments