-
Notifications
You must be signed in to change notification settings - Fork 620
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
ttcn: add "template" ["(omit)" | "(value)" | "(present)"] #3456
Conversation
Thank you. Could you add a test case? |
@akrzyz, could you review this? |
Looks fine but please add test case for TemplateRestriction and test there all three possible restrictions. |
Codecov Report
@@ Coverage Diff @@
## master #3456 +/- ##
=======================================
Coverage 83.32% 83.32%
=======================================
Files 219 219
Lines 52750 52752 +2
=======================================
+ Hits 43956 43958 +2
Misses 8794 8794
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Thanks for your review! |
See #3466. |
Modern TTCN3 has TemplateRestriction keywords, which improve detection of invalid template use at compile time. They simply add one of "(omit)", "(value)", "(present)" after the "template" keyword. Example: template (value) ts_FOO_Request(integer bar := 0) := { member := bar }; template (present) tr_FOO_Request(template integer bar := *) := { member := bar }; Before this patch, u-ctags would not tag these two definitons above, making my work on the Osmocom test suite hard. (See https://gitea.osmocom.org/ttcn3/osmo-ttcn3-hacks) At first I tried to exactly match the three keywords within the braces, but the token parsing does not support unrolling more than one token. So if an unmatching token follows after the opening brace, I cannot un-get the opening brace. The easiest solution, and one that also is tolerant to keyword typos, is to just accept any braces after "template". Related: ETSI ES 201 873-1 V4.14.1 § A.1.6.1.3
done |
Modern TTCN3 has TemplateRestriction keywords, which improve detection
of invalid template use at compile time. They simply add one of
"(omit)", "(value)", "(present)" after the "template" keyword.
Example:
template (value) ts_FOO_Request(integer bar := 0) :=
{ member := bar };
template (present) tr_FOO_Request(template integer bar := *) :=
{ member := bar };
Before this patch, u-ctags would not tag these two definitons above,
making my work on the Osmocom test suite hard. (See
https://gitea.osmocom.org/ttcn3/osmo-ttcn3-hacks)
At first I tried to exactly match the three keywords within the braces,
but the token parsing does not support unrolling more than one token. So
if an unmatching token follows after the opening brace, I cannot un-get
the opening brace. The easiest solution, and one that also is tolerant
to keyword typos, is to just accept any braces after "template".
Related: ETSI ES 201 873-1 V4.14.1 § A.1.6.1.3