Closed asillye closed 9 years ago
This is question of typing (code validation and name binding), not syntax. Ver.2 in your example is correct one syntax declaration, it needs only validation procedure (can be implemented with rule methods).
Design of typing process for languages is our next milestone.
I think a good example for this would be the PerMember part of the rule method for MapDeclarationBody syntax declaration in NitraSyntax.nitra.
From: someone-with-default-username [mailto:notifications@github.com] Sent: Thursday, November 13, 2014 2:39 PM To: JetBrains/Nitra Subject: Re: [Nitra] Designing a parameter list (#12)
This is question of typing (code validation and name binding), not syntax. Ver.2 in your example is correct one syntax declaration, it needs only validation procedure (can be implemented with rule methods).
Design of typing process for languages is our next milestone.
— Reply to this email directly or view it on GitHubhttps://github.com/JetBrains/Nitra/issues/12#issuecomment-62891003.
Thanks Guys. We worked around currently - let's see V2 with the typing.
This is a little bit howto question - was unsure where to post..
When designing a parameter list, is it possible to force the different types of list elements to appear only once? I mean:
So under MainDef I would like to accept the NamePar, AuthorPar, DescriptionPar in any order but max only once. MainDef1 is almost ok, but enforces order, MainDefVersion2 works without order but accepts any number of parts, and also accepts the same one multiple times. (Currently we use the 2nd with postprocessing..)
Was thinking to just enter all permutations, but I have 15+ different of these params, so that's a no go..
The problem is somewhat similar to C# constructor initialization where you can give each property only once. e.g.
Thank you Adam