-
Notifications
You must be signed in to change notification settings - Fork 1
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
Compact syntax for binary pattern reuse #13
Comments
By Gabor Bergmann on Jan 03, 2014 04:31 +1 As for the escape syntax brainstorm: I have some reservations about adding more special characters for the user to learn. One solution for escaping without special characters: School.(find students).name(Sch, SName) It reuses the existing keyword for pattern composition. But this is not completely satisfying either, as it is only half as concise as the special character based approach. Any better ideas? Fortunately, such escaping should not be required in most cases. |
By Eric Lépicier on Jan 03, 2014 07:17 (In reply to Gabor Bergmann from comment #1)
Well, I easily learnt the ^ and _ usage with the really clear warnings ...
I can't say I like this syntax ... The idea was to have it looking identical to a real feature in most cases.
An escape character, suggested by a good warning ? ;-)\
Sure. In fact, this kind of syntax is common in Acceleo. One can write queries which can be called like a method on their first parameter. |
By Eric Lépicier on Jan 06, 2014 12:45 (In reply to Eric Lépicier from comment #2)
Well, Acceleo gives the priority to the model feature operation, it seems it ignores the overriding user query without warning ... |
By Istvan Rath on Apr 08, 2014 18:02 Moving this feature to post-0.8. |
By Istvan Rath on Apr 24, 2014 04:30 I'm expecting this to be addressed for 0.9. |
By Abel Hegedus on Apr 19, 2016 05:25 Updating to correct milestone. |
By Zoltan Ujhelyi on Oct 04, 2017 05:26 Moving potential tasks from future to 2.0. |
By Zoltan Ujhelyi on Feb 08, 2018 07:21 Postponing to a future release. |
By Zoltan Ujhelyi on May 27, 2019 07:45 Postponing tickets to FUTURE until effort is allocated to fix them. |
| --- | --- |
| Bugzilla Link | 424612 |
| Status | NEW |
| Importance | P3 enhancement |
| Reported | Dec 23, 2013 09:00 EDT |
| Modified | May 27, 2019 07:45 EDT |
| Version | oldinquery |
| Reporter | Eric Lépicier |
Description
The only way to re-use a pattern is the “find” syntax.
When patterns have two parameters, they could be considered as a pseudo query-based feature.
It would then be great to be able to use them like features.
An example:
With:
pattern students(Sch, S) {
School.courses.schoolClass.students(Sch,S);
}
The pattern:
pattern schoolStudentsName(Sch, SName) {
find students(Sch, S);
Student.name(S, SName);
}
Could be written:
pattern schoolStudentsName(Sch, SName) {
School.students.name(Sch, SName);
}
This syntax would be more compact and allows dot notation cascading.
A special character may be added (like _ for expliciting unused variables, or ^ escape character for keywords) to make it explicitly a sub-pattern call whenever it would be ambiguous with a real feature.
The text was updated successfully, but these errors were encountered: