-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"ProductionStmt-level case" (and if) #864
Comments
I like the idea here, this is something I've found myself wanting sometimes. This feels like a more natural approach than implicit monads, for writing attribute equations that are only valid in some contexts. The most scenarios for this are some version of an environment lookup, where we don't want to write a We should probably push the pattern matching as deep in to the expressions as possible, to avoid unneeded data dependencies on sub-expressions that cause circularites and limit the use of sharing. For example,
should translate to something like
and not
This also makes tree sharing with a conditional forward to an error production a bit cleaner:
which would translate to something like
The main question I have is how aspects should be handled. It seems that we should be able to declare production attributes in condition bodies, but there would need to be some way of aspecting a particular condition for them to be in scope. Perhaps conditions should be named? This would also avoid name collisions between locals with the same name in different conditions:
I'm not sure I love that syntax, though. |
I'm also now realizing that this feature is largely redundant with dispatch productions. For type checking / environment lookups, you can structure the main production to forward to either an error production, or an implementation production with the lookup result:
|
Sometimes it would be nice to write:
and have it forward to:
I feel like we discussed this ages ago, but I didn't find an issue just now.
{}
.=
/:=
eqtns must appear on all branches if they appear on any; i think this could be handled on the forward tree tbh.<-
for monoid attributes can appear anywhere, they probably need to get collected up.<-
eqtns for non-monoid collection attributes must appear in every branch, but it should be fine if they appear a different number of times in each branch.propagate
, or anything else not mentioned here.Whoever's implementing this should probably do it for
if
as well; I think that's less useful, but it should be easy to do at the same time.I think I'm gonna claim this is a good first issue for working on Silver itself? It should be able to be an extension that doesn't do much analysis, at least (I think).
The text was updated successfully, but these errors were encountered: