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

ttcn: add "template" ["(omit)" | "(value)" | "(present)"] #3456

Merged
merged 1 commit into from
Aug 22, 2022
Merged

ttcn: add "template" ["(omit)" | "(value)" | "(present)"] #3456

merged 1 commit into from
Aug 22, 2022

Commits on Aug 21, 2022

  1. ttcn: add "template" ["(omit)" | "(value)" | "(present)"]

    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
    neeels committed Aug 21, 2022
    Configuration menu
    Copy the full SHA
    d92a92f View commit details
    Browse the repository at this point in the history