-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add meta variables to SDF3 Stratego mix syntax test #65
base: master
Are you sure you want to change the base?
Conversation
I commented some Stratego code that's not parsed quite right. That's:
It's currently parsed as:
It should instead be:
The AST gets more interesting when you use meta list variables as a sublist. It'll be a list that uses I think support for this list stuff mostly needs to be added to the imploder. |
The imploder recognizes lists meta-variables by the constructor With this fix, a simple test for the "reverse statements" strategy that you set up now works (ed74418).
I'm not sure how to reproduce/verify this. Could you check whether this case is also handled correctly when using the |
Oh, I got the constructor name wrong then? Sorry about that. I'll add a test for the meta list variables in the middle of a list. |
Looks like |
I think you're right it is because of the Adding the following does help:
However, somehow, the test fails:
See 47937bc. Is that because of something on Stratego's side? |
TODO
|
…rrectly to Conc, they become list elements instead
@jasperdenkers I've added a Stratego 2 version of the integrationtest, and it looks like the JSGLR2 imploder does not create |
# Conflicts: # org.metaborg.sdf3.meta.integrationtest/editor/Main.esv
"Update mix syntax integrationtest to import module that defined Module start symbol"
@Apanatshka after merging master and applying the same fix as you did in master (ab146a6) to the Stratego 2 version of the integration test (fc6a669), building the Stratego 2 version of the integration test fails with the following:
Since the rest of the setup is similar, is this because the Stratego 2 grammar is different and thus the mix syntax should be set up differently? Did you not experience this failure? |
I've taken some time off (this week and next), but before then I quickly changed the Stratego 2 grammar to have all unique constructor names so we can set up mix syntax in Spoofax 3. I didn't see any integration test errors on master, but I didn't check this branch. Given how the tests are set up without any assumption about Stratego 2 abstract syntax constructor names, I'm surprised this is now failing. |
This adds explicit SDF3 rules that introduce some meta-variables. These used to be introduced in a
variables
section in SDF2, which was a little magical. SDF3 normaliser seems to throw away avariables
section in SDF3 files. The limitation of explicit context-free rules is that this doesn't work for meta-list-variables. So perhaps we should fix the support for thevariables
section, or for explicit list variable rules. You can write them, like:But the parse result isn't quite right.