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

Different syntax for package separator and field access #441

Closed
treiher opened this issue Sep 14, 2020 · 0 comments · Fixed by #443
Closed

Different syntax for package separator and field access #441

treiher opened this issue Sep 14, 2020 · 0 comments · Fixed by #443
Assignees
Labels
specification Related to specification package (e.g., specification parsing)

Comments

@treiher
Copy link
Collaborator

treiher commented Sep 14, 2020

Currently, . is used for two different actions in our specification:

  • Qualifying types and literals imported from another package
  • Accessing message fields

This makes it harder for a reader of the specification to differentiate the meaning of such a construct.

A similar question was already raised in #91, but we decided to keep the dot notation. As we are now integrating support for sessions, I would like to reconsider this decision.

Options

. / . (current syntax; similar to Ada, Python, ...)

      state NETWORK_IN_CONTENT is
      begin
         Plaintext := GreenTLS.Content'(Data => TLS_Record_Message.Fragment);
      transition
         then ERROR_INTERNAL_ERROR
            if Plaintext'Valid = False
         then NETWORK_IN_HANDSHAKE
            if TLS_Record_Message.Tag = TLS_Record.HANDSHAKE
         then NETWORK_IN_ALERT
            if TLS_Record_Message.Tag = TLS_Record.ALERT
         then ERROR_INTERNAL_ERROR
      end NETWORK_IN_CONTENT;

:: / . (similar to C++, Rust)

      state NETWORK_IN_CONTENT is
      begin
         Plaintext := GreenTLS::Content'(Data => TLS_Record::Message.Fragment);
      transition
         then ERROR_INTERNAL_ERROR
            if Plaintext'Valid = False
         then NETWORK_IN_HANDSHAKE
            if TLS_Record::Message.Tag = TLS_Record::HANDSHAKE
         then NETWORK_IN_ALERT
            if TLS_Record::Message.Tag = TLS_Record::ALERT
         then ERROR_INTERNAL_ERROR
      end NETWORK_IN_CONTENT;

\ / -> (similar to PHP)

      state NETWORK_IN_CONTENT is
      begin
         Plaintext := GreenTLS\Content'(Data => TLS_Record\Message->Fragment);
      transition
         then ERROR_INTERNAL_ERROR
            if Plaintext'Valid = False
         then NETWORK_IN_HANDSHAKE
            if TLS_Record\Message->Tag = TLS_Record\HANDSHAKE
         then NETWORK_IN_ALERT
            if TLS_Record\Message->Tag = TLS_Record\ALERT
         then ERROR_INTERNAL_ERROR
      end NETWORK_IN_CONTENT;
@treiher treiher created this issue from a note in RecordFlux 0.5 (To do) Sep 14, 2020
@treiher treiher added the specification Related to specification package (e.g., specification parsing) label Sep 14, 2020
@treiher treiher self-assigned this Sep 14, 2020
@treiher treiher moved this from To do to In progress in RecordFlux 0.5 Sep 14, 2020
treiher added a commit that referenced this issue Sep 15, 2020
@treiher treiher moved this from In progress to Done in RecordFlux 0.5 Sep 15, 2020
treiher added a commit that referenced this issue Sep 15, 2020
RecordFlux 0.5 automation moved this from Done to Merged Sep 15, 2020
treiher added a commit that referenced this issue Sep 15, 2020
treiher added a commit that referenced this issue Sep 15, 2020
@treiher treiher mentioned this issue Aug 4, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
specification Related to specification package (e.g., specification parsing)
Projects
No open projects
RecordFlux 0.5
  
Merged
Development

Successfully merging a pull request may close this issue.

1 participant