Skip to content
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

Allowing a broader range of syntax might increase the implementation effort of tooling (single-line grammar vs extended grammar) #166

Open
r0light opened this issue Aug 21, 2024 · 0 comments

Comments

@r0light
Copy link

r0light commented Aug 21, 2024

Hi all,
while using TOSCA as a modeling basis, I implemented a small tool to parse TOSCA files. Based on this, I wanted to add the following thing to the discussion:

Being more tolerant regarding the syntax might in some cases increase the implementation effort for corresponding tooling. Therefore it might be worth to consider a stricter syntax at some places.
One example: For Requirement Assignments (8.7.2 in TOSCA 2.0 csd06) it is possible to use both the extended syntax, such as:

<requirement_name>:
    node: <node_template_name>

or a single-line grammar:

<requirement_name>: <node_template_name>

While it is nice to allow this for writing TOSCA, it slightly increases the implementation effort for tooling. In my case I was using TypeScript and thus had to make a distinction in the code between whether the value is a string or an object for further processing.
So from an implementation perspective, I would argue that it would simplify things, if only the "extended syntax" would be allowed in this case. Also since the difference between the two styles considering the example above is minimal, in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant